rajaseelan.com

junk food for the brain …

Friday
Jul 3,2009

There are many services available to check your IP Address and hostname. Wing Loon has one, called IPVEE.com

Its main features are the ability to:

  • show ip address
  • show hostname
  • find your real ip address
  • Flash & Java Plugin Version

Unlike most other sites, its key strengths lie in its visually appealing way of displaying the information. This can come in extremely handy especially when helping the less technically inclined among your friends.

Unlike the other sites, IPVEE.com uses a simple JQuery Slider, with the essential information separated by 3 different links. Check out this screenshot:-


Nice right? Go to IPVEE.com ;)

Friday
Jul 3,2009

When you administer clusters, you will eventually encounter applications that still use rsh to connect between nodes.

In my place, we use Red Hat Enterprise Linux 5 (RHEL5) for the cluster nodes. In order for the application to run, we need to enable passwordless logins via rsh, in order for the Message Passing Interface & Node Management Software to work. There are a few ways to do this, this is how I did it. Security Professionals will be screaming though.

  1. Firstly, make sure you have installed the rsh-server rpm package.
    [root@node01 ~]# yum install rsh-server
    Loaded plugins: rhnplugin, security
    This system is not registered with RHN.
    RHN support will be disabled.
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package rsh-server.i386 0:0.17-38.el5 set to be updated
    --> Finished Dependency Resolution
     
    Dependencies Resolved
     
    ================================================================================
     Package           Arch        Version               Repository            Size
    ================================================================================
    Installing:
     rsh-server        i386        0.17-38.el5           rhel-selrepos         39 k
     
    Transaction Summary
    ================================================================================
    Install      1 Package(s)         
    Update       0 Package(s)         
    Remove       0 Package(s)         
     
    Total download size: 39 k
    Is this ok [y/N]: y
    Downloading Packages:
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : rsh-server                                        [1/1] 
     
    Installed: rsh-server.i386 0:0.17-38.el5
    Complete!
  2. Make sure the rsh, rlogin, rexec, xinetd are turned on and then restart xinetd.
    [root@node01 ~]# chkconfig rsh on
    [root@node01 ~]# chkconfig rexec on
    [root@node01 ~]# chkconfig rlogin on
    [root@node01 ~]# chkconfig xinetd on
    [root@node01 ~]# service xinetd restart
    Stopping xinetd:                                           [  OK  ]
    Starting xinetd:                                           [  OK  ]
  3. Edit your /etc/securetty file. Append the following
    rsh
    rexec
    rlogin
  4. You’ll then need to create a .rhosts file in the user’s home directory, with the host names of the machines you wish to allow to connect.
    Note:These machines should be resolvable via either DNS or put in your /etc/hosts file.

    node01
    node02
    node03

    Also, make sure the file permissions are 0600.

    chmod 0600 ~/.rhosts

You should be able to rsh in now. :)

Tuesday
Jun 30,2009

For a lot of people, the lack of a proper downloader in linux to use with their premium rapidshare accounts seems to be quite a turn off. Well, there’s jDownloader, but I find that a bit too heavy. Unknown to them, they already have a good downloading tool, called wget.

Its basically a two step process being:

  1. Saving a cookie with your Rapidshare login details in it. To do that, just enter the following command:
    $ wget --save-cookies ~/cookies.txt --post-data "login=USERNAME&password=PASSWORD" -O - https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi > /dev/null

    Replace USERNAME & PASSWORD with your own Rapidshare details.
    What this script does is login to Rapidshare and saves the cookie to a file named cookies.txt in your home directory. Any normal HTML output is piped to the resident unix blackhole, /dev/null.

  2. Downloading your file using the cookie to supply your Rapidshare credentials. Now that we’ve saved your cookie information, you can go ahead and download to your heart’s content (or maybe daily limit). Here’s an example of how you’d do that. Remember that the cookie you created previously was stored in your home directory. For most linux shells, you can refer to it like this:- ~/cookies.txt

    To actually download, use the following command:-

    wget --load-cookies ~/cookies.txt your-rapidshare-url.com/file-link.html

Happy downloading. :)

VirtualBox 3.0 Released

Tuesday
Jun 30,2009

VirtualBox

VirtualBox

VirtualBox 3.0 has been released!!! Highlights for me are:

  • Windows guests: ability to use Direct3D 8/9 applications / games (experimental)
  • Support for OpenGL 2.0 for Windows, Linux and Solaris guests
  • USB: Support for high-speed isochronous endpoints has been added. In addition, read-ahead buffering is performed for input endpoints (currently Linux hosts only). This should allow additional devices to work, notably webcams

Looks interesting. Read the full changelog. Go ahead and download.

How to search and replace in Vim

Thursday
Jun 25,2009

Just for reference, may help other people. Searching for text and replacing in vim is an invaluable skill, which helps sysadmins during the conf. file troubleshooting.

For example, assume you have this /etc/hosts file with a list of machines that are numbered sequentially. For some insane reason, some dude suggests a now naming scheme. Replacing 10 or 15 lines manually is a pain, not to mention error prone.

192.168.0.1	node01
192.168.0.2	node02
192.168.0.3	node03
192.168.0.4	node04
192.168.0.5	node05
192.168.0.6	node06

Now, your resident office genius decides that the names for these machines should be cluster-nodexx instead of nodexx. Great, now imagine having 200 machines in your hosts file. No way you’re going to manually edit that by hand. This is where vim’s search & replace function comes in handy.

First, open the file in vim:

# vim hosts

Now, to replace the the word node with cluster-node, press the colon “:” to enter command mode an type the following:-

:%s/node/cluster-node/gc

Lets break down the command.

  • %s : instructs vim to search
  • /node/: The words within the first two forward slashes are the characters vim will search for
  • /cluster-node/: The words between the second and third forward slashes are what vim will replace node with.
  • g: after the thrid forward slash, the ‘g’ stands for global. Without this, vim will only replace the first occurrence of the word node.
  • c: ‘C’ will make vim prompt you for confirmation before replacing the word. Very handy especially when editing source or configuration files.
  • Here’s an example of how this would look like:
    vim-search_n_replace

    Note the highlighted matches, and the prompt below asking for your confirmation.

This should help you do some mass replacing with ease.

How to speed up liferea load times

  • Filed under: linux
Saturday
Jun 20,2009

After using using Liferea for a while, it tends to slow down during startup. This is most probably caused by the sqlite database it uses becoming fragmented. Using the sqlite VACUUM command helps solve this.

To run this, do the following:

  1. Shutdown liferea.
  2. Run the following command:
    sqlite3 ~/.liferea_1.4/liferea.db "VACUUM;"
  3. Load up liferea and feel the speed difference

Source:
Liferea Developer blog

The Obama-natar

  • Filed under: Life
Friday
Jun 19,2009

Yes, apparently being the president of one of the most powerful countries in the world requires leet fly swatting relfexes that may put Mr. Miyagi to shame. Check it out :)

The Obama-nator

Wednesday
Jun 17,2009

A simple tip for anyone, uploading files using the curl command line tool.

curl -T filename.ext -u username:password ftp://ftpserver.com

The command explained:

  • -T The switch that tells curl this is a transfer
  • -u Your username and password, seperated by a colon. ‘:’
Saturday
May 2,2009

Apparently a little hack or two is required to be able to mount NFS share from linux on Opensolaris.

On the linux side:

  1. Edit your /etc/exports file, add the following sec= parameter for the share, eg.
    /mnt/sandworm 192.168.0.100(rw,no_root_squash,sec=sys)

On Opensolaris, apparently by default it tries to mount shares using NFSv4. There are 2 ways you can change that.

  1. Edit your /etc/default/nfs so that the NFS_CLIENT_VERSMAX=4 is changed to 3.
  2. Specify option during your nfs mount. This is less intrusive to the system defaults and is my preferred way of doing things. To mount with options, you can specify it using the following format:-

    root@opensolaris.dune:~# mount -F nfs -o vers=3,sec=sys atom:/mnt/sandworm /mnt/nfs

    The important parts to note are the -o switch, with the vers=3 and sec=sys.

Now that you’ve got that right, you have go ahead and play with your shared files.

Sources:-
Opensolaris can’t mount disk
Fedora Bug 467613

Monday
Mar 9,2009

After deciding that compiling Boxee for Fedora was quite a futile attempt, I installed Ubuntu 8.10 (Intrepid Ibex) on my desktop PC, just to run it.

One of the first things I needed to do was install the latest updates for it. Thats when I realised that I didn’t know nuts about software installation in Ubuntu, other than it was apt-get something.

After reading up the ubuntu docs, and a little googling around, I’ve compiled a list of common tasks I do with yum on Fedora and its Ubuntu equivalents.

  1. yum upgrade is apt-get upgrade

    This one is a little tricky. You should first run apt-get update to get the updated list of files in from the repository. Then follow up by the apt-get upgrade.

  2. yum search packagename is apt-cache search packagename

    The indispensable yum search is apt-cache search. Good to look through the repositories to determine which package you need to install. Just like yum, you could search for terms or keywords, apt-cache will give you the packages that have matching descriptions.

  3. yum info packagename is apt-cache show packagename

    Like yum info, this provides descriptions on the packages you want to install. An interesting addition comapred to Fedora is the Suggests: column, which gives you additional packages that you might want to install to enhance functionality of the program.

    Here’s a sample:-

    raja@atom:~/Examples$ apt-cache show mplayer
    Package: mplayer
    Priority: extra
    Section: multiverse/graphics
    Installed-Size: 10088
    Maintainer: Ubuntu MOTU Developers <ubuntu -motu@lists.ubuntu.com>
    Original-Maintainer: Ubuntu MOTU Media Team <motumedia @tauware.de>
    Architecture: i386
    Version: 2:1.0~rc2-0ubuntu17
    Replaces: mplayer-nogui
    Depends: libaa1 (>= 1.4p5), libartsc0 (>= 1.5.9), libasound2 (>> 1.0.17), libatk1.0-0 (>= 1.20.0), libaudio2, libaudiofile0 (>= 0.2.3-4), libc6 (>= 2.7), libcaca0 (>= 0.99.beta13b-1), libcairo2 (>= 1.2.4), libcdparanoia0, libcucul0 (>= 0.99.beta13b-1), libdbus-1-3 (>= 1.0.2), libdbus-glib-1-2 (>= 0.71), libdv4, libenca0 (>= 1.9), libesd-alsa0 (>= 0.2.35) | libesd0 (>= 0.2.35), libfaac0 (>= 1.26), libfontconfig1 (>= 2.4.0), libfreetype6 (>= 2.3.5), libfribidi0 (>= 0.10.9), libgcc1 (>= 1:4.1.1), libggi2 (>= 1:2.2.2), libgif4 (>= 4.1.6), libgl1-mesa-glx | libgl1, libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.14.1), libjack0 (>= 0.109.2), libjpeg62, liblircclient0, liblzo2-2, libmad0 (>= 0.15.1b-3), libmp3lame0 (>= 3.98), libmpcdec3, libncurses5 (>= 5.6+20071006-3), libogg0 (>= 1.0rc3), libopenal1 (>= 1:1.3.253), libpango1.0-0 (>= 1.21.6), libpng12-0 (>= 1.2.13-4), libpulse0 (>= 0.9.8), libsdl1.2debian (>= 1.2.10-1), libsmbclient (>= 3.0.24), libspeex1 (>= 1.2~beta3-1), libstdc++6 (>= 4.1.1), libsvga1, libtheora0 (>= 0.0.0.alpha7.dfsg-1.1), libvorbis0a (>= 1.1.2), libx11-6, libx264-59 (>= 1:0.svn20080408), libxext6, libxinerama1, libxt6, libxv1, libxvidcore4 (>= 1:1.0.0-0.0), libxvmc1, libxxf86dga1, libxxf86vm1, zlib1g (>= 1:1.1.4), ttf-bitstream-vera, mplayer-skins, ttf-dejavu
    Suggests: w32codecs, libdvdcss, mplayer-doc, ladspa-sdk
    Conflicts: mplayer-nogui
    Filename: pool/multiverse/m/mplayer/mplayer_1.0~rc2-0ubuntu17_i386.deb
    Size: 4425834
    MD5sum: c34e4650c294bf0277d37432bdd81bde
    SHA1: da382398f120a0ecb421ac160d4d5676c081b27a
    SHA256: edf9c491e09c9f215a57db60df2ba94d17561ea20d890d576f5202a760dd5ad0
    Description: The Ultimate Movie Player For Linux
     It plays most mpeg, avi and asf files, supported by many native and win32
     DLL codecs. You can watch VCD, DVD and even DivX movies too. The other
     big feature of mplayer is the wide range of supported output drivers. It
     works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and
     this way all drivers of SDL) and some lowlevel card-specific drivers (for
     Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling,
     so you can enjoy movies in fullscreen.
     .
     This version includes the Gtk GUI
    Bugs: mailto:ubuntu-users@lists.ubuntu.com
    Origin: Ubuntu
    </motumedia></ubuntu>

  4. yum deplist is apt-cache showpkg

    Provides similiar information, giving you an idea of the additional dependencies required to run the program.

  5. yum grouplist is tasksel –list-tasks

    Yum in Fedora has groups. So does Ubuntu. Finding it involved a little google-fu, but they work relatively the same. I sort of like the way tasksel lists its already installed / available packages. Seems more neat to me, eventhough new users may encounter a WTF??? moment looking at the the u & i prepended on the task names.

  6. yum groupinfo a combo of 2 separate tasksel commands

    yum groupinfo gives you a description of the task or group, as well as a list of packages that need to be installed To get similiar info from tasksel, run tasksel –task-desc lamp-server to get a brief description on the task. e.g.

    raja@atom:~/Examples$ tasksel --task-desc lamp-server
    Selects a ready-made Linux/Apache/MySQL/PHP server.

    To get a list of packages that task installs, run tasksel –task-packages taskname.

    raja@atom:~/Examples$ tasksel --task-packages lamp-server
    libwrap0
    apache2
    mysql-client-5.0
    tcpd
    libapache2-mod-php5
    apache2.2-common
    apache2-utils
    php5-common
    libaprutil1
    php5-mysql
    libmysqlclient15off
    libdbi-perl
    libplrpc-perl
    mysql-server
    openssl-blacklist
    libdbd-mysql-perl
    mysql-server-5.0
    libnet-daemon-perl
    libapr1
    libpq5
    ssl-cert
    apache2-mpm-prefork
    mysql-common

I guess that would be it for this post. I’ll post more if I find anything else that I may be missing.

Sources for my info:-