CouchDB CLI on Mac OS X

CouchDB now includes a fancy, pre-compiled OS X app file that you can download.  This works fine, except that the CLI (command-line interface) tools don’t get automatically added to the path.  So, after dragging Apache CouchDB.app to your Applications folder, do the following to get access to the CLI tools.

  1. Open Terminal.
  2. Edit (nano or vi) your .bash_profile.
  3. Add the following to the end of it:
    export PATH=/Applications/Apache\ CouchDB.app/Contents/Resources/couchdbx-core/bin:$PATH

  4. Save the file and exit your editor.
  5. Type source .bash_profile to load the .bash_profile and gain immediate access to the CLI tools.

Once you’ve done this, paths referenced via couchdb -c will be relative to:

/Applications/Apache CouchDB.app/Contents/Resources/couchdbx-core/

Remote MySQL Dump and Local Restore… With Progress!

Requires zcat and pv.


Dump remote DB to local machine:

[ssh user] = SSH user name

[remote server] = Server hosting the MySQL DB that you want to dump

[remote mysql user] = MySQL user that has read access to the DB

[remote mysql password] = Password for aforementioned user

[remote db] = Remote DB name

ssh -l [ssh user] [remote server] "mysqldump -u [remote mysql user] --password=[remote mysql password] --single-transaction --quick --lock-tables=false [remote db] | gzip -3 -c" | pv > [remote db].sql.gz

Import local dumped DB to local MySQL instance:

[local db] = Local DB name

[local mysql user] = MySQL user that has write access to the DB

[local mysql password] = Password for aforementioned user

zcat [remote db].sql.gz | pv | mysql -u [local mysql user] --password=[local mysql password] [local db]

Mavericks Broke My Apache!

Note: Instead of doing everything below, you could just restore the backup of your httpd.conf that the Mavericks install created at /etc/apache2/httpd.conf~previous. Wish I knew that 8 hours ago.

Because I like shiny new things, I decided to upgrade to Mavericks (OS X 10.9) last night.  The upgrade finished around 1am, at which point I was tired, so I went to sleep.  I woke up this morning to start my day, only to realize that all of my Apache Virtual Hosts were throwing 403: Forbidden errors.  After a couple hours of chmod, chown, editing conf files and banging my head against the wall, I finally got it working.  So if this happened to you, hopefully the following steps will help.

Kali Linux on Headless BeagleBone Black via OS X

I recently purchased a BeagleBone Black.  The OS and configuration it ships with is nice and friendly, but I wanted something that I can have real control over.  I went with Ubuntu 13.04 at first, but then I thought about BackTrack, which I quickly realized is now Kali.  And there’s a BBB distribution available.  So after a few days of sleepless nights and lost hair, I present you with my guide to getting Kali Linux working on a headless BeagleBone Black via OS X.

sdxcOne of the first questions I asked myself (and Google) was:  Does the BeagleBone Black support 32 GB microSD cards / SDXC?  I know the SDHC spec says it supports up to 32 GB, but it appears that the 32 GB card I bought is actually SDXC.  At any rate, even though not explicitly stated ANYWHERE (and trust me, I searched), it turns out that the BBB does indeed support 32 GB SDXC cards.  If your 32 GB microSD card isn’t working, it’s likely that there’s a different problem, so read on…