Hi! Thanks for visiting my blog. If you've received any value from my content would you mind supporting my new startup by downloading our browser add-on? It's called PriceBlink and makes online shopping a breeze. You can watch it in action here and download it for Chrome, Firefox, IE, or Safari by going to PriceBlink.com. Thank you and I hope you enjoy!

How to Move MySQL’s Data Directory on Ubuntu

Oct 12

I recently setup a MySQL database on EC2 and wanted to move the data directory off the root partition. For the sake of simplicity I wanted MySQL’s data files to live in /mnt/mysql. I thought this would be a trivial task and after moving the files and updating /etc/mysql/my.cnf data to:

datadir = /mnt/mysql

I restarted MySQL and noticed the following error in the log file:

/usr/sbin/mysqld: Can’t find file: ‘./mysql/plugin.frm’ (errno: 13)
111012 1:10:01 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
111012 1:10:01 InnoDB: Initializing buffer pool, size = 8.0M
111012 1:10:01 InnoDB: Completed initialization of buffer pool
111012 1:10:01 InnoDB: Operating system error number 13 in a file operation.

MySQL wouldn’t start so I scratched my head for a bit, did some Googling, and discovered AppArmor on Ubuntu. It turns out that AppArmor restricts the capabilities of any program that has a profile configured. MySQL falls into this category.

So I updated the AppArmor profile for MySQL. This file is located in:

/etc/apparmor.d/usr.sbin.mysqld

You’ll see a couple lines that look like:

/var/lib/mysql/ r,
/var/lib/mysql/** rwk

I changed those to:

/mnt/mysql/ r,
/mnt/mysql/** rwk

and restarted AppArmor via:

sudo /etc/init.d/apparmor restart

Then I started MySQL and was good to go.

Read More

Problems Installing Node.js on OS X Lion

Oct 07

I’ve been wanting to try Node.js for some time and finally got around to it last night. I’ve had all sorts of little problems after upgrading to OS X Lion and ran into one when compiling Node.js. I was following the howto guide on the Node wiki page and received an error when running ./configure. The error stated:

/Users/db/_dev/nodejs/wscript:232: error: could not configure a cxx compiler!

which looked like this:

It turns out that after upgrading to OS X Lion that my g++ and c++ compilers were no longer working. Instead of digging into the root cause I decided to upgrade to Xcode 4.1.1 from the Mac App Store. Unfortunately, this was a 3.1 GB download so I had to wait a bit before I could continue with my Node.js install.

After Xcode was downloaded the App Store showed that it was installed as you can see here:

But unfortunately that wasn’t the case. The file had only been downloaded and not installed. I had to use Spotlight to locate the “Install Xcode” binary:

After installing Xcode 4.1 I was finally able to configure and make Node.js. Now on to bigger and better things. I hope this helps those who run into the same problem of installing Node.js on OS X Lion.

Read More

Why I’m a Fan of PriceBlink for Unobtrusive Comparison Shopping

Sep 30

If you spend any time shopping online then you should most definitely check out PriceBlink. It’s a browser addon that make it easy to find the best deals while shopping on retailer sites. It even works for obscure products like 3″ chlorine tablets for your swimming pool.

I recently became a new pool owner and had no idea of some of the costs associated with pool ownership. Let’s take chlorine tables for example. I bought a 20 lb bucket of tablets at my local pool store for $70 this past week. Anyone that owns a pool will most likely tell me I got ripped off. Aside for the convenience factor of buying local, you’re absolutely right. But time was of the essence and I didn’t have time to order them online and wait a few days for them to arrive at my door.

Moving forward I’ll be buying chlorine tablets online and with the help of my trusty comparison addon, PriceBlink. I just searched for the same brand/size of tablets that I currently use and ended up on the Walmart site. Although Walmart didn’t have pricing for my area, PriceBlink told me I could get a 37.5 lb bucket of HTH tablets for $99.74.

After doing some of my own Googling I found them for $20 more at Capitol Supply. That’s a no brainer. Now I realize that shipping comes into play here, but the nice thing is that PriceBlink tells me the shipping cost of items or at least let’s me know there’s a shipping fee by including “plus shipping” in the price menu.

After clicking the lowest price I was taken to a nifty site called Ron’s Home and Hardware:

When it comes time to buy my next bucket of chlorine tablets I’m glad to know PriceBlink will be around to give me peace of mind. PriceBlink helps me:

  • Find the best deals on mainstream products
  • Fine the best deals on obscure projects like chlorine tablets
  • Introduces to nifty online retailers such as Ron’s hardware

The next time you consider buying ANYTHING online you should install the PriceBlink addon. It’s completely free and provides price comparison for Google Chrome, Mozilla Firefox, Apple Safari, and Internet Explorer. If you want to see PriceBlink in action then check out the video below. Enjoy!

Read More

Error with top command on OS X Lion

Aug 30

This is one of those annoying little nits that I wanted to share for my personal use and others. Today I was reviewing a few processes on one of my VMs hosted at Slicehost. I ran the top command to check out the system load and received the following error message:

‘xterm-256color’: unknown terminal type.

I knew something was up because top has always worked for me previously. After searching around a bit I stumbled across a forum post that mentioned this was a problem after upgrading to Mac OS X Lion (which I recently did). The answer was quite simple and consists of installing the ncurses-term package. Since my VM runs Ubuntu I used apt-get to install it:

sudo apt-get install ncurses-term

Everything is now back in working order. Hope this helps.

Read More

Accessing Google Chrome Extension Local Storage Database

Dec 13

I’ve been helping a friend with a Google Chrome extension, which makes use of the Chrome localStorage API. The extension checks for a variable and if it doesn’t exist it writes it to the localStorage database. If you’re note aware, the localStorage database is actually an SQLite database.

For testing he needed a way to change this variable outside the extension to exercise different test cases. The goal was to change the variable and run the Chrome extension to see if it behaved as expected. This was accomplished with the following steps:

1. Download Mike Titlebaum’s nifty SQLite database management tool http://saxmike.com/MySoftware/MySoftware.asp?Menu=MYSOFTWARE

2. Open the localStorage database using this tool. The database is actually a file that exists in the user data directory. For Mac users this is located at ~/Library/Application Support/Google/Chrome/Default/Local Storage. The file will be named something like chrome-extension_[Chrome Extension ID]_0.localStorage. For Windows and Linux you can reference this link.

3. To access this file in Mike’s tool you need to “Connect” and navigate to the file in the file browser. Once the file is opened you need to select the “ItemTable” table. You should see a list of key/value pairs underneath the table.

4. Simply click the key/value you want to change and enter the new value. The new value will automatically update after you hit the enter key.

5. Restart Chrome and test the extension with the changed value.

The alternative was to create a “debug” mode for the extension that would allow the variable to be changed, but for the sake of time this was the easiest path to accomplish the task.

Read More