msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

24 Oct 2008 Rename file name suffix to uppercase or lowercase

This is a little oneliner to rename a files suffix from/to uppercase/lowercase.

Rename a jpg suffix to JPG in the current folder

# find -name "*.jpg" | while read a; do mv "$a" "${a%%.jpg}.JPG" ; done

The work JPG can be replaced by any other word :)

Tags: , , ,

Posted by

15 Oct 2008 Howto copy a DVD-9 (dual-layer) movie in linux (fast)

More and more people are getting dual-layer DVD-burners and don’t want to compromise quality by shrinking the movie down to DVD-5 (singel-layer) copies. This howto will show you how to make a 1:1 (unshrinked and unencrypted) ISO-image of an encrypted DVD-9 movie in linux using the commandline.

Prerequisites (these are likeley available in your distros repositories/packet-manager..)

    vobcopyCopy the structures and files of a DVD to hardisk Homepage
    mkisofsCreate ISO9660/Joliet/HFS ISO images from filesystem Homepage

Note: vobcopy is dependant on libdvdread and libdvdcss for copying encrypted disks to HD.

Copy DVD to HD
Mount your dvd to your filesystem and run vobcopy.

Note: This example assumes that your DVD-reader is accessible through /dev/dvd and that you mount it to /mnt/dvd. The actual device name for your system may differ!

# mount /dev/dvd /mnt/dvd
# vobcopy -v -m -i /mnt/dvd

Make sure you start vobcopy from a place in the filesystem where you have enough free space.

Make an ISO-image of the extracted files

# cd MOVIE_FOLDER
# mkisofs -v -dvd-video -o ../MOVIE_NAME.iso .

You should now have a MOVIE_NAME.iso image that is ready to burn with your favourite burning tool – offcourse you will need a dual-layer burner and a DVD+R DL disc to go :)

Tip: If you need DVD-9 to DVD-5 copies (like DVDshrink does), I recommend k9copy Homepage

Tags: , ,

Posted by

13 Oct 2008 Rename files in a folder to lower-case using perl

This is a simple oneliner to rename files to lower-case using perl

# perl -e 'rename($_, lc) || warn "$_: $!\n" for @ARGV' *

You can also do this recusively using find and perl

# find . -type f -exec perl -e 'rename($_, lc) || warn "$_: $!\n" for @ARGV' {} \;

Tags: , ,

Posted by

09 Oct 2008 Downloading Linux ISO images from Scandinavia

Here are some useful addresses I use to download ISO images quickly. They contain different Linux distributions like Redhat, Debian, Ubuntu etc…

ftp://ftp.uio.no/linux/ISO-images/
ftp://ftp.sunet.se/pub/os/Linux/distributions/

Enjoy!

Tags:

Posted by

08 Oct 2008 mysql on a nondefault socket

It is sometimes necessary to run two instances of mysql, like in my case. I need a mysql database in addition to the one Zimbra uses. One solution to this problem is to run the mysql database on a non default socket. This can be done by changing the following line in my.cnf

my.cnf

[client]
...
socket = /var/run/mysqld/mysqld2.sock

Restart the mysql daemon afterwards to activate the change.

In PHP it’s possible to avoid programming the nondefault socket info whenever we use mysql
php.ini

[MySQL]
...
mysql.default_socket = /var/run/mysqld/mysqld2.sock

If you don’t have access to php.ini you have to program this in your PHP code

$dbcnx = @mysql_connect('localhost:/var/run/mysqld/mysqld2.sock',$username, $password);

Tags: , ,

Posted by