Linux

Convert videos to 3gp format

This bash script converts videos like AVI-files to the 3gp format used on newer cell phones like Nokia N95. To use it you should have the libamr_nb and libamr_nw flags available to ffmpeg.< /p> ffmpeg -formats |grep amrFFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.  configuration: –prefix=/usr –libdir=/usr/lib –shlibdir=/usr/lib –mandir=/usr/share/man –enable-static –enable-shared –cc=i686-pc-linux-gnu-gcc […]

Read More
Linux

Adjust images to a digital frame (480×234 pixels)

This bash script adjusts images to fit in a digital frame with a resolution of 480×234 pixels however by using the size 832×468 pictures are displayed sharper on some frames. Normally, narrower pictures will have black borders at both sides when displayed. but this script makes the border color the average of the picture. The […]

Read More
Scripting

Create a photo montage using imagemagick

This is a little bash script I put together to create a photo montage with 5 resized pitures in max 3 rows using imagemagick. The script is run from within the folder I have filled with the JPG images I want to create a montage from. #!/bin/bashfor image in `ls *.JPG`  do    convert -resize […]

Read More
Linux

Backup mysql databases into separate files

This bach script makes separate backup files of all the databases in mysql and saves the result in the mysql_backup folder. #!/bin/bash -v USERNAME=’yourusername’ PASSWORD=’yourpassword’ HOSTNAME=’yourhostname’ BackupFolder=’/backup’ for i in $(echo ‘SHOW DATABASES;’ | mysql –user $USERNAME -p$PASSWORD -h $HOSTNAME | grep -v ‘^Database$’ ); do mysqldump –user $USERNAME -p$PASSWORD -h $HOSTNAME –opt $i > […]

Read More