bind refuses to restart, debian squeeze

After an upgrade, I’ve noticed a few times that bind has refused to restart or reload, saying:

Stopping domain name service: namedrndc: connect failed: connection refused

This seems to be a permissions bug in debian, quite a long lasting one. In order to cheat-fix it quickly, I do the following:

chown bind:root /etc/bind/rndc.key
chmod 660
/etc/init.d/bind9 restart

That seems to fix it well enough. I think it’s a problem in that bind starts as one user, but runs as another. It may be that 440 are all the perms that are necessary. The debian bug report is here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=169577

Magento Session Files

Magento (the popular open-source online shop system) likes to store its PHP session files in ~/public_html/var/session/

Most debian servers don’t have that in their cron job that deletes old session files.

So, you probably want to set it to store it’s session files in the default location (/var/lib/php5) or alter your cron job (/etc/cron.d/php5)

Fun!

The wind is not your friend

Cycling home tonight, I had just left work’s place, onto a stretch  of road with no streetlights. Picture the scene, it’s just stopped bucketing it down with rain, now spitting. I’m in wet-weather gear, and it’s dark. Quite dark. My backpack has a reflective cover, and I’ve a reflectctive jacket, with a particually annoying LED flashing backlight. (I’m paranoid – shortly will have red LED flashing in my helmet.)

Got out safely, clipped my feet in fine (I now have special shoes that clip onto my pedals), accelerating towards my average 15-17mph on that particular bit of road, the wind decided to push me, hard, towards the edge of the road. A very small shallow there, with a grassy bank. Wheels in the culvert, uncontrollable de-acceleration, equals me flat across the A road, with one car passing me and another just behind it.

Promtly to the sound of car-horns telling me just how close I’d come to getting run over, I dragged myself off the road *sharpish*, and dragged my bike off as quick as I could after I was off. I’ve a couple of very minor abrasions on my ankles. Lucky. Very lucky.

Note to self. When it’s wet and windy, piss drivers off by sticking a meter off from the side. It’s far better than getting run over.

Invalid method in request \x16\x03\x01

So, ran into this one. Firefox is throwing this error, along with ‘SSL_ERROR_RX_RECORD_TOO_LONG’. Turns out, apache was serving plain HTTP on port 443, as it hadn’t been given a default SSL config.

Other causes may be: Corrupted SSL cert (rare). Mis-configured proxy. Not adding “SSLEngine On” after configuring an SSL cert. But mostly, you’re trying to talk HTTPS to an HTTP serving webserver.

`a2ensite default-ssl` (on debian) fixed it. Well, fixed in in that the default server now has a snake-oil self-signed cert, but, you know, fixed it. 🙂

Possible missing firmware on debian squeeze

If you get these errors:
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8105e-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169

or

W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8105e-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-3.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169

Do this as root (or using sudo):

#  apt-get install firmware-realtek

Win!

If you have other firmware issues, n1md4 suggested installing: firmware-linux and firmware-linux-nonfree in the comments (thanks!)

London wander 2011 photos #1

I’ve finally downloaded all the photos I took whilst wanding around london for half a day. The majority are rubbish, but a few are quite interesting.

Let’s start with a couple of street scenes. I’ll hopefully post some more sooner or later 🙂

Street scene, laptop, pub, walking

Just need to finish this...

Please don't ticket me! Man, I really hate wardens. I only stopped for a minute to get an ice cream!

Eaccelerator mirror / downloads

Eaccelerator is insanely useful in my line of work. However, their main downloads are down right now, so I’m mirroring the latest version here:

https://kirrus.co.uk/stuff/eaccelerator-0.9.6.1.tar.bz2
https://kirrus.co.uk/stuff/eaccelerator-0.9.6.1.zip

You can see the files sha1sums here: https://eaccelerator.net/wiki/Release-0.9.6.1

Alternatively, if you’re scripting (we are), you can use the following to get my (‘up-to-date’) version:
https://kirrus.co.uk/stuff/eaccelerator-latest.tar.bz2

bz2.. because that’s the version we use here 😉

 

USB Key reminder script

Here’s something for all you windows network admins out there.
(I apologize in advance to Johnathon’s linux followers)

Here’s a little script I wrote to be used as a group policy logoff script to remind users to remove their USB memory sticks/keys when logging off.

I wrote it while working in IT Support for a High School, to help out our IT teachers and ourselves as we were weekly gathering a collection of various USB Memory Sticks and memory keys (and since i was the one trying to reunite them with their owners each week.)

It’s written in VBS so it’s perfect for using as a group policy in active directory on say a Windows 2003 server/XP network. I haven’t tried it on Vista, Windows 7, or Server 2008 because I wasn’t using those technologies at the time, but it will most likely work with Vista and Windows 7 when deployed from a 2k3 or 2k8 server.

It detects removable drives (the type it looks for can be modified) that are connected and won’t pop-up without a drive detected.

If a USB drive is connected, it pops up a dialog reminding the user to take their memory stick with them and then auto-closes after a few seconds (as not to hang the logoff procedure).

I hope this is usefull to someone. If you use it, please leave me a comment.
[LICENCE GPL? NC-SA?]Also, feel free to modify and redistribute this script, but please don’t remove my details, as I’d like to know if it gets used and of any usefull additions others can think of.

[code]

‘ Script to display a list of drives connected to this machine
‘ http://authors.aspalliance.com/brettb/VBScriptDrivesCollection.asp
‘ MODIFIED to detect only removable drive. GTinsley 2008 @ Wallington County Grammar School.
‘  May cause false positives on some SATA ‘puters.
‘  Tested working on ‘puters with card readers.

Set FileSystemObject = CreateObject(“Scripting.FileSystemObject”) ‘Create a filesystem object
Set Drives = FileSystemObject.Drives ‘Create a drives collection

‘ Step through the drive collection, and get both the drive letter and the drive type.
‘ There are 6 distinct types of drive:
‘Select Case DriveType
‘   Case “0” DriveType = “Unknown type of drive”
‘   Case “1” DriveType = “Removable drive”
‘   Case “2” DriveType = “Fixed drive”
‘   Case “3” DriveType = “Network drive”
‘   Case “4” DriveType = “CD-ROM drive”
‘   Case “5” DriveType = “RAM Disk”
‘End Select

For Each DiskDrive in Drives

DriveLetter = DiskDrive.DriveLetter
DriveType = DiskDrive.DriveType

‘ Check for a removable drive connected that:
‘     Is not the drive letter A B or C
‘    Folder exists (proves the drive exists)
IF Drivetype = “1” and not driveletter = “C” and not driveletter = “A” and not driveletter = “B” and FileSystemObject.FolderExists(driveletter & “:\”) then

‘ Old method. Waits until user has clicked OK before logoff completes.
‘WScript.Echo “The removable disk drive ” & DriveLetter & ” is a still connected. Don’t forget your USB drive!”

‘ New method waits 5 seconds then logs off.

time_out = 5      ‘ wait max. 5 seconds
title = “Forgetting something?”
button = vbOKonly  ‘ vbOKOnly
message = “The Removable Disk (” & DriveLetter & “:\) is a still connected. Don’t forget your USB drive!”

Set objWSH = WScript.CreateObject(“Wscript.Shell”)     ‘ create object
objWSH.Popup message, time_out, title, buttons     ‘ popup
end if
Next

‘ Clear objects and collections
Set Drives = nothing
Set FileSystemObject = nothing

[/code]