Nobody was Born with Linux Knowledge

To content | To menu | To search

Sunday 20 March 2011

add timestamp to a picture with free open source software

I was looking for a free open source solution in order to automatically add timestamps to bunch of pictures and eventually found Max's post and useful script over here: http://dptnt.com/2009/08/add-date-time-stamp-to-jpeg-photos-using-free-software-mac-linux-nix-edition/ Thank you Max very much for providing such a powerful, yet simple tool! And of course thanks to linux who enables us to easily write very useful scripts to perform automated tasks and thanks to ImageMagic for being such a powerful image processing toolkit! 

Add Date Time Stamp to JPEG Photos Using Free Open Source Software To get it started, follow the simple steps. 1. Install ImageMagick
sudo apt-get install ImageMagick
2. Get the font http://www.dafont.com/digital-7.font To make it look like the old 35mm point-and-shoot film camera’s time stamp, you can use a LCD font. Simply downloaded it and unpacked it somewhere. You don’t have to install the fonts. The script can work by a direct link to the font file location. 3. Get the code The following is the complete shell script.
#!/bin/sh
# Change the font variable to point to your font location
font="$HOME/.fonts/digital-7 (mono).ttf"
if [ $# -eq 0 ]
then
cat << _EOF_
USAGE: $0 file1 file2 ..., or
$0 *.jpg, or
$0 dir/*.jpg
...
_EOF_
exit
fi
while [ "$1" != "" ]; do
# Skip directories
if [ -d "$1" ]; then
shift
continue
fi
# Skip already converted files (may get overwritten)
if [[ $1 == *_DT* ]]
then
echo "------  Skipping: $1"
shift
continue
fi
# Work out a new file name by adding "_DT" before file extension
file=$1
echo "######  Working on file: $file"
filename=${file%.*}
extension=${file##*.}
output=${filename}_DT.${extension}
# Get the file dimension
dim=$(identify -format "%w %h" "$file")
width=${dim%% *}
height=${dim#* }
# Decide the font size automatically
if [ $width -ge $height ]
then
pointsize=$(($width/30))
else
pointsize=$(($height/30))
fi
echo "        Width: $width, Height: $height. Using pointsize: $pointsize"
# The real deal here
convert "$file" -gravity SouthEast -font "$font" -pointsize $pointsize -fill white -annotate +$pointsize+$pointsize "%[exif:DateTimeOriginal]" "$output"
shift
done
exit 0
  4. Do the work Copy the code into a text editor, save it as “dtstamp.sh” or anything you like. Please note you need to change the 3rd line in the code to point to the font file location. Run the following command to make it executable chmod +x dtstamp.sh To use it, simply run it like this ./dtstamp.sh directory/*.jpg Or, ./dtstamp.sh file1.jpg file2.jpg... After it runs, the script will produce files with “_DT” inserted between the original file name and file extension. The original file is unmodified.

Saturday 5 January 2008

remove audio clips with Audacity (hard limiter)

http://audacityteam.org/wiki/index.php?title=Click_Removal In order to be able to remove clicks from recordings using audacity you can use various tools among which the hard-limiter plugin which is available in the swh-plugins package in the Ubuntu repositories. Install it:
apt-get install swh-plugins
Then you'll then find it in Effects menu under Plugins 46-60 submenu

Monday 24 December 2007

enable flight simulator in Linux Google Earth

Google Flight Simulator


You maybe didn't know Google provides a flight simulator within its Google Earth program, what you certainly didn't know was that also linux version of this program does have the flight simulator!
While it is really easy to enable such feature in Windows and Mac (just type CTRL+ALT+A) in linux this shortcut does not work since X on most of systems has mapped it otherwise.
The solution is really easy, all you have to do is going into this directory
$HOME/.googleearth/Registry/google/googleearthplus/User/flightsim
and create an empty file called isenabled, then edit it typing in value 1.
After you have done so you'll be able to access this feature via Tools menu.
Reference for shortcuts used into this game is available here:
http://earth.google.com/intl/en/userguide/v4/flightsim/index.html

Saturday 15 December 2007

Setting up Elisa as Default Multimedia Center

elisa media center
first of all install elisa via package manager
sudo apt-get install elisa
then configure elisa to run at fullscreen by editing file $HOME/.elisa/elisa.conf and changing line
# whether or not Elisa should start fullscreen
start_fullscreen = '1'

go into System > Preferences > Preferred applications and on Multimedia Tab select custom and enter text
elisa into the white box
then setup the key bindings through applet System > Preferences > Keyboard Shortcuts and click on Media Player then click the button combination you prefer. If you own an HP laptop with QuckPlay key or whatsoever laptop with a media key just push it.
You will find that the QuickPlay key both on the keyboard and on the remote control will switch on elisa from now on, letting you show off your linux mediacenter!
You can grab the latest version by adding Fluendo Elisa repository to your /etc/apt/sources.list
deb http://elisa.fluendo.com/packages hardy main
then add the authentication key
wget http://elisa.fluendo.com/packages/philn.asc -O - | sudo apt-key add -

- page 1 of 2