Creation Time of a MySQL Database
INFORMATION_SCHEMA is your friend. Even though it’s not a base table and a view (no actual data files exist for views) it contains useful information about your mysql database; including create_time. See full documentation here.
Useful GIT Commands
To show deleted files:
“git ls-files -d”
To restore the deleted files use:
“git ls-files -d | xargs git checkout”
View your log:
“git log”
Reset to a previous head
"git reset --hard HEAD~1" (TheHEAD~1means the commit before head.)"git reset --hard <sha1-commit-id>
Export MySQL to CSV
“OPTIONALLY ENCLOSED BY” only wraps fields that “need” them, you can also add ESCAPED BY ‘\\’ and change LINES TERMINATED BY ‘\r\n’ if you run into issues with Excel. The below works fine with OpenOffice.
SELECT * INTO OUTFILE '/tmp/out.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
This is a handy command line version:
mysql -uuser -p db -B -e “select * from \`table\`;” | sed ’s/\t/”,”/g;s/^/”/;s/$/”/;s/\n//g’ > out.csv
s/\t/”,”/g;s/^/”/ <— this will search and replace all occurences of ‘tabs’ and replace them with a “,”.
;s/$/”/; <— This will place a ” at the start of the line.
s/\n//g <—- This will place a ” at the end of the line.
Kansas City = 1Gbps Fiber
Firefox 4 Group Tabs
Group tabs in Firefox 4 is revolutionary - visual organization of your tabs. I had to dig a bit, but the shortcut for accessing the group-tab window is ctrl+shift+e or apple+shift+e on mac. Very nice.
iPhone 3G on T-Mobile
I switched my iPhone 3G over to T-Mobile yesterday and it was a little confusing. Here’s a quick wite up that might be helpful if you’re doing the same thing. I now have unlimited talk, text and data on the iPhone 3G. In major cities I have near 4G data speeds, ~8meg download or 800kbps. Since I’m moving to Seattle, which is about 15 minutes from T-Mobile USA headquarters - I should be in good shape.
Unlocking is the process of what needs to be done to enable other SIM cards to work in the original AT&T iPhone, Jaiilbreaking needs to happen first, because jailbreaking is what allows you to install whatever software you like - including the software the unlocks the phone.
Usually, it’s not a big deal to unlock your iPhone, but Apple has switched baseband’s with the iPhone4 and iPad so you really have to commit to this unlocking and update your baseband, which is irreversible.
Before you try updating it’s best to check what version of IOS you have and what your baseband is. You can do this in Settings –> General –> About; look for Version and Modem Firmware (baseband). After my jailbreak and unlock was finished I have 4.2.1 and 06.15.00 - the latest IOS version and the updated baseband.
To start the jailbreak/unlock process you need to download the latest version of redsn0w, I used version 0.9.7b6
You also need a copy of the latest ipsw (iPhone Software) for your phone, you can use 4.2.1.
After you download these two files, remove your SIM card from the top of your phone with a paperclip, dock your iphone and launch redsn0w. It will prompt you for the ipsw, select the ipsw that you downloaded and it will validate the ipsw.
You’l then see the menu below. I checked a custom boot logo and added my company logo, not necessary, but cool.
You’ll then need to push the right button sequence to go into DFU (Device Fireware Upgrade) mode.
Relax, wait for your phone to update and start Cydia, a new app that was installed during the process.
You now need to install ultrasn0w, the software that unlocks your phone. In Cydia click Manage, then sources, in the left hand corner add the source: http://repo666.ultrasn0w.com.
Once it’s added, click on your new source and select ultrasn0w, insert your T-Mobile SIM card and follow the instructions to install.
Once it’s done, restart your phone. You’re finished; everything should work on your new T-Mobile iPhone 3G.
Disqus at DjangoCon US 2010
Scaling the World’s Largest Django Application
OSX Terminal Cursor Movement
To configure it to Alt + left and right: - Open Terminal preferences (command + ,); - At Keyboard tab, select “control cursor left (or right)” and doubleckick it; - Left: Select the combo “modifier” to “option” and the action to \033b - Right: Select the combo “modifier” to “option” and the action to \033f
Dilbert on Cloud Computing
MBP 2.53 Ghz Running 8GB of Crucial RAM
So very nice. VMware has plenty now. Plus one for Crucial RAM!

