Brad's Blog

web dev, django, running, food, or whatever

Casual Games 2007-03-09

It seems like I keep running into this term, "casual games." Apparently this is a burgeoning industry with the advent of more advanced handheld devices (like cellphones). There were even two keynotes (Trip Hawkins ofDigital Chocolate, and Robert Tercek of PeopleJam and GDC Mobile) regarding causal games at the recent Game Developers Conference.Basically, any simple (hopefully addictive) game that's quick and easy to learn falls in the category of a casual game. Two of my favorite examples are ...

Mac mini disassembly 2007-03-05

I've been a mac user since my wife bought me a Min in 2005. During that time I've enjoyed being a Mac user, but until now I've not performed a lobotomy on my little mac. I finally decided to upgrad to 1Gb of Ram, and thanks to NewEgg, this was fairly inexpensive. Also, thanks to Russel Beattie and smashsworld.com, I found it fairly easy to get into the mini.Though I only upgraded the RAM, I ...

Javascript: What is the standard? 2007-02-27

I've recently been writing a little javascript, and I needed to chage the value of some text inside an html/xhtml element. It seems there are several ways to do this, but evey browser may or may not support the same method for doing it (big surprise, here) I'm not sure what is considered the "standard" way. Here's a little script that I use to help me decide which browsers support which methods for altering text within ...

magic SysRq 2007-02-09

Occasionally I goof up. Yes, as much as I hate to admit it, it's true. However, thanks to this handy tutorial on liquidweather.net, I've learned about some nifty ways to kill things in linux.In addition to the traditional ways to kill a process, this tutorial lists some magic SysRq key combinations that--if enabled in your kernel--can provide a nice option to just pulling the plug...Alt+SysRq+K - Kills all processes (SIGKILL / kill -9)Alt+SysRq ...

wifit - an iwconfig tool 2007-02-08

I've recently installed Mepis Linux on a couple of laptops (a Compaq Presario 2195US and a Dell Latitude D610, both of which use NdisWrapper for wifi drivers).I'm fairly mobile, so I needed a way to quickly change my wireless settings. I wrote this simple bash script to let me do that, and I thought I'd just share it.#!/bin/bash## wifit - the wifi tool## This is a script that accepts a wifi-enabled interface, ## essid, and an ...

Automatic Backups with cron, tar, and SSH 2007-01-10

Everyone knows that backups are important, but how many of us regularly back up our own websites, blogs, or whatever? Well, I've put together a relatively simple way for my Mac to log into my Linux-based webserver, archive some content, and download it for me. All of this is done Automatically, too!The first thing I had to do, was set up my home machine (a Mac, but any Unix-based system should work, too) so that it could log ...

Migrating PHP scripts to MySQL from PostgreSQL 2007-01-05

I've recently had to work on a project where I needed toconvert some very basic PHP code thataccessed a postgresqldatabase so that it would work with mysql. For the most part, this has beenfairly simple thanks to rpl. Many of PHP'sdatabase functions have very similar names, so I simply use rpl toconvert the existing code. Here's a simple bashscript that I put together to convert some of my postgresqlfunctions to mysql: #!/bin/bash if [ ! -n "$1" ] then ...

Blocking outgoing UDP traffic using iptables 2007-01-03

Since rebuilding my server (after having it used to propogate a UDP flood DoS attack), I’ve been advised that I should set up iptables to block any unnecessary outbound UDP traffic. So, how do I do this?Well, the first thing I’ll do is update my apt repository, and install iptables using the following two commands:apt-get updateapt-get install iptablesNow, the quick and dirty solution is to just add append a rule that blocks all outgoing UDP packets from my ...

Building a Debian-Based Webserver 2006-12-31

Well, my server was recently compromised and used to perform a UPD flood Denial of Service attack (or so my provider claimed), so I’ve had to rebuild my server from scratch. Now, this seems like a daunting task, but it has actually been quite easy. I started out with a minimal Debian Linux system, and after a few apt-get install commands, and a few hours of uploading backups, I’m up and running again.How’d I do it? Well, i just ...

My Wife's New Laptop 2006-12-23

Well, the semester has ended, so I've been working from home (trying to catch up on all of the "extra work", and, while out to the gym, My wife gives me a call and starts asking about laptop specs!? It turns out she's got her eye on a nice little bundle at Radio Shack!It seems they had an HP Pavilion dv2000 notebook (Turion 64 - 2Ghz/512Mb Ram/100Gb HD/nvidia Geforce go 6150) with a bundled 6 ...