Tuesday, May 12, 2009

vux - the radio-ish random player

first of all install vux
# apt-get install vux
then become normal user
$ find ~/music_folder/ -type f > ~/.vux/playlist
check wheter the playlist is made or not using
$ less ~/.vux/playlist
Then run
$ vux -x generate
$ vux
and enjoy your songs based on exploration and exploitaion (words from Reinforcement learning). In case some ctl error is coming then
$ vuxctl clean

Reference : http://www.penguin-soft.com/penguin/man/1/vux.html

Tuesday, April 28, 2009

password protect your tar archive

Just today my not-so-close friend asked for my flash-drive. That drive contained some data that i didn't wanted to let him see. So i started searching for a method to password protect my archive of secret files. Following are the commands that worked like a charm for me:

to create password protected archive

tar cfz - my_folder/ | gpg -c -o my_folder.stgz

and to decrypt and decompress the password protected archive

gpg -d my_folder.stgz |tar xfz -

Reference : http://mydebian.blogdns.org/?p=461

Sunday, April 5, 2009

converting mp3 tags to lowercase

I have created a small code in python for converting mp3tags. namely artist, album and title to lowercase for uniformity. Anybody want to play with the code can email me.

my website

So i thought of using the website creation utility of goggle and here is the address of my website
http://sites.google.com/site/alindsharma/

All your criticism and suggestions for improving website are most welcome.

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 :)