Author Archives: bolt

Using Flags and Arguments in Bash

Here’s a simple example script, showing how to deal with different inputs depending on the flag preceding them: #!/bin/bash USAGE=”Usage: Enter a noun after either -p (polite) or -i (insulting).” while getopts “:p:i:” OPTIONS; do case $OPTIONS in p ) polite=$OPTARG;; i ) insulting=$OPTARG;; h ) echo $USAGE;; \? ) echo $USAGE exit 1;; * […]

exim4 smarthost smtp password

Note to self: To use a smarthost you have to authenticate to with exim4, edit /etc/exim4/passwd.client # password file used when the local exim is authenticating to a remote # host as a client. # # see exim4_passwd_client(5) for more documentation # # Example: ### target.mail.server.example:login:password *:myusername:myawfullylongpassword Here I added a username and password for […]

Use OpenDNS with Smoothwall Express 3.x

If you’re using DHCP to get your public IP, Smoothwall doesn’t allow you to override the DNS addresses given by your ISP through the DHCP protocol. Time to override Smoothwall 🙂 Edit /etc/rc.d/rc.updatered, and add “DNSMASQ_DNS1=208.67.222.222” and “DNSMASQ_DNS2=208.67.220.220” at the bottom of the DHCP section, making the file look like this: #!/bin/sh . /var/smoothwall/ethernet/settings if […]

What’s touching that config file?!

Recently I started wondering what the heck was putting “root: bolt” at the end of /etc/aliases “every time” I did an upgrade of something. I asked #debian on irc.freenode.net, who told me to run this: grep /etc/aliases /var/lib/dpkg/info/*postinst What it does is basically to look though all files which names end in “postinst” in the […]

OTP (one-time passwords) on Debian Squeeze SSH logins

So, you’re out of your secret lair and now you need to log in from a computer you don’t trust. After all, every computer you don’t administer is most likely full of viruses, malware and probably even a hardware keylogger somewhere along the keyboard cord, right? So you want to use a one-time password, so […]

Putty keeps disconnecting

On a recent vacation, taking a train across the entire country, I was using my cell phone’s 3G connection to provide my Internet connection. Every little tunnel and other signal interference along the way would cut off the SSH connection I was sending all my traffic through. While googling, still on the train, I found […]

Switching alsa sound cards around

Short reference on switching around alsa sound cards, making another one the default. Needed to do this since my computer has 3 sound cards (M-Audio, SoundBlaster and the G35 headset) List alsa modules: cat /proc/asound/modules 0 snd_ice1724 1 snd_ctxfi 2 snd_usb_audio Edit /etc/modprobe.d/alsa-base.conf, adding the following lines (note the underscores from above are now dashes): […]

Error -6003 during Creative X-fi driver install

So the installer says something like: Setup has experienced an error. Please do the following: – Close any running programs – Empty your temporary folder – Check your Internet connection (Internet-based Setups) Then try to run the Setup again. Error code: -6003 What do you do to solve this? Why, erase any folder with a […]

Avoiding invalid commands in Bash history

To avoid having stuff like “ls” in my bash history, I added “ls” to the “HISTIGNORE” environment variable. However, on late nights, the result of this, and my left and right hand becoming out of sync with each other when I’m tired, is that the entry “sl”, which really doesn’t do anything, started showing up […]