Monday, September 17, 2012


Did you know that the latest VLC player version they can get is 1.1.12?  As of today, the most recent version available is 2.0.4 which is able to install from Ubuntu 12.04. So, VLC users have to either have to upgrade Ubuntu version, or be stick with an older 1.x versions.

But there is a way to install VLC via a PPA from VLC Daily Build of master branch. It's ppa:videolan/master-daily . I first tried ppa:n-muench/vlc, but it never worked for me. This worked flawlessly. The technically savvy people may now go ahead and install VLC by using this PPA. Others or if you are just interested, follow the instructions below to get it installed.

First enter the following command to add this PPA to your software sources

sudo add-apt-repository ppa:videolan/stable-daily

Now, you can update your software indexes, and install VLC.

sudo apt-get update && sudo apt-get install vlc

Now, you have a nice looking VLC at your hand. They say the performance is improved too among other new features. But I'm yet to test those! :-)

Wednesday, September 12, 2012

Linux commands I can not afford to lose

HTTP Requests -
GET - wget

GET request - curl --request GET http://localhost:9763/services/StudentService.StudentServiceHttpEndpoint/student/kasun

POST request - curl -d "age=01&name=kasun&subjects=unix" http://localhost:9763/services/StudentService.StudentServiceHttpEndpoint/student/kasun

SOAP POST request to a SOAP 1.2 endpoint -
curl -d '<soapenv:Envelope xmlns:soapenv=""><soapenv:Body><p:echoString xmlns:p=""><in>kasun</in></p:echoString></soapenv:Body></soapenv:Envelope>'   -H "Content-Type: application/soap+xml"    http://localhost:9443/services/echo

Other commands - PUT, DELETE

SCP - 
scp -r -P 2200 /home/kasun/docbook-webhelp/

grep -ri "example" ../../ --include "*xml" -A5 -B5
find ../.. -iname "*xml"
tail -f target/carbontmp/wso2as-4.1.0-SNAPSHOT/repository/logs/wso2carbon.log

Replace a given word with a new one from a set of files - Here, I'm replacing the word 'oldWord' with 'newWord' of a set of files that ends with .xml in the current folder.

find . -name "*.xml" -exec sed -i "s/oldWord/newWord/g" '{}' \;

to replace the word "<webXml>${basedir}/../../web.xml</webXml>" with newWord. Note the escape charater (\) before $ and /. Used : for easy writing.

find . -name "pom.xml" -exec sed -i "s:<webXml>\${basedir}/../../web.xml<\/webXml>:newWord:g" '{}' \;

Find running Java processes - ps ax | grep java
Kill a process - kill -9 <process-id>

Get only the modified files - svn status | egrep  "^M"
Create patch - svn diff > my-contribution.patch
Apply patch - patch -p0 < my-contribution.patch

Extract files -
tar -xjf my-archive.tar.bz2
tar -xzf my-archive.tar.gz

Get the disk usage of a directory, sorted - du -s ./* | sort -g
Shutdown - sudo shutdown -h now
Reboot - reboot

The archive reader - file-roller
PDF reader - evince
Partition editor - gparted

Find the VGA driver in the machine - lspci -v | grep -i vga
Find attached USB devices - lsusb

Only copy a set of symbolic links in the current directory, and copy those to a separate folder. I did this in Ubuntu.
cp `l -1 | grep -ri @ | grep -ri "[^@]*" -o` ../my-symlinks/ -P

l -1 | grep -ri @ | grep -ri "[^@]*" -o - Selects outputs the file names of the symlinks. Then we copy it using cp with the parameter -P. -P means that cp won't follow the symlinks.

Bash for loop - in one line

for file in `fn pom.xml`; do echo $file; done


Mount in Linux/Ubuntu

ifuse <mount_point> --root   - Only add --root if the phone is jail broken. Only jail broken phones can access the root / location.
ifuse /mnt/iPhone --root