INSTALL ISSUE PYMONGO ON OSX (SETUPTOOLS OUT OF DATE)

easy_install on the mac has some weird hardcoding issue where it uses a specific version of setuptools. You can read a really good explanation by Andreas Jacobsen here. The fix is to use python to call easy_install instead of using the Apple provided one. sudo python -m easy_install pymongo

ANOTHER ATTEMPT AT PYTHON

I tried Python out a while ago, but stopped trying it to learn it after some major frustrations. Maybe I didn’t dig deep enough into it. I found the documentation hard to read, and the module layout seemed a little random at times. For some reason I found executing an external process and getting the results to be a little convoluted. (Since then I’ve learned to use popen(..).communicate()) I ended up messing with other languages to try to find one that suits my tastes, like Erlang and D.

SSH WITH MULTIPLE HOPS

Excellent question on superuser.com with a fantastic answer. If anyone needs to jump through multiple servers via ssh (or any other protocol) take a look at this answer. ssh -L 9999:localhost:9999 host1 ssh -L 9999:localhost:1234 -N host2

REDIS WILDCARD DELETE

Redis supports a keys command, which takes in a pattern, but you can’t use patterns for deletes. Fortunately awk and xargs makes this easy. Just throw this on your server (somewhere in the PATH), chmod 755, and you’re good to go. #!/bin/bash redis-cli keys $1 | awk '{print $1}' | xargs –interactive redis-cli del {} ; How to use: redis-del pattern*

COMBINING IWATCH WITH RELOADER

I had written a post about how to set up reloader.erl about a year ago. Reloader.erl is an incredibly useful library included in mochiweb for automatically reloading erlang libraries if they’ve been recompiled. I had also written a post about iWatch and phpunit to follow source directories and automatically run a unit test (or other command) when src files change. Really great for rapid development - you can code in one window and just glance over to know if things are working as expected.

USING IWATCH TO AUTOMATICALLY RUN UNIT TESTS (LINUX)

iWatch is a perl script that uses inotify to monitor files directories. It’s similar to the watch tool, which can do all sorts of stuff if the files or directories it’s watching are modified or affected in pretty much any way at all. Install iWatch apt-get install iwatch I’ve got this 1 liner in a file to quickly watch my directory and execute a PHP unit test . #!/bin/bash iwatch -c "phpunit $1" -t '.

HOW TO SET UP A LOCAL APT CACHE FOR UBUNTU

Setting up a local cache is a smart idea if you’re going to be running a VM server, whether it be KVM, VirtualBox, or any other option really. I assume the same instructions will work with Debian, but I haven’t tried. First up - install apt-cacher-ng. apt-get install apt-cacher-ng Add this to the bottom of your /etc/services: apt-cacher 3142/tcp apt-cacher 3142/udp Edit /etc/default/apt-cacher and set AUTOSTART to 1. See this post in the ubuntu forums for more details.

AWESOME CHROME EXTENSION TO BLOCK WEBSITES FROM GOOGLE SEARCH RESULTS

I wrote a post a few years ago that made the digg and reddit homepage saying Experts Exchange should be removed from Google’s search results because they were using a technique called cloaking - hiding their content behind registration and showing a different version of their pages to the Google crawler. Google just released a Chrome extension to blacklist sites from your search results. Part of the functionality includes sending the blocked site back to Google - which might eventually have some impact down the line on search results.

SETTING UP A DHCP BRIDGE IN UBUNTU 10.10 FOR VIRTUALIZATION

Setting up a network bridge allows you to give a virtual machine it’s own IP address and make it accessible from the outside. A DHCP bridge is useful in a smaller network where static IPs aren’t assigned - like in a home or small office. You’ll want to do this if you’re setting up LXC or KVM. This is what my /etc/network/interfaces config looks like. `` auto lo iface lo inet loopback

VIRTUALBOX 4 - NAT PORT FORWARDING GUI

Version 4.0 of VirtualBox will have NAT port forwarding available in an easy to use GUI. The more fervent readers of this blog will remember this post which I described how to set this up on the command line. Open your VirtualBox networking settings, and click the port forwarding button. Click the little plus on the right to add your settings. You can leave out the IP - it’s optional.