Here I will post some Useful shell scripts, recommend programs and maybe post other nerdy stuff.
While browsing, you can listen to the Free Software Song, from the movie Revolution OS.

 

♥ your shell recommended programs other geek stuff
  • count words in a file
  • synchronize camera times
  • rescale pictures
  • rename pictures according to the time they were taken
  • download all pictures from a gallery
  • convert *.eps to *.fig for xfig usage
  • get rid of spaces in file names

Of course they are Open Source and can be found in the Debian Software Sources.

 

‚Cat WC‘


cat datei | wc -l    #counts words in datei

 

synchronize camera times

You forgot to synchronise your cameras? Fix it:


exiftool -P -alldates-='0:0:0 0:4:0' -overwrite_original bild.jpg 

#minus 4minutes
 
#syntax: 'y:w:d h:m:s'
#plus time: +=

 

rescale pictures

Easily resize your pictures (for web use):

  convert -resize 1920 original.jpg resized.jpg

# number defines pixels

#  -quality 95% is default value

 

rename pictures within a folder:

You have a digicam and it sorts the pictures from each day into one directory.
Now you want to number them and name them related to the day they were taken:

#!/bin/bash   #rename pictures from within a directory
#tag for the name
tag=’Sternfahrt_Berlin‘
#file: Check file typefor i in `ls *.JPG`;
do
#get date
datum=`exiftool -d %Y-%m-%d-%H:%M:%S -DateTimeOriginal -S -s
$i`mv $i $datum’_’$tag.jpg
#rescale pictures
convert -resize 1920 -quality 95% $datum’_’$tag.jpg $datum’_’$tag’_’1920.jpg
done
echo „Fertig“
#rename folder
datum2=`echo $datum | head -c10`
pfad=`pwd`cd ..
mv $pfad $datum2’_’$tag
echo „Fertig“

 

download all pictures from a gallery

Downloading all files of a certain type from a website (e.g. someone shares pictures by uploading them an sending you the site with all the single links):

wget -r -A.JPG www.example.of/bilder/

 

convert *.eps to *.fig for xfig usage

Convert *.eps files to *.fig to manipulate them using xfig

pstoedit -f fig input.eps > output.fig

get rid of spaces in file names

Usefull command to get rid of the annoying spaces windoofs user use:
for i in *\ *;do mv "$i" "${i// /_}";done