Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@andrewlkho
andrewlkho / gist:9943678
Last active August 29, 2015 13:58
An unsupported NIC: how to enable support for Intel EtherExpress 10/100 on Solaris

This was originally posted on 2007-01-05 to http://andrewho.co.uk/weblog/an-unsupported-nic

According to the HCL, my network card (an Intel EtherExpress 10/100) isn't natively supported by Solaris, and this can easily be confirmed with the handy Installation Check Tool. However, after a bit of research, I'm fairly certain that it does in fact work with the iprb driver. So, let's let Solaris know this.

Searching the ouput of prtconf -pv for 00020000 (the class-code for

@andrewlkho
andrewlkho / gist:9943844
Last active August 29, 2015 13:58
How to connect to jabber.org using centericq

This was originally posted on 2007-03-03 to http://andrewho.co.uk/weblog/centericq-and-ejabberd

I've been unable to connect to the jabber.org server using centericq, and after a bit of google-ing, I've found the reason why. It turns out that centericq sends a request for iq:agents, which is deprecated. ejabberd returns with 503 Service Unavailable, and centericq disconnects immediately. The fix for this is to simply stop centericq from sending this request. In src/hooks/jabberhook.cc comment out the following lines:

x = jutil_iqnew(JPACKET__GET, NS_AGENTS);

@andrewlkho
andrewlkho / gist:9943902
Last active August 29, 2015 13:58
Turn off magic_quotes_gpc by default in PHP

This was originally posted on 2007-03-03 to http://andrewho.co.uk/weblog/magic-quotes-gpc-and-array-map

Juxta over on the TextDrive forum pointed out a good use of PHP's array_map() function that I hadn't thought of which gets around the annoying fact that some hosts set magic_quotes_gpc to on. In short:

if (get_magic_quotes_gpc()) {
    $_GET = array_map('stripslashes', $_GET);

$_POST = array_map('stripslashes', $_POST);

@andrewlkho
andrewlkho / gist:9943964
Last active August 29, 2015 13:58
Installing cgit on a Joyent Shared Accelerator (Solaris)

This was originally posted on 2009-04-16 to http://andrewho.co.uk/weblog/installing-cgit-on-a-joyent-shared-accelerator-solaris

I recently found the time to setup a web frontend to git on my Shared Accelerator. Pretty much all of my data (including work) is under version control so this is useful for those occasions when I'm away from my own computer but want to fetch a file. I went with cgit rather than gitweb because the configuration looked cleaner and more powerful; it also (utterly unscientifically) felt a lot more responsive (it is meant to be, especially

@andrewlkho
andrewlkho / gist:10736577
Last active August 29, 2015 13:59
Debian/PowerBook G4: USB key for an encrypted LVM

This was originally posted on 2009-08-05 to http://andrewho.co.uk/weblog/debian-powerbook-g4-usb-key-for-an-encrypted-lvm

When setting Lenny up on my PowerBook, I wanted some way to encrypt important data on the hard drive. Crucially, this includes the contents of the main PostgreSQL database cluster. With this in mind, using an encrypted LVM seemed to be the obvious way to go and so I went ahead and did this during the initial installation (Debian makes it pretty easy to do). The one downside is that the 16 character alphanumeric password is a little cumbersome to type in every time, so I opted to have a key file stored on a USB key which could be plugged in at boot time to authenticate and unlock the LVM instead. Here's how I did

@andrewlkho
andrewlkho / gist:10736709
Last active August 29, 2015 13:59
Debian/PowerBook G4: Network configuration

This was originally posted on 2009-08-10 to http://andrewho.co.uk/weblog/debian-powerbook-g4-network-configuration

Debian's network configuration is pretty straightforward (make sure you have the package wireless-tools installed). The first thing to note is that on the PowerBook G4, you'll need to extract the Broadcom firmware. You can do this by installing the b43-fwcutter package (it's in the contrib repository) which automatically extracts the firmware in its post-installation "configuration".

I have three scenarios that I need to account for:

@andrewlkho
andrewlkho / gist:10736844
Last active August 29, 2015 13:59
Debian/PowerBook G4: Vodafone PAYG USB modem (K3565)

This was originally posted on 2009-08-11 to http://andrewho.co.uk/weblog/debian-powerbook-g4-vodafone-payg-usb-modem-k3565

I frequently find myself in need of mobile internet, and for this I use a Vodafone PAYG USB modem. It's the best plan in the UK, mostly due to the fact that the bandwidth doesn't run out. I pay £15 for 1 GB, but that 1 GB never expires and given that it'll take me about two years to get through that it's a pretty good deal (I mostly just SSH a terminal out).

The model I bought about a year ago is the Vodafone K3565, which I believe is a rebranded Huawei E160. This device can function in two different "modes": as a

@andrewlkho
andrewlkho / gist:10737832
Created April 15, 2014 14:38
OpenDNS and BT Openzone

This was originally posted on 2010-04-17 to http://andrewho.co.uk/weblog/opendns-and-bt-openzone

I frequently work in coffee shops, and if I happen to have forgotten to bring my Vodafone USB modem I use the free WiFi, which is run by BT Openzone. Now, I like to use OpenDNS, particularly when I'm not at home. It's significanly faster than both the BT Openzone servers and the Vodafone ones, so it really does make a difference whilst browsing.

The only problem is that in order to login to BT Openzone, you have to visit the domains www.btopenzone.com and my.btopenzone.com which, if you're connecting

@andrewlkho
andrewlkho / gist:10738177
Created April 15, 2014 14:43
Securing authentication in Debian with OPIE

This was originally posted on 2010-08-28 to http://andrewho.co.uk/weblog/securing-authentication-in-debain-with-opie

A lot of the software I use is run on a remote server, and as a consequence I often have a terminal connected to this server. Whilst most of time I log in through my own computer, it often comes up that I need to SSH in using an unknown computer (such as someone else's, or the university computing cluster). I needed to come up with a way that made it easy to get in whilst using my own (secure) computers, but provided an extra layer of security when using potentially insecure terminals. Enter OPIE.

### Keybase proof
I hereby claim:
* I am andrewlkho on github.
* I am andrewlkho (https://keybase.io/andrewlkho) on keybase.
* I have a public key whose fingerprint is DAEA BF95 8F39 728B 31F0 4E9A 21E5 508E AF72 A573
To claim this, I am signing this object: