Using a Cisco compatible (vpnc) VPN from the command line in Linux

There's a command line program, vpnc which can be used to log into a cisco-compatible VPN on the command line. Enter the server address for the "gateway address", the group name and group secret for the IPSec ID and IPSec secret, and then the username and password, and it will start a vpnc daemon process in the background that connects you to the vpn.

To install it:

sudo apt-get install vpnc


Robolectric in gradle

Robolectric is a unit test framework that allows you to test Android code in a normal JVM without an emulator. There are several versions of gradle plugins that are supposed to allow you to run robolectric tests in a gradle project, but none worked out of the box for me.

Shared variables in Gradle's buildscript block

Gradle documentation on the internet has numerous examples of global variables that are defined at the top level of the file like this:

androidPluginVersion = '0.8.+'
buildscript {
  repositories {
  dependencies {
    classpath "$androidPluginVersion"

adb force install

If you get Failure [INSTALL_FAILED_ALREADY_EXISTS] or Failure [INSTALL_FAILED_VERSION_DOWNGRADE] when installing an .apk on your Android emulator, you can run:

adb install -r -d path/to/the-debug-unaligned.apk

to force downgrading and replacing of the existing .apk package.

Elasticsearch Concepts

The Elasticsearch guide has a useful map from relational database terminology to Elasticsearch terminology:

Relational DB ⇒ Databases ⇒ Tables ⇒ Rows ⇒ Columns
Elasticsearch ⇒ Indices ⇒ Types ⇒ Documents ⇒ Fields

Vagrant setup for Drupal on Ubuntu

Vagrant lets you run a single command, vagrant up which will download an operating system image, install it into Virtualbox, boot a virtual machine, and then run shell scripts or Puppet to install software packages or make other changes to the operating system after it boots up the first time.

Most compact way to store UUIDs in sqlite

If you want to store a UUID in sqlite and use the minimal possible amount of disk space, it seems like the best solution may be to represent each UUID as a 16 byte binary string and store it in a BLOB column.  I tested inserting 100,000 UUIDs into a table using three strategies with Sqlite 3.7.9, and the resulting file sizes were:

Version in which .vagrant changed from a file to a directory

Vagrant converted the .vagrant file into a directory in version 1.1.  There's code in Vagrant that will automatically convert your .vagrant file into a .vagrant directory:

Making directory trees equivalent to mkdir -p in puppet

When you create a directory in Puppet using the file type, you may get this error if you haven't already created all parents of the directory in question first:

err: /Stage[main]//File[/path/to]/ensure: change from absent to directory failed: Cannot create /path/to; parent directory /path does not exist

This puppet module defines a custom function all_parents() which you can use to create a directory and all of its ancestors simultaneously.

Install ruby gems without root access in your home directory

You can install a ruby gem in your home directory with:

gem install --user-install puppet-module 


gem install --install-dir=$HOME/.gem/ruby/1.8 puppet-module

If you're using bundler:

bundle install --path $HOME/.gem

And then you can run the command line programs installed by adding the local bin directory to your path:

export PATH


Subscribe to RSS - Tech