Skip to content

Instantly share code, notes, and snippets.

@thedod
thedod / facebook-denial-song.srt
Created April 22, 2010 17:10
Various srt captions for http://j.mp/hitlerdenial (be creative. contrib something silly)
1
00:00:01,000 --> 00:00:02,500
[Child is visible]
2
00:00:03,000 --> 00:00:05,000
[Child disappears]
3
00:00:08,000 --> 00:00:10,000
@thedod
thedod / README.textile
Created August 19, 2010 12:27
Hit parade. Go over access_log to see what IPs are DoSing your site

Hit Parade – find out who’s DoSing your site

This script goes over web server log files and sorts IP numbers by number of hits.1

Once you know which IP numbers are causing trouble, you can ask your system administrator to block them. In some cases you might even have a way to block specific IP numbers from a web-based control panel.

Another (less efficient, but sometimes practical) way is to block those IP numbers in your .htaccess file like this:

order allow,deny
deny from 123.45.6.7
deny from …

@thedod
thedod / README.textile
Created September 14, 2010 10:06
Crude BlueTooth cellular-theft alarm script
@thedod
thedod / simplest_simon.pde
Created November 2, 2010 21:35
Simplest Simon - my first Arduino sketch :)
/* Simplest Simon - a game for a bare naked Arduino
Recently I've got my first Arduino ever, and I'm still waiting for my order of
breadboard, jumpers, resistors, etc. (where I live, such things aren't common).
This led (pun intended) to the question "What shall we do with a bare Arduino",
and the unavoidable answer: "Something with the pin 13 on-board LED".
So there you have it. A Simon-like game where the Arduino flashes 8 bits on the LED
(steady meand 1, blinking means 0), and then you have to send a sequence of 0/1s
@thedod
thedod / README.textile
Created November 8, 2010 15:43
Fairly Simple Simon - an Arduino memory game for 4 LEDs and 4 switches

Fairly Simple Simon – an Arduino memory game for 4 LEDs and 4 switches

The FSS is a simple board with 4 leds and 4 normally-closed switches
(each led goes via a 150Ohm resistor, and each switch has a 10KOhm
pull-resistor connecting between the output and ground).

See breadoard (made with fritzing):
Fairly Simple Simon on an imaginary http://fritzing.org bread... on Twitpic

In real life it ain’t that pretty :)

@thedod
thedod / lcd_truck_lane.pde
Created November 25, 2010 11:54
Simple Arduino car game for a 16x2 LCD display (Hitachi HD44780 or clone)
/* Simple Car game for a 16x2 LCD display
You can use any Hitachi HD44780 compatible LCD.
Wiring explained at http://www.arduino.cc/en/Tutorial/LiquidCrystal
(I used theLCD Electronic Brick on bus 1:
rs on pin 2, rw on pin 3, enable on pin 4,
data on pins 5,6,7,8)
There's also a "steering wheel" potentiometer on analog input 1,
and a Piezo speaker on pin 9 (PWM).
Enjoy,
@thedod
thedod / README.markdown
Created November 29, 2010 20:51
Ariadne - a 1st person maze on a 16x2 LCD display
@thedod
thedod / marble-disorder-v2-tilt-switch-rotation.jpg
Created December 4, 2010 21:16
Marble disorder - Arduino Marble maze simulator for LCD and 2 tilt-switches
marble-disorder-v2-tilt-switch-rotation.jpg
@thedod
thedod / README
Created March 6, 2011 13:51
Webpy CSRF protection (request for comments)
A simple trick against CSRF for web.py (webpy.org)
* At the GET() template, you add a hidden field called csrf_token with value "$csrf_token()"
* The POST() should have the @csrf_protected decorator
That's it.
Request for comments:
* Is this secure? Can you see any holes?
* Is there anything in [or for] web.py that does this? Am I reinvevting the wheel here?
@thedod
thedod / efclock.py
Created April 29, 2011 22:19
Eyes-free clock in Python-for-Android
# Eyes-free clock script in Python for Android
# ( http://code.google.com/p/python-for-android/ ) by @TheRealDod.
# Shake phone to hear time. Handy when playing a full screen game ;)
SHAKE_THRESHOLD = 12
CLOCK_VOL = 13
import android,time
droid = android.Android()