Disappearing Spaces in Lion

I just realized that if you have your Dock on the left edge of the screen you cannot create a Space in Mission Control, the option disappears. Move it to the botton or right and you will be fine.

Weird.

May 2, 2012: update, the Space tab appears on the opposite side from the dock, so don’t go looking for it on the left side if your dock is on the left. :)

Overcoming an IMDbPY installation issue on Ubuntu 11.04

IMDbPY is a Python module to enable backend search and retrieval of information from the IMDB. To install IMDby on Ubuntu you’ll need to download the module here. Then you’ll need to extract the module and run (as root):

$ sudo python setup.py install

You may get an error complaining about a ‘gcc’ compiler, I did, even though a quick:

$ which gcc

returns a live ‘gcc’ compiler on my box. The trick I found here is to install ‘python-dev’ through your Ubuntu package manager.

$ sudo apt-get install python-dev

Then you should be able to run the earlier module installation without errors. Fire up python and check it out to make sure.

$ python
>>> import imdb

Things should be fine!

NLTK on Mac OSX

I’ve found myself being drawn into Python recently. First, with what seems to be an experimental software dream, IBEX (Webspr), and now I’ve returned to take a look at the Natural Language ToolKit (NLTK). Both are Python-based and both underline the wide support that Python is getting in language research.

I’ve just completed the NLTK install, including some of the optional packages. It took a little poking around on the net to find the right process to get things up and running on my system: OSX 10.7.2 MacBook Air.

If you are an academic it’s much easier, here’s what I did:

1. Get a worthy Python instance: download Enthought Python by adding your .edu email address here. Once downloaded follow the installer instructions.

2. Get the latest versions of the following NLTK packages: PyYAML and NLTK (note: pick up the source code, when I downloaded the .dmg package Enthought could not find the NLTK package.)

3. Install PyYAML. Extract the compressed file, start up Terminal and cd into the PyYAML directory. Then run:

sudo python setup.py install

3. Install NLTK. Extract the compressed file, start up Terminal and cd into the NLTK directory. Then run:

sudo python setup.py install

4. Enjoy!

Pianobar on Mac OSX

I stumbled across a great post on how to install pianobar, the command-line interface to Pandora, on OSX. http://happygastropod.com/2011/01/pianobar-on-mac-osx

The basic rundown and few notes:

1. Install Homebrew
2. Install pianobar (Note: I had to use use the –HEAD flag in order to get the dependencies to update)


brew install pianobar --HEAD

If you want to trick-out your installation, you can go on to add automatic login and growl support in a configuration file (that you’ll need to create in ~/.config/pianobar/config). Make sure you are running the latest version of Growl (or the correct version for your OS), if not you will meet a series of errors!

You can even go beyond, and add a custom image to your Growl notification using the growlnotify –image flag. For more on that just run


growlnotify --help

Install graphical interface for TreeTagger on Windows

Here’s a slimmed down step-by-step instruction list on how to install the TreeTagger graphical interface on a Windows machine.

1. Download the Tree-Tagger software for Windows.

2. Unzip this file into your C:\Program files\ directory. Using WinZip, make sure you have the “Use folder names” box ticked and extract all files.

3. Download the parameter file(s) that you need and extract them into the subdirectory C:\Program Files\TreeTagger\lib

4. Download and drop the graphical interface files (tagger and training programs) in the C:\Program Files\TreeTagger\bin subdirectory.

5. Then make a shortcut to the desktop by right-clicking on the tagger and/or training programs and selecting create shortcut. Drag that shortcut to the desktop.

You should now be able to launch TreeTagger from the desktop.

Install vislcg3 tools on Mac OS X

Here are the instructions to install the vislcg3 constraint grammar on a Mac.

1. Install the Xcode developer tools (App Store)

2. Install cmake and boost. I use Homebrew, but I imagine you could use MacPorts or Fink.

3. Install ICU. This takes a few steps:
A. Download the package here: http://download.icu-project.org/files/icu4c/4.8.1/icu4c-4_8_1-src.tgz (or the latest version) and decompress it:

$ gunzip -d < icu4c-4_8_1-src.tgz | tar -xvf -

Then run:

$ cd icu/source/

It's a good idea to make sure the permissions are set so run:

$ chmod +x runConfigureICU configure install-sh

B. Now run the runConfigureICU like so:

$ ./runConfigureICU MacOSX

C. You'll then make and make install, and you should be golden:

$ make
$ sudo make install

4. Now it's time to get to vislcg3.
A. Download the files from the svn repository:

$ svn co http://beta.visl.sdu.dk/svn/visl/tools/vislcg3/trunk vislcg3

Then move into the main directory:

$ cd vislcg3/

B. Do a checkup on the install:

$ ./cmake.sh

C. Run make and make install to finalize this thing.

$ make
$ sudo make install

D. Now check to see that it's in your path:

$ which vislcg3

And if you get a path to the binary, you're ready to go!

Create an SSH tunnel for a remote MySQL database

This isn’t that hard to find out on the Internets, but I want to document a couple tips that I find useful once you create an SSH Tunnel to your remote MySQL database. After you create the tunnel, you will be able to interact with the database as if it were on your local machine, which simplifies running SQL scripts.

1) Create an SSH Tunnel

Firs open a command-line interface and enter:

$ ssh user@host -L 3306:localhost:3306

2) Connect to the remote database with with local(ish) syntax

Then open another command-line window (without closing the other session) and enter:

$ mysql -u db_user -h 127.0.0.1 -p

The explicit 127.0.0.1 for localhost seems to be important (I get a connection error when I just specify ‘localhost’.

And there you go, a local interface to your remote MySQL database. A more complete trick-laden version of this post can be found here.