Skip to content

Instantly share code, notes, and snippets.

Going underground

Dominic Sayers dominicsayers

Going underground
View GitHub Profile

UPDATE: CrunchBase have now restored their own documentation so you should now use the canonical information at I am leaving this here in case of existing links to it but it is of historical interest only.

NOTE: This documentation has been put here because I couldn't find it anywhere else. I am not associated with Crunchbase in any way. I cannot help you with your Crunchbase API problems. If you need help try here:!forum/crunchbase-api

CrunchBase API v1 Documentation


dominicsayers /
Last active Apr 22, 2019
Installing Virtualbox 4.3 on Ubuntu Server 13.10 64-bit

First install Virtualbox

  1. sudo pico /etc/apt/sources.list.d/virtualbox.list
  2. Add deb saucy contrib non-free
  3. wget -q -O- | sudo apt-key add -
  4. sudo apt-get update
  5. sudo apt-get install dkms unzip
  6. sudo apt-get install virtualbox-4.3 --no-install-recommends
  7. wget
  8. sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.6.vbox-extpack
dominicsayers / gist:4217521
Last active Oct 13, 2015
Configuring BIND using Webmin
View gist:4217521
  1. I installed BIND during the Ubuntu setup process by selecting DNS Server when asked for package selections.
  2. Click Create Master Zone
  3. Enter for Domain Name/Network and click Create
  4. Add A-records
  5. Apply Zone
  6. Apply configuration
dominicsayers / gist:4510890
Created Jan 11, 2013
[FIXED] Problem installing pg gem: checking for PQconnectdb() in -lpq... no
View gist:4510890
dominicsayers$ sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
dominicsayers /
Last active Dec 12, 2015
Cloning an Ubuntu guest machine in Virtualbox

Cloning an Ubuntu guest on Virtualbox

Cloning a VM is easy in theory but if you don't set up networking properly in the newly cloned machine it can kill all networking on the host.

In particular, Virtualbox gives your cloned machine a new NIC with a new MAC code. This is probably what you want since you don't want multiple machines on your network with the same MAC address. But Ubuntu still has the NIC from the original machine in one of its configuration files, so there's a clash between the hardware created by Virtualbox and the Ubuntu VM's own view of the world.*

Simple but tedious to fix. Here goes, on the Virtualbox host machine:

  1. su vbox
  2. VBoxManage clonevm original_vm_name --name new_vm_name --register
dominicsayers /
Created Mar 6, 2013
Installing s3cmd on Ubuntu Server
  1. sudo apt-get install python-setuptools
  2. wget
  3. tar xvfz s3cmd-1.5.0-alpha1.tar.gz
  4. cd s3cmd-1.5.0-alpha1
  5. python install
  6. s3cmd --configure
dominicsayers /
Last active Dec 14, 2015
Installing Postfix & Dovecot on a fresh Amazon EC2 Ubuntu Server 12.10 instance and setting it up so all mail to all subdomains goes to one local user with IMAP access.

Instance setup

  1. Make sure the security group is allowing through any ports you need for SMTP & IMAP. Also open port 10000 for Webmin.
  2. You'll want to give it an Elastic IP address so it doesn't wander aimlessly round the IPv4 address space.

Webmin setup

  1. sudo apt-get install ntp ntpdate dkms htop - optional: these are just my favourite things
  2. sudo pico /etc/apt/sources.list and add at the end:
dominicsayers /
Created Mar 18, 2013
Syntax errors in ActiveRecord schema.rb caused by $\ = ','

If you get schema.rb:16: syntax error, unexpected ',' when you do a rake environment db:setup it may be because the ActiveRecord task that builds this file happens to use the Ruby print statement.

So if you have a default separator set up by using

$\ = ','

somewhere in your code that gets executed before a rake task (e.g. in the header of a class) then schema.rb will end up with stray commas interspersed with the code that gets generated.

Obviously this effect will depend on the default delimiter you've configured but if it's not whitespace, prepare for trouble.

dominicsayers /
Created Mar 25, 2013
HMRC Basic PAYE Tools authentication error 1046

If you're getting an authentication error when trying to make a submission using the HMRC Basic PAYE Tools then check your password length. A password of more than 12 characters will not work.

The website lets you set up a longer password and use it to log in but it will not work for the Basic PAYE Tools.

Change your password on the website to 12 characters or less and you should be able to make your submission. Note that on the password change page it does tell you it should be 12 characters or less.

dominicsayers /
Created Apr 16, 2013
Recover Mongodb on Ubuntu after an unclean shutdown
sudo -u mongodb rm /var/lib/mongodb/mongod.lock
sudo -u mongodb mongod --dbpath /var/lib/mongodb --repair
sudo start mongodb