Tor with Brew in Mac OS X

To install the Tor service using Brew in Mac OS X:

$ brew install tor torsocks

However, this does not load the Tor service automatically (either manually or automatically at log in). Since I don’t link things to be loaded automatically for me, I’ve created the following shell script to load or unload (start or stop) the Tor service manually in Mac OS X:


function usage() {
  echo "usage: $0 start|stop";
  exit 1;

function tor_service() {
  launchctl $1 /usr/local/opt/tor/homebrew.mxcl.tor.plist

function start() {
  echo "$0: starting tor service...";
  tor_service load

function stop() {
  echo "$0: stopping tor service...";
  tor_service unload

function check() {
  echo "$0: checking if tor works...";
  if torsocks curl -s | grep -q 'Congratulations. This browser is configured to use Tor.'; then
    echo 'The tor service works';
    echo 'The tor service does NOT work';

case "$1" in




    echo "error: missing or unrecognized command-line argument";

To start (load) the Tor service:

./ start

To stop (unload) the Tor service:

./ start

To check whether the Tor service is working:

./ check

To tor-ify command-line tools like curl or wget:

torsocks wget

High-availability in OpenStack Neutron (Icehouse)

If you ever want to deploy Neutron in OpenStack (Icehouse) in high-availability mode, where you have more than one network controller (node), you’ll have to take into account that most of Neutron components will have to run in active-passive mode. Furthermore, virtual routers get associated to a L3 agent at creation time, and virtual networks to a DHCP agent. This association is established via the host name of the agent (L3 or DHCP). Unless explicitly configured, Neutron agents register themselves with a host name that matches the FQDN of the host where they are running.

An example: let’s imagine a scenario where we have two network nodes: and By default, the L3 agent running on the host will register itself with a host name of The same holds true for the the DHCP agent. The L3 agent on host is not running yet, but it’s configured in the same way as the other L3 agent. Hence, the L3 agent on host will register itself using a host named

Now, a user creates a virtual router and, at creation time, it gets associated with the L3 agent running on host At some point, host fails. The L3 agent on host will be brought up (for example, via Pacemaker). The problem is that the virtual router is associated with an L3 agent named, which is now unreachable. There’s an L3 agent named, but that won’t do it.

What’s the proper solution to fix this mess? To tell Neutron agents to register themselves with a fictitious, unique host name. Since there will only be one agent of the same type running at the same time (active-passive), it won’t cause any problems. How does one tell the Neutron agents in OpenStack (Icehouse) to use this fictitious name? Just add the following configuration option to /etc/neutron/neutron.conf inside the [DEFAULT] section:

host = my-fictitious-host-name

LG G3 (D855): How to remove custom carrier boot and shutdown animations

Tired of your carrier from dropping a custom boot and shutdown animation? Like Movistar does? Do you have an LG G3 D855 phone? Is it rooted? Then it’s just a matter of removing the following files:

adb shell
su -
rm /data/shared/cust/
rm /data/shared/cust/

This will, hopefully, revert to using the stock boot and shutdown animations.

Installing python-glanceclient using Brew on Mac OS X 10.10

I was getting clang errors on ffi.h when trying to install python-glanceclient using pip:

$ pip install python-glanceclient
Installing collected packages: python-glanceclient, cryptography, jsonschema, jsonpatch, cffi, jsonpointer, pycparser
Running install for cryptography
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Cleaning up...
Command /usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_brew/cryptography/';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-jghJZG-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_brew/cryptography
Storing debug log for failure in /Users/brew/.pip/pip.log

A fix that seems to work is manually installing libffi and exporting PKG_CONFIG_PATH pointing to it:

$ brew install pkg-config libffi
$ export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig/
$ pip install cffi
$ pip install python-glanceclient
$ glance --version