Thursday, March 5, 2009

renaming all files in a directory to change spaces to underscores

$find . -depth|rename 's/\ /_/g'

thts why linux is linux

And just off the track: you can calculate time taken by any command using time command. This will tell time taken to rename all the files in the current folder.

$time find . -depth|rename 's/\ /_/g'

comaring md5sum for a directory

Suppose you have a BOOKS directory and you want to backup it and check using md5sum for the integrity of the backup. So first you have to make md5sum of your original BOOKS directory as follows:

$find BOOKS/ -type f -print0 | xargs -0 md5sum > checksum.md5

then you copy checksum.md5 to the directory in which backup BOOKS directory exists. Now run this command to check the integrity

$md5sum -c checksum.md5

or if the files are too many then

$md5sum -c checksum.md5 |grep FAILED

put the errors in a file and use find and replace of any editor to remove ": FAILED" and then againn copy for good files. Repeat the process until everything is alright.

$md5sum -c checksums_backup.md5 |grep FAILED|grep /tmp/x.txt
$for i in `cat /tmp/x.txt`; do echo "$i" ;cp oldDir/$i backupRootDir/$i -v; don
e

And to check that whether a new file is added or som old one is deleted you can always run the diff and comm command.

reference http://info.michael-simons.eu/2008/10/25/recursively-md5sum-all-files-in-a-directory-tree/

Thursday, February 5, 2009

software that I use

c++ -> development of math oriented projects
conky -> lightweight process viewer
fslint -> gui for deleting duplicate and empty dir
fvwm -> lightweight window manager
gdeskcal -> calender for desktop
gmusicbrowser -> music player with functionality rename/delete/move
iceweasel/firefox -> internet browser
kate -> editor with a konsole
leafpad -> lightweight text pad
mercurial - distributed version control system
octave -> scripting lile matlab
pico -> general console based editing
pidgin/gaim -> messenger client
python -> great programming language
workrave -> taking breaks
vux -> random music player
This post will be edited continuously :)

mercurial and git

I am experimenting mercurial and git for distributed version control system. Both are nice. From my point of views the main pros and cons are as follows
mercurial :
pros: single binary
cons: bit slower that git
git :
pros : fast
cons: placed some 130 binaries in my bin

I will keep updating it with increase in my experience with them.
one thing that distributed version control lacks is the ability to restrict someone to work on a particular module. lets see if i can find out some way or is this really a restriction. Surely not for the open source world.

Wednesday, January 7, 2009

transparent conky background in fvwm-crystal+rox-filer


As you can see from the screenshot that I have finally managed to get a transparent conky background. Here is the script in my ~/bin directory
=====filename:conky_background.sh========
x=`sed 's/.*">\(.*\)<.*/\1/' /home/alind/.config/rox.sourceforge.net/ROX-Filer/pb_Default |grep '[.jpg|.png|.bmp]$'`
echo $x
sleep 20
feh --bg-scale $x
=============
And add the following line to .fvwm-crsytal start up file

+ I Test (x /home/alind/bin/conky_background.sh) Exec pidof /home/alind/bin/conky_background.sh || exec /home/alind/bin/conky_background.sh


Only problem is that if u change background during a current session then u have to run once conky_background.sh from command line. Else it will automatically load the new wallpaper during next startup of fvwm. I will try to automate this also. The reasons for non-transparent background of conky was some fighting b/w conky, rox-filer to draw on root-window. This makes them both draw the same pic and what u get is the illusion of transparency.
cheers!

Tuesday, January 6, 2009

enable sudo with root password

# apt-get install sudo (for debian users)
# visudo -f /etc/sudoers (open the file for modifiation)
add the following to the file
Defaults env_reset, rootpw
yourusername ALL=(ALL) ALL

Now you have a working sudo which will ask for root password instead of user password at the time of running sudo.Gives a feel-good feeling of entering super user password before running super user commands.

Tuesday, December 2, 2008

flashplayer for 64 bit

Now there is no need of ndiswrapper for installing flashplayer.
(semi) finally it is out for 64 bit linux
Can download it from http://labs.adobe.com/downloads/flashplayer10.html
In debian you have to make a directory named plugins in iceweasel dir
#mkdir /usr/lib/iceweasel/plugins
untar the .so plugin u got from the website and put it in plugins dir
voila there is no need of restarting the browser and njoy all sites including youtube.