MACBOOK AIR BATTERY DRAIN WHILE SLEEPING

I bought a MacBook Air in June this year, refurbished. I didn’t really use it a lot for day to day work, and when I didn’t use it I was charging it. It was very convenient - it weighs practically nothing and has almost no impact on me while traveling. When I cut back on using it, I noticed a few things. When I’d leave it unplugged for a few days, the battery would be dead. After...

STORED PROCEDURE FOR FINDING COLUMNS IN MYSQL

Looking for instances particular column in a large schema can be a pain. Fortunately the information schema makes this pretty easy, if your columns have a consistent naming convention. SELECT table_schema, table_name, column_name FROM information_schema.columns WHERE column_name LIKE '%some_name%'; Now, if we want to wrap this up into an easy to use stored procedure, we can do something like...

IP ADDRESS GEOLOCATION SQL DATABASE

I’m sick of looking through chat logs to find an IP geo lookup database. Now it’s here, possibly forever, or until I stop paying for hosting.

SETTING UP A REMOTE GIT REPOSITORY

Here’s a great guide for setting up a new remote git repo. Thank you, Tool Man Tim.

PYDEV TUTORIAL

I found a good tutorial on IBM on doing Python development with Eclipse. It might be a little out of date, but I think only the screens got moved around a little bit. It includes details on how to use ant, which I’ve recently started using with cruise control and PHP, so I’m becoming a fan. I did run into an issue where I’d get the error ‘Variable references empty...

'AWESOME PROJECT: SPARKUP'

Sparkup is a TextMate and Vim plugin for expanding short CSS style tags into HTML, written by my man Rico Sta Cruz. From the github page: You can write HTML in a CSS-like syntax, and have Sparkup handle the expansion to full HTML code. It is meant to help you write long HTML blocks in your text editor by letting you type less characters than needed. Sparkup is written in Python, and requires...

USING KICKSTART TO AUTOMATE CENTOS VM CREATION

I’ve done this using CentOS, but I’m pretty sure the same thing will work with RedHat the exact same way. Virtualization is now a commodity with several free tools available from Sun, VMWare and Xen. If you’re like me, you like to create a new, clean VM for each experiment. However, this comes with a drawback - the installation process, choosing your timezone, putting in the same...

VIRTUALBOX - SSH'ING INTO A VM FROM AN OUTSIDE MACHINE

Note: The terminology used below also applies to VMWare. The screens are different, but the issue and the solution are the same. When creating a new VM through VirtualBox, you might have a problem SSH’ing into the box. You also might notice you get a 10.0.x.xx type address, even though the rest of your network is a 192.168.xx.xxx deal. Yes, the two are related. Essentially what’s...

PYTABLES USER'S GUIDE

I finally found the manual for PyTables. In case anyone else is as blind as I am, I’m linking to it here.

INSTALLING NUMPY ON MACOS X SNOW LEOPARD

NumPy is a requirement to work with PyTables. This is the second step in the install process, after getting HDF5 set up. These instructions are based on the ones found on the NumPy site, but I’m summarizing things for my own use later on. First, you’ll need to install the Fortran compiler for OSX (gFortran). Fortunately there’s a Fortran universal binary installer. Next, get the...