bob's tech ramblings

where i ramble about technical things

Entries tagged "rgl".

7th April 2007

Things I have learnt this week.

  • Backups are good.
    • If for instance your colo box breaks.
  • Tested backups are better.
    • Best to test them before your box breaks.
  • Automated backups are better still.
    • Humans forget to do things. Machines rarely do. So your backup may not be as recent as yo u think.
  • How to backup svn
    • svnadmin dump $repo | bzip2 > svndump.bz2
  • Checking which disk you are replacing in a degraded mirrored pair is a good thing
    • Your filesystem dieing or going back in time is not fun. See previous points

Having learnt these things I have made my backup regime better and have made sure its croned and does backup the stuff I need. I s hould also start putting more stuff in my svn repo.

This clusterfuck did annoyingly lead to losing about a weeks worth of data on the Randomness Guide to London which was particularly galling since one of the reason for doing it was I trusted myself more with the data. bah


14th April 2007

So recently Kake and I have been adding Public Domain Geodata to our Guide to London using a Garmin Etrex she has been borrowing from a friend. However, it possibly has one of the one most annoying interfaces i've used for a while and we only have one.

So, I succumbed and bought the Nokia LD-3W which works with my phone. I can get location data with applications which came as standard and indeed save landmarks which I can then export as an xml file. I cant get any routes though. However, I did find an application from nokia research which almost gives me what i want. It can export trip data as kml. So for your viewing pleasure My trip to the butchers this morning. It jumps around quite a bit.

One problem is that I can only get Lat/Long out when we are using OSGB for the guide. Thankfully, the windows program the Ordnance Survey provide to convert between them can run under Wine. This will make mass conversions easier.


16th August 2009

On Thursday the Randomness Guide to London was probably the target of a ddos attack. The machine it was hosted on went to load of about 60. Which is fine since its solaris. The main problem was when the machine exhausted its memory and started to swap the machine would become unresponive.. To mitigate this I dropped the number of concurrent connections apache allowed. The machine suffered less but the website was still unusable because you were fighting to get one of the limited number of available connections.

Since I was in the pub the other administrator of the Randomness Guide to London was renaming the CGIs so that load would drop and she could get on to it. When I got back I whipped up some mod_rewrite rules such that we could see the site but everyone else got a holding page. 10 minutes after this the ddos stopped. So it was a bit late. However a holding page is still a useful thing to have.

The next morning I refined it a bit to be more intelligent and return a 503 which is the correct status code.

RewriteEngine On
RewriteCond %{REMOTE_ADDR} !AAA.BBB.CCC.DDD
RewriteCond %{DOCUMENT_ROOT}/holding.html -f
RewriteCond %{DOCUMENT_ROOT}/holding.enable -f
RewriteCond %{SCRIPT_FILENAME} !holding.html
RewriteRule ^.*$ /holding.html [R=503,L]
ErrorDocument 503 /holding.html

First turn on the rewrite engine. Then the conditions for which the RewriteRule applies
  • Don't match an IP address. So you can see the site.
  • Make sure holding.html exists
  • Check for the existence of a file called holding.enable. This is the means by which you turn holding page on and off.
  • Don't apply the rule when serving holding.html
Then the rule itself. Which basically redirects anything to the 503 error page. Which you then set as holding.html

That's all you really need although at work I add an extra line to help stupid web caches not keep on showing the error page after the site is back.

Header Set Cache-Control "max-age=0, no-store"