Showing posts with label "Linux". Show all posts
Showing posts with label "Linux". Show all posts

Saturday, December 6, 2008

Start X Painlessly

Perhaps I should start this post in V. S. Naipaul style with a dedication 'To Sajith for asking me why' ;). Watching over my shoulder while I was working on my laptop, he asking me why I used this particular command to start the X Window server.

$ openvt startx

As command line junkie I work on linux console most of the time, only starting graphical X server with startx command when needed. The problem with using startx command is that it locks up the terminal by printing numerous warnings and messages while the X server starts and thus making the terminal unusable. Also I limit the number of virtual terminal on my computer to just two instead of standard six on gnu/Linux operation system.

So, the openvt command provided by the console-tools package helps me spawn a new virtual terminal and that's where all the warning and messages are printed leaving me to continue working in peace. Another added advantage to this is that I can do startx from a Emacs shell instance too, this is neat!.

Sunday, November 9, 2008

Locate Configuration Example

Keep things found is not an easy skill to master. The disk drive turns into a deep and dark jungle after the first few weeks on road. Traditional *nix command 'locate' helps us find files quickly by matching against a previously generated database. There are quite a few locate implementations available such as the GNU Findutils, slocate and mlocate, they have quite a few new features and security enhancements.

Unlike its first cousin the 'find' command, locate queries are faster but the exact matches are dependent on the freshness of the database. Also redundancy issue creeps in if you are not watchful. For example, searching with 'locate Simple.pm' gives undesirable results spread across all mounted partitions on this computer. /mnt/old-drive/usr/share/perl/5.8.4/Filter/Simple.pm # old Linux distro /usr/share/perl/5.8.8/Filter/Simple.pm # Current OS (Ubuntu/Debian) /mnt/windows/Perl/lib/Filter/Simple.pm # Windoze XP

Now lets see if we can remedy this by disabling locate indexing of mounted partitions and mounted Windows XP partition as well. Add '/mnt' to the PRUNEPATHS variable and 'vfat' to the PRUNEFS variable to the /etc/updatedb.conf file.

PRUNE_BIND_MOUNTS="yes" PRUNEPATHS="/tmp /var/spool /mnt " PRUNEFS="NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf rpc_pipefs vfat"

Next time the 'updatedb' command is run to create the locate database it avoids indexing all the directory paths listed under PRUNEPATHS and file systems in PRUNEFS options.

Popular Posts