Count number of lines of code
Here’s quicky. Let’s say you want to count the number of lines of code in all JAVA files, you would simply execute:
wc -l `find -name "*.java"`
![]() |
UbuntuedAdopting Tux Full-Time! |
Here’s quicky. Let’s say you want to count the number of lines of code in all JAVA files, you would simply execute:
wc -l `find -name "*.java"`
SSH can be used to tunnel a connection from one computer to another. That is when you access the internet from computer A, it will seem like you are accessing it from computer B. This is useful for bypassing the restriction on content imposed from computers in schools, coffee shops, or companies. You can also benefit from the services offered in one specific network.
From a unix environment, simply execute the following replacing username and server by the appropriate values. This will create a SOCKS proxy on port 3333 (you can of course use another port):
ssh -D 3333 -f -C -q -N username@server
Now, you just need to modify your browser preferences to use that proxy and you’re done. In Firefox, head to preferences and find the connection settings. Use manual proxy configuration, and enter in the SOCKS proxy field localhost on port 3333.
The main reason limiting individuals from moving permanently from Windows to Ubuntu is the lack of support for numerous software applications. Fortunately, this reality is changing because of the growing Ubuntu community contributing to the process through developing Open Source alternatives, and the expansion of the Linux market attracting the attention of proprietary application developers.
Although some applications run quite smoothly through the excellent Wine package, others cause much trouble and you just need to run Windows in order to get the job done. Thanks to virtualization and VMware Player, a completely free application, you can now run Windows XP directly within your Ubuntu system. Note that this process might take some time but is worth it (take a look below). Let’s get started!

sudo apt-get install build-essential linux-headers-`uname -r` gcc-3.4 g++-3.4 wine.tar version) and install it as follows:tar xvzf VMware-player-2.0.2-59824.i386.tar.gz
cd vmware-player-distrib
export CC=/usr/bin/gcc-3.4
sudo ./vmware-install.plmkdir ~/winxp
cd ~/winxp10G (that’s 10 Gigabytes) to whatever you need:wine ~/.wine/drive_c/Program\ Files/Qemu/qemu-img.exe create -f vmdk WindowsXP.vmdk 10G Formating 'WindowsXP.vmdk', fmt=vmdkumount /media/cdrom0dd if=/dev/cdrom of=WindowsXP.isoWindowsXP.iso; be patient, it might take some time to complete (took me about 4 minutes).gedit WindowsXp.vmxmemsize value.#!/usr/bin/vmware
config.version = "8"
virtualHW.version = "3"
ide0:0.present = "TRUE"
ide0:0.filename = "WindowsXP.vmdk"
memsize = "256"
MemAllowAutoScaleDown = "FALSE"
ide1:0.present = "TRUE"
ide1:0.fileName = "WindowsXP.iso"
ide1:0.deviceType = "cdrom-image"
ide1:0.autodetect = "TRUE"
floppy0.fileType = "file"
floppy0.fileName = ""
floppy0.startConnected = "True"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Windows XP"
guestOS = "winxp"
nvram = "WindowsXP.nvram"
MemTrimRate = "-1"
ide0:0.redo = ""
ethernet0.addressType = "generated"
uuid.location = "56 4d cd 3f 59 5b 61 43-fd 73 ef 46 56 4c 23 7b"
uuid.bios = "56 4d cd 3f 59 5b 61 43-fd 73 ef 46 56 4c 23 7b"
ethernet0.generatedAddress = "00:0c:29:4c:23:7b"
ethernet0.generatedAddressOffset = "0"
tools.syncTime = "TRUE"
ide1:0.startConnected = "TRUE"
uuid.action = "create"
checkpoint.vmState = "WindowsXP.vmss"
tools.remindInstall = "TRUE"WindowsXp.vmx through VMwarePlayer (double clicking on the file will do), and go through the Windows XP installation, this might take anything from 15 min to 1 h depending on your system specifications.
Some time later… after installation is completed, you’re done! You can now launch Windows Xp from Applications -> System Tools -> VMWare Player and the speed is almost similar to that of running it as a main operating system.
This tutorial is partly based on dryandplain’s HOWTO on Ubuntu Forums.
Whether you want to open ie-specific web sites or test and debug your application, running internet explorer on ubuntu might come in handy at some point. Microsoft doesn’t offer a linux version of Internet Explorer, so the trick is to run IE through Wine, the windows api implementation for linux.
First make sure you have wine. If you don’t, run:
sudo apt-get install wine
Then download and execute IEs4Linux, a collection of internet explorer versions since v5, as follows:
wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
tar zxvf ies4linux-latest.tar.gz
cd ies4linux-*
./ies4linux
This will launch an installation panel. You can select which versions of internet explorer you would like to have available, whether you want to enable flash, etc.

Confirm installation by clicking OK.
Once complete, you can simply execute internet explorer from /home/user/bin
I don’t really care why you want to change your MAC address on Ubuntu, you’re probably trying to break into your neighbor’s internet connection again… I’m sure though this will come in handy at some point.

eth0 or and Wifi is eth1). If you’re not sure, type the following to find out:ifconfigeth1 Link encap:Ethernet HWaddr 00:10:6A:01:FD:92 sudo ifconfig downeth1 and 00:11:22:33:44:55 by your connection and new MAC address respectively):sudo ifconfig eth1 hw ether 00:11:22:33:44:55sudo ifconfig upTo make the MAC address change permanent, proceed as follows:
bootmisc.sh file with your favorite editor:sudo gedit /etc/init.d/bootmisc.shkillall dhclient
killall dhclient3
ifconfig eth1 down
ifconfig eth1 hw ether 00:11:22:33:44:55
ifconfig eth1 up
/sbin/dhclient
/sbin/dhclient3