Posts

Zen of website maintenance

A certain website had a few vuneribilities including XSS and leaking passwords. The fixes were: The <script> tag was turned on for pending users. Configure off.  All other users get their tags filtered against a safe list The superuser always skips the filter and sees all tags.

Fun and games with Python vs C

I’m using Python to test the code generated by a C compiler. Many of the tests are along the lines of: a = 5 b = 10 result = run_c_code_for_add_in_emulator(a, b) assert result == a + b This works fine except when dividing integers with rounding.

Big Mac Calories

Why does a NZ Big Mac have 464 calories, a UK one 495, and a US one 540? It might be differences in weight but it’s hard to tell.

Seen on reddit

A man goes to his doctor and tells him, “I’ve had the song ‘What’s New Pussycat’ stuck in my head for weeks, and it’s driving me crazy.” The doctor says, “Well, I think you may have Tom Jones disease.

Moving to Dreamhost

Thought I’d move from Rimu Hosting to Dreamhost. The VPS we’re on is just too slow and anything that brings the load down is good. I can’t move the secure sites as Dreamhost doesn’t provide any type of SSL, even a self signed cert from the wrong address, without switching to a static IP and handing over $50 US a year.

Comparing integers

Notes for next time: You can check if the unsigned integer ‘a’ is greater than ‘b’ by adding the ones complement of ‘b’ to ‘a’ and testing carry. A twos complement subtraction doesn’t work as a > 0 is always false.

Test after move

All relocated and imported. Now does posting work?

Engines for metaphilter++

Django looks quite decent. Python (not PHP – good), built in basic admin, built in basic user accounts, and the template system is directly applicable to metaphilter. I’ll give it a try using sqlite 3.

Planet Planet Planet

Planet Planet Planet Mushrooms Mushrooms!

Automatic PC fan control

Use a Atmel ATTINY26 as a serial port based fan controller for a PC. Tracy’s machine is very noisy but has built in sensors for the CPU and case temperature. Use a PC app to do closed loop control on the temperature.