John Chase’s Blog

The Personal Blog of John Chase

Creation Time of a MySQL Database

without comments

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.

Written by admin

January 5th, 2012 at 9:46 pm

Posted in Uncategorized

Useful GIT Commands

without comments

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" (The HEAD~1 means the commit before head.)

"git reset --hard <sha1-commit-id>

Written by admin

October 13th, 2011 at 7:34 pm

Posted in Uncategorized

Export MySQL to CSV

with one comment

“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.

Written by admin

May 19th, 2011 at 10:38 pm

Posted in linux/BSD

Kansas City = 1Gbps Fiber

without comments

Written by admin

April 24th, 2011 at 1:31 pm

Posted in Uncategorized

Firefox 4 Group Tabs

without comments

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.

firefox 4 group tab view

Written by admin

March 24th, 2011 at 4:45 pm

Posted in osx

Tagged with , ,

iPhone 3G on T-Mobile

without comments

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.

Written by admin

February 18th, 2011 at 1:40 pm

Posted in iPhone

Tagged with , ,

Disqus at DjangoCon US 2010

without comments

Scaling the World’s Largest Django Application

Written by admin

February 2nd, 2011 at 4:59 pm

Posted in django

Tagged with

OSX Terminal Cursor Movement

without comments

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

Written by admin

January 27th, 2011 at 6:11 pm

Posted in linux/BSD

Dilbert on Cloud Computing

without comments

Written by admin

January 7th, 2011 at 2:14 pm

Posted in Uncategorized

Tagged with

MBP 2.53 Ghz Running 8GB of Crucial RAM

without comments

So very nice. VMware has plenty now. Plus one for Crucial RAM!

Written by admin

January 5th, 2011 at 5:33 pm

Posted in Hardware