Linux

Rename files from upper- to lowercase or vice versa

#!/bin/bash # # Shell script to rename given file names to from uppercase to # lowercase OR lowercase to uppercase FILES=”$1″ ME=”$(basename $0)” # function to display message and exit with given exit code function die(){ echo -e “$1” exit $2 } # exit if no command line argument given [ “$FILES” == “” ] […]

Read More
Linux

macfind

I’ve made a simple bash script to find MAC adresses in DHCP config files. #!/bin/bash if [[ -z $1 || $1 == “–help” ]] then echo “usage: $0 xx:xx:xx:xx:xx:xx ” fi grep -i $1 /etc/dhcpdb/* -R Usage example macfind 00:18:8B:2C:DC:AA Result /etc/dhcpdb/53-nettet/subnet.conf:hardware ethernet 00:18:8b:2c:dc:aa; /etc/dhcpdb/macadresser/it-avd.conf: subclass “it-avd” 1:00:18:8b:2c:dc:aa; # Hans-Henry

Read More
Linux

Watermark images with imagemagick ++

Script som legger til watermark tekst: #!/bin/bash width=`identify -format %w DSC06861.JPG`; \ convert -background ‘#0008’ -fill white -gravity center -size ${width}x90 \ -pointsize 36 \ caption:”Copyright (c) 2007 Pario.no” \ +size DSC06861.JPG +swap -gravity north -composite Output_image_watermarked.jpg Vis hvilke bildeformater imagemagick støtter: convert identify -list format

Read More