Scripting

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

nslookup-scan of IP-range/subnet

#!/bin/bash # nslookup-scan of IP-range # It’s possible to add more networks separated with space NETS=”192.168.0″ IPRange=”1 254″ for NET in $NETS; do for n in $(seq $IPRange); do ADDR=${NET}.${n} echo “${ADDR},`nslookup ${ADDR} | awk -F “=” ‘{ print $2 }’|sed ‘s/^[ t]*//’ | sed ‘/^$/d’ | |sed ‘s/.$//’`” done done Result 192.168.0.1,cba.infra.no 192.168.0.2,bca.infra.no 192.168.0.3,abc.infra.no […]

Read More
Linux

Hints and Tips for general shell script programming

WARNING: this will fail if the user is playing with $0 For example using a symbolic or hard link with a unexpected name. # Simplest… # PROGNAME=`type $0 | awk ‘{print $3}’` # search for executable on path PROGNAME=`basename $PROGNAME` # base name of program # Advanced… # Script name, in what directory, and in […]

Read More
Scripting

Shell script to Finding Accounts with No Password

Shell script to Finding Accounts with No Password listuserwopassword.bash #!/bin/bash # Shell script to Finding Accounts with No Password # Useful to improve system security # Copyright (c) 2005 nixCraft project # This script is licensed under GNU GPL version 2.0 or above # For more info, please visit: # http://cyberciti.biz/shell_scripting/bmsinstall.php # TODO # – […]

Read More