This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
for pub in $(find ~/.ssh/ -name '*.pub'); do ssh-keygen -lf $pub; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
apt-get install console-setup | |
# If you want /etc/default/keyboard populated first then you might precede above with | |
# apt-get install keyboard-configuration console-setup-mini | |
XKBMODEL="pc105" | |
XKBLAYOUT="gb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
for i in 'cs' 'de-dev' 'es' 'es-extra' 'it' 'pl' 'pl-dev' 'pt' 'pt-dev' 'ru'; do echo 'manpages-'$i; done | xargs -r dpkg --purge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
ls -d /* | egrep -v '^(/backup|/bak|/lost\+found|/mnt|/proc|/selinux|/service|/sys|/tmp|/media|/srv|/run)' | /usr/bin/winter > ~/localhost.winter | |
ls -d /* | egrep -v '^(/backup|/bak|/lost\+found|/mnt|/proc|/selinux|/sys)' | xargs -r -i find {} -maxdepth 1 -type d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
DOM_=wrightsolutions.co.uk;named-checkzone ${DOM_} /var/lib/bind/db.${DOM_} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
tail -20000 access_log | cut -d' ' -f1 | sort | uniq -c | sort -g | tail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
rsync -v -t -ogp -r files /var/www/vhosts/def.com/www/sites/def | |
Less well: rsync -v -t -r files /var/www/vhosts/def.com/www/sites/def | |
find /var/www/vhosts/def.com/www/sites/def/files/ -type f -perm 644 -exec chmod 775 {} \; | |
# You probably meant to include the -ogp flags in your rsync | |
# 775 file permissions are not great, but it is is one step up from 777 nonsense. | |
rsync -v -t -og -r rose0non ~/hglocal/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
# (c) 2011 Gary Wright - now released into public domain. | |
dpkg-query -W --showformat='${Installed-Size;-10}\t${Section;-15}\t${Package;-30}\n' | sort -g | |
dpkg-query -W --showformat='${Installed-Size;-10}\t${Section}\t${Package}\n' | sort -g | |
dpkg-query --showformat='${Installed-Size;-10} ${Package}\n' -W | sort -g | |
dpkg-query --showformat='${Package}\n${Description}' -W macaulay* | |
#dpkg-query --showformat='${Installed-Size;-10} ${Package}\n' -W lib* | sort -g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
# (c) Gary Wright 2011 now released into public domain. | |
alias infolist="(cd /var/lib/dpkg/info/;find . -type f -name '*.list' -printf '%f\n' | awk -F'\\\.list' '{print \$1}' | awk -F':' '{print \$1}')" | |
# --field-separator argument in awk section (-F) includes 3 backslashes (\\\) before the period (.) which is deliberate. | |
# | |
# Note: The alias shown here are for easy copy and pasting. Do not expect this shell script to set alias for you. Think. | |
alias baksysconfig="cd /bak/this/sysconfig/; \ | |
/bin/echo '*shadow* *secret* etc/ssh/ssh*_key etc/.*secret* etc/*/*secret* ' | \ | |
/usr/bin/tr ' ' '\n' | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (c) 2011 Gary Wright | |
# Usage of the works is permitted provided that this instrument is retained with | |
# the works, so that any entity that uses the works is notified of this instrument. | |
# You may additionally create derivatives under this license, | |
# or BSD "new" / Apache 2.0 / Any Free Software Foundation (fsf.org) approved license. | |
### | |
# Awk script to pull out relevant ATI & RADEON entries from a /var/log/Xorg.0.log or similar | |
### | |
/ATI/ { count["ATI"]++ } | |
/) ATI/ { count[") ATI"]++ } |