|  About Me  |  Blogs  |  Photos  |  Publications  |  Resume  | 

Archive for July, 2004

Changing repository host for svn

Wednesday, July 14th, 2004

The domain name of my svn host changed so I have to update all the svn entry files in my working copy to point to the new host. SVN has a switch command to do this:

$ svn switch svn+ssh://anniec.hopto.org/repos/trunk/vendors .
# use –relocate to change the location of repository
$ svn switch –relocate file:///tmp/repos file:///tmp/newlocation .
$ svn [...]

find and replace with sed

Wednesday, July 14th, 2004

I always forget how this goes… a simple string replacement in file looks something like:

$ sed -i -e ’s/match_with/replace_with/g’ filename

where -i is for edit in-place and /g is for global replacement so all occurances of the match will be replaced.

xargs is your friend

Wednesday, July 14th, 2004

xargs splits standard input with space into arguments and runs the command on each of these argument. For example the following command allows output of find to be used as input files to grep:

$ find . -path *dir* -type f | xargs grep -l “search_string”

find . -path *expr* -type f prints out files paths matching [...]

unrar nonfree

Wednesday, July 14th, 2004

I’ve been having problems extracting rar archives with the default unrar - it fails on extracting most of the time. I installed the unrar-nonfree distribution and it works fine now.

Thunderbird profile lost

Wednesday, July 14th, 2004

Thunderbird lost my profile after an update yesterday. Need to run

$ mozilla-thunderbird -profilemanager

and select ‘create new profile’ and pointed it to the folder containing the old profile e.g. ~/.mozilla-thunderbird/default/xxxxx.slt

igal - online gallery generator

Tuesday, July 13th, 2004

Today Marcel introduced me to igal, which is a cool perl script for generating static html gallery quickly. Sample usage:

$ igal -c -k -p 4 –title “Party” –xy 140 –bigy 400 –wx 800 –www

Some useful options:

–title [s] specify title of html page
–xy [n] max width/height to scale thumbnails
–bigy [n] scales image slides [...]