Bash

Bash Script Hosts file Ad Blocker

Put in cron or run manually. #!/bin/bash # If this is our first run, save a copy of the system’s original hosts file and set to read-only for safety if [ ! -f /etc/hosts.bak ] then echo “Saving copy of system’s original hosts file…” sudo cp /etc/hosts /etc/hosts.bak sudo chmod 444 /etc/hosts.bak fi # Perform […]

Continue Reading

Driftnet – misc scripts

#!/bin/bash mpixW=250 mpixH=300 if [ "x`which identify`" != x ] ; then echo `which identify` found! echo Tossing images less than $mpixW pixels. while true ; do read img imgType=$( expr `identify -format ‘%e’ “$img”` ) if [ "$imgType" == "jpeg" ] ; then sizeW=$( expr `identify -format ‘%w’ “$img”` ) sizeH=$( expr `identify -format […]

Continue Reading 0

Powered by recycled bites and bytes.