Linux

Find and replace with perl

To replace the string jeltsch.blogspot.com by the string mnm.no-ip.com/blog you can use perl:perl -pi.bak -e 's|jeltsch.blogspot.com|mnm.no-ip.com\/blog|g' *.html If you want to do a recursive replacement on a directory tree you can try:perl -pi.bak -e 's|jeltsch.blogspot.com|mnm.no-ip.com\/blog|g' `find jeltsch.org -name '*.html'`

Shell script to downsample podcasts

I have a very basic mp3 player with only 128 MB memory. I mostly listen to podcasts which are automatically downloaded by Amarok into the folder ~/.kde/share/apps/amarok/podcasts/data. In order to fit many of them to the limited memory and to have them available from anywhere, I have been writing a script that automatically downsamples them as they arrive and puts them online to my web server. The script is executed hourly by the crontab. The relevant files look like this:

Creating and mounting iso images (CD image files) under linux (dd)

Creating and mounting iso images under linux is very easy.
Creating:
dd if=/dev/cdrom of=filename.isoMounting:
sudo mount -o loop -t iso9660 filename.iso /mnt/isoThe file endings iso, raw and cdr denote all iso files. Image files with the bin/cue ending, however, are not iso files. You can convert them into iso files with bchunk. bchunk needs the cue file to do this! Allthough some non-Linux burning applications (e.g. Toast Titanium for MacOS) can handle (burn and convert) the bin file without the cue file.

Pages