Brad's Blog

web dev, django, running, food, or whatever

Published: 2008-09-23

hack your iphone earbuds...

Fun Hack Hardware iPhone

I've been complaining (inwardly) about my iPhone's earbuds since I first tried them on. Who knew it was so easy to just hack them!iPhone / iPod Touch Headphone / Earbud Replacement

Published: 2008-09-16

iTunes Genius Lies!

I begrudgingly turned on the Genius Sidebar in iTunes 8 and now it's showing me the "Top Songs You're Missing"... except, I'm not missing them! Surely Apple doesn't think I should purchase music that's already in my library! Maybe this is just a bug... or maybe iTunes is confuzed because my album is "Weezer (Blue Album)"... who knows.

Published: 2008-09-13

Pondering a Robotic Lawn Mower

Fun Hardware robots

Last weekend my gasoline powered lawn mower died. This prompted a search for a new mower, during which I stumbled upon some of Friendly Robotics' Robomow; a line of battery-powered robotic lawn mowers. Now, I have to admit that for the past 15 years or so, every time I've mowed a lawn, I've thought about the possibilities of a robotic lawn mower, and I'm not at all surprised that there's a company producing these. At first ...

Published: 2008-09-09

Recursively deleting files (based on regex)

While we're on the topic... (the topic being recursively doing stuff to files), I often want to delete all the files in a hierachy of directories that match a regular expression (or regex).The typical scenario for this is, "I want to delete all of my compiled python files."Here's how I do it:find ./ -type f -name "*.pyc" -exec rm {} \;find ./ -type f -name "*.pyc" should find all files ending in .pyc under the current directory. Once ...

Published: 2008-09-05

Recursively Renaming files

Linux Mac Programming

My hosting provider offers PHP4 and PHP5. Unfortunately, all files ending in .php get interpreted by PHP4, while all files ending in .php5 get interpreted by PHP5. So, how do I quickly change all of my files that end in .php to .php5?Do a google search for "recursively rename files", and you might run across this:, to accomplish my task, I use the following:find . -type f -print0 | xargs -0 rename ...

Published: 2008-09-05

Looking Forward to BarCampMemphis

#bcmem BarCampMemphis

BarCamp is coming to Memphis!A project of LauchMemphis, this is yet another event focused on growing the local tech industry. It follows the successful Memphis Startup Weekend (which resulted in Spynnr).The theme of BarCampMemphis is FLUX: Your Paradigm, and from the About BarCampMemphis page: In a constantly shifting environment, what do you do? Entreprenuers and businesses are constantly trying to walk the line between chaos and control, between the cutting edge and solid ground. Things are in FLUX ...

Published: 2008-09-04

Safari is Cooler than you Think!

Apps OS Safari X web

When you really start digging into Mac OS X, it's fairly mind-boggling how much extra stuff it has that your average user never sees. I recently encountered a problem on my MacBook Pro, where the Optical Audio was overriding my internal speakers, which prevented me from hearing any audio (without using headphones). Unfortunately, there's no easy-to-access preference pane to enable or disable various audio devices. This led me on a search for command-line utilities to manage system preferences ...

Published: 2008-08-13

Net Neutrality

networking web

Save the Internet | Rock the Vote

Published: 2008-08-12

How to update an input value with the value from a selected option using Prototype

Javascript Programming web

Today, I needed to set the value of an HTML input element based on the value of a option in a select element. This is fairly easy to do with Prototype's writeAttribute. Here's an example:A simple javascript function to do the work:function populate_input(){ var field = $('tf_select').getValue(); $('tf').writeAttribute('value', field);}A simple HTML snippet to see it in action:<div><p><select id="tf_select" name="tf_select" onchange="populate_input();"><option value="">- choose one -</option><option value="v1">value ...

Published: 2008-08-11

Extracting and Encoding Still images to/from Video files

Apps Video

ffmpeg is a cool tool.While it's got many many features and uses, I mostly use it to extract frames (or still images) from a video and create a video out of frames. While instructions on how to do this are posted on their list of FAQs, it's probably worth posting again.To extract all frames from a video file named "video.mpg": ffmpeg -i video.mpg frame%d.jpgThis will produce a series of JPEG image files ...