Friday, July 30, 2010

Tracing symbolic links:-

Here is an easy way to trace the end point of a cascaded symbolic link ?


ex:- namei /dev/dvd

namei /dev/dvd
f: /dev/dvd
d /
d dev
l dvd -> sr0
b sr0

Get Flash Working in Flock Browser in Ubuntu

Many readers complained yesterday that Flock browser I reviewed about yesterday [here] had one major problem - It cannot play flash content. I too faced the same problem and finally here is the

solution:

Fire up the terminal and paste this in it:
sudo nautilus
Navigate to the folder:
usr/lib/firefox/plugins and copy the only file present there 'flashplugin-alternative.so'
to this folder:
/opt/flock/plugins

Restart Flock and you will have flash working.

if this is not working get the flashplugin so file from here :- http://get.adobe.com/flashplayer/ and put the so file in /opt/flock/plugins


Tested on ubuntu 10.04

see:- http://ubuntuforums.org/showthread.php?t=1164128 for installing flock

Recover lost bash history:-

shopt -s histappend
PROMPT_COMMAND=`history -a`

see:- http://www.faqs.org/docs/bashman/bashref_55.html#SEC55

Thursday, July 29, 2010

Extract the contents of a deb or rpm package ?

* rpm package can be extracted by issuing this command at the command line.

$rpm2cpio {rpm-package name} | cpio -idv

* deb packages can be extracted by issuing this command at the command line.

$dpkg-deb -x {deb-package name} {target directory}

Measuring Throughput with iperf ?

iperf utility for measuring TCP & UDP performance b/w 2 end points .
it must be installed at both ends of the connection you are measuring


zodiac@gml-admin:~$ iperf -c 192.168.0.210
------------------------------------------------------------
Client connecting to 192.168.0.210, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.17 port 48568 connected with 192.168.0.210 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 108 MBytes 90.5 Mbits/sec



[root@backup ~]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 192.168.0.210 port 5001 connected with 192.168.0.17 port 48568
[ 4] 0.0-10.1 sec 108 MBytes 90.0 Mbits/sec

Bi directional test or how efficient is your Ethernet Duplexing:-

zodiac@gml-admin:~$ iperf -c 192.168.0.210 -d
------------------------------------------------------------
Client connecting to 192.168.0.210, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.17 port 55554 connected with 192.168.0.210 port 5001
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 5] local 192.168.0.17 port 5001 connected with 192.168.0.210 port 41681
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.1 sec 9.38 MBytes 7.78 Mbits/sec
[ 5] 0.0-10.3 sec 114 MBytes 92.8 Mbits/sec

unidirectional testing or Half duplexing ?

zodiac@gml-admin:~$ iperf -c 192.168.0.210 -r
------------------------------------------------------------
Client connecting to 192.168.0.210, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.0.17 port 40551 connected with 192.168.0.210 port 5001
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
Waiting for server threads to complete. Interrupt again to force quit.
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 107 MBytes 89.1 Mbits/sec