Remember this: find recursion

I keep forgetting. To limit find’s recursion, use:

find . -maxdepth X

Where X is the recursion number. Maxdepth must be before any search selection stuff (type, name, mtime, perm etc).

Deleting lots of tiny files really really quickly

This is the second half of that magento issue. Mainly, after having got a directory with millions of files in it, you can do one of two things.

mv sessions sessions_full && mkdir sessions && chown www-data:www-data sessions
rm -rfv sessions_full

Or

find /loc/of/sessions -ctime +1 -type f -exec rm -v {} \;

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!

Protected: A state of mind, January 2012

This post is password protected. To view it please enter your password below:


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

Do this as root (or using sudo):

#Â  aptitude install firmware-realtek

Win!

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:

http://kirrus.co.uk/stuff/eaccelerator-0.9.6.1.tar.bz2
http://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:
http://kirrus.co.uk/stuff/eaccelerator-latest.tar.bz2

bz2.. because that’s the version we use here ;)

 

Next Page »


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser