9 Nov 2014

src2pkg - linux package maker

Almost every Linux distribution comes with a good package manager from where the user can install-update-remove desired applications. But inevitably there comes a time when the need to compile an application from the source arises. The usual route to compile an application goes something like this,

source -> uncompress -> ./configure -> make -> make install

The main disadvantage of this method is it becomes very hard to keep track of the installed packages and files. Uninstalling a package cleanly can sometimes becomes nightmarish. That's where src2pkg comes into play.

24 Aug 2014

Essential Windows Softwares

I earn my bread and butter by working as a computer technician and I have to on daily basis install Windows on my client's computers. Windows in it's default installation lacks many essential softwares for day-to-day computing tasks. I used to have a DVD containing all the essential softwares and recently that DVD got broken by an accident. Burning a new DVD became necessary and I went on the hunt for the set of softwares which are essential after a fresh Windows install. My criteria was simple. Choose the softwares which are open source and only include closed source softwares when there is no viable open source alternative available.

15 Jun 2014

live score of 2014 FIFA football world cup in linux terminal

The FIFA football World Cup 2014 is underway in Brazil. Most people will be glued to their television sets during the matches all over the world. But there are many people who won't be able to watch it on telly for various reasons. If you are one of them and you are tied to your computer but want to keep an eye on live score of the FIFA footbal World Cup 2014 matches then worry not.

3 Jun 2014

how to automount usb drives and memory cards in linux

A recent discussion on Debian forum has inspired me to write this post. If you use a minimal window manager like openbox, fluxbox, i3 etc. you will find that USB drives and Memory cards won't automount. It can be very hard for new Linux users to figure out how to mount the USB drive or Memory card they have just inserted. Thankfully this can be achieved easily via udev rules. Open your favorite text-editor as root ( sudo or su) and copy-paste the following,

#! /bin/sh

KERNEL!="sd[b-z]*", GOTO="exit"

ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="exit"

IMPORT{program}="/sbin/blkid -o udev -p %N"

ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"

ENV{ID_FS_LABEL}=="", ENV{dir_name}="flash_drive_%k"

ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_vfat}="auto,uid=1000,gid=1000,dmask=022,fmask=133"

ACTION=="add", ENV{ID_FS_TYPE}=="vfat", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} vfat %E{mount_options_vfat} 0 0' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="vfat", RUN+="/bin/mount -t vfat -o %E{mount_options_vfat} /dev/%k '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_ntfs}="auto,uid=1000,gid=1000,dmask=022,fmask=133"

ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} ntfs-3g %E{mount_options_ntfs} 0 0' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/mount -t ntfs-3g -o %E{mount_options_ntfs} /dev/%k '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_ext2}="auto,users,exec,noatime"

ACTION=="add", ENV{ID_FS_TYPE}=="ext2", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} ext2 %E{mount_options_ext2} 0 2' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="ext2", RUN+="/bin/mount -t ext2 -o %E{mount_options_ext2} /dev/%k '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_ext3}="auto,users,exec,noatime"

ACTION=="add", ENV{ID_FS_TYPE}=="ext3", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} ext3 %E{mount_options_ext3} 0 2' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="ext3", RUN+="/bin/mount -t ext3 -o %E{mount_options_ext3} /dev/%k '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_ext4}="auto,users,exec,noatime"

ACTION=="add", ENV{ID_FS_TYPE}=="ext4", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} ext4 %E{mount_options_ext4} 0 2' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="ext4", RUN+="/bin/mount -t ext4 -o %E{mount_options_ext4} /dev/%k '/media/%E{dir_name}'"

ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"

ACTION=="remove", ENV{ID_FS_TYPE}!="", RUN+="/bin/sed -i '/\/dev\/%k /d' /etc/fstab"

LABEL="exit"

And save this file in '/etc/udev/rules.d' directory with the name '10_usb_mount.rules'.

We'll need another rules file for Memory cards,


#! /bin/sh

KERNEL!="mmcblk[0-9]p[0-9]", GOTO="exit"

ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="exit"

IMPORT{program}="/sbin/blkid -o udev -p %N"

ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"

ENV{ID_FS_LABEL}=="", ENV{dir_name}="sd_card_%k"

ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_vfat}="auto,uid=1000,gid=1000,dmask=022,fmask=133"

ACTION=="add", ENV{ID_FS_TYPE}=="vfat", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} vfat %E{mount_options_vfat} 0 0' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="vfat", RUN+="/bin/mount -t vfat -o %E{mount_options_vfat} /dev/%k '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_ntfs}="auto,uid=1000,gid=1000,dmask=022,fmask=133"

ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} ntfs-3g %E{mount_options_ntfs} 0 0' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/mount -t ntfs-3g -o %E{mount_options_ntfs} /dev/%k '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_ext2}="auto,users,exec,noatime"

ACTION=="add", ENV{ID_FS_TYPE}=="ext2", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} ext2 %E{mount_options_ext2} 0 2' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="ext2", RUN+="/bin/mount -t ext2 -o %E{mount_options_ext2} /dev/%k '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_ext3}="auto,users,exec,noatime"

ACTION=="add", ENV{ID_FS_TYPE}=="ext3", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} ext3 %E{mount_options_ext3} 0 2' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="ext3", RUN+="/bin/mount -t ext3 -o %E{mount_options_ext3} /dev/%k '/media/%E{dir_name}'"

ACTION=="add", ENV{mount_options_ext4}="auto,users,exec,noatime"

ACTION=="add", ENV{ID_FS_TYPE}=="ext4", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} ext4 %E{mount_options_ext4} 0 2' /etc/fstab"

ACTION=="add", ENV{ID_FS_TYPE}=="ext4", RUN+="/bin/mount -t ext4 -o %E{mount_options_ext4} /dev/%k '/media/%E{dir_name}'"

ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"

ACTION=="remove", ENV{ID_FS_TYPE}!="", RUN+="/bin/sed -i '/\/dev\/%k /d' /etc/fstab"

LABEL="exit"

Save this file in '/etc/udev/rules.d' directory with the name '10_sdcard_mount.rules'.

Next open terminal and run the following command as root to reload the udev rules,

udevadm control --reload-rules

That's it! The next time you plug-in a USB drive or a Memory card it will get automounted and be ready for you to use. Cheers!!! 

10 Apr 2014

Three Free And Secure Windows XP Alternatives

Microsoft finally pulled the plug on Windows XP on 8 April, 2014. Computers running Windows XP won't get any further security updates-patches. This means that the computers running Windows XP have become more vulnerable to the security risks even if they are running latest anti virus-malware products because operating system level exploits are beyond the scope of these products.

4 Dec 2013

Enable Numlock on bootup in GDM, LightDM and LXDM

GDM :-

First you'll have to install package 'numlockx'. It is available in the repositories of almost every Linux distribution. After you have installed 'numlockx' package open the following file as root in your favorite text editor,


/etc/gdm/Init/Default


1 Dec 2013

A nice looking and useful bash PS1 prompt

It's been a while since I blogged anything. Getting lazier. Anyways the folks who use Linux and/or Mac are familiar with Bash. It's the default shell in most of the Linux distributions and Mac. And the folks who use these operating systems also know the power of working in the terminal. And the prompt you see whenever you open the terminal is controlled by PS1. Most of the time the default prompt is, let's face it, boring. Today I'm gonna give you a nice, colorful, two lined prompt that also displays the exit status of the last command. Exit status means whether the command failed or succeeded.