apt
a simpler interface to Debian's package system.
why should i remember which commands use apt-get
and which use apt-cache?
#!/bin/sh case "$@" in 0) echo 'usage: apt verb ...' 1>&2 exit 1 ;; esac case "$1" in update|upgrade|install|remove|source|build-dep|dist-upgrade|\ dselect-upgrade|clean|autoclean|check) exec apt-get "$@" ;; add|gencaches|showpkg|showsrc|stats|dump|dumpavail|unmet|\ search|show|depends|rdepends|pkgnames|dotty|xvcg|policy) exec apt-cache "$@" ;; *) echo verb $1 not known for apt-get or apt-cache exit 1 ;; esac |
autoessid
cycle through a list of wireless ids to find preferred one.
#!/bin/sh
PATH=/sbin:$PATH; export PATH
eth=${1:-eth0}
echo -n Guessing ESSID...
for i in MIT Harvard 'Stata Center' any
do
iwconfig $eth essid "$i"
sleep 2
if ! iwconfig $eth | egrep 'Access Point: (44:44:44:44:44:44|00:00:00:00:00:00)' >/dev/null
then
iwconfig $eth | grep ESSID | awk '{print $4}' |
sed 's/ESSID://; s/"//g'
exit 0
fi
echo -n not $i...
done
echo any
invoked in ifup via /etc/network/interfaces, as in: auto eth0 iface eth0 inet dhcp # wireless-* options are implemented by the wireless-tools package pre-up /home/rsc/bin/autoessid wireless-mode managed |
put your core files in /core/$user instead of littering the file system
mkdir /core mkdir /core/root mkdir /core/rsc ln -s 0 /core/root ln -s 1000 /core/rscand then run the command setcorename: #!/bin/sh case "`uname`" in Linux) echo /core/%u/%t.%p.%n >/proc/sys/kernel/core_pattern ;; *) echo 1>&2 do not know how to set core pattern on `uname` exit 1 esac finally, run the script at boot time by creating /etc/init.d/local:
#!/bin/sh
N=/etc/init.d/local
case "$1" in
start)
setcorename
;;
stop|reload|restart|force-reload)
;;
*)
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
and then ln -s ../init.d/local /etc/rc2.d/S99local
|