Skip to content

Instantly share code, notes, and snippets.

Benjamin H. Graham bhgraham

Block or report user

Report or block bhgraham

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ghost bookmarklets
print the whole rendered article bookmark with this URL to print the preview:
javascript:var w =;var html = "<!doctype html><html><body>" + $(".js-rendered-markdown").html() + "<script>w.print();</script>" + "</body></html>";$(w.document.body).html(html);
login bookmarklet
edit post
Drag the link below to your bookmarks bar and click it when you’re viewing a post on your Ghost blog:<br /><br /><a href="javascript:var%20url%20=%20window.location;newUrl%20=%20url+"/edit";window.location.replace(newUrl);">Edit Post!</a><br /><br />It will append <code>/edit</code> to the url and reload, so you can edit your post<br /><br />— Built with ❤ by <a href="">@curiositry</a> (<a href="">Twitter</a>, <a href="">GitHub</a>)

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

View gist:6ded02cbb3c118773ef3d07d10ddd011
sudo apt update
sudo apt install ssh screen build-essential git \
nfs-common nfs-kernel-server samba
sudo apt purge docker-compose docker-registry systemd-docker;
# Install docker-compose and docker
sudo wget`uname -s`-`uname -m` -O /usr/local/bin/docker-compose;
sudo chmod +x /usr/local/bin/docker-compose;
bhgraham / debmigrate
Last active Aug 29, 2015
Migrate all installed packages between debian based machines.
View debmigrate
# Author: Benjamin H. Graham (
# Copyright: 2015 Administr8 (
# License : GNU GPL v2 (
# dump packages to pastebin, return hash
# restore packages from pastebin with hash input
bhgraham / install_dockerdeb
Created Dec 31, 2014
Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc)
View install_dockerdeb
# Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc)
# Author: Benjamin H. Graham <>
# Usage: curl -s | bash
# Add debian repo
echo "Adding the debian repository for docker"
echo deb docker main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
echo "Updating apt repos"
sudo apt-get update -qq
bhgraham / install_dockermac
Created Dec 31, 2014
Quick Install for Docker on Mac OSX
View install_dockermac
# Quick Install for Docker on Mac OSX
# Author: Benjamin H. Graham <>
# Must be run as root
# Usage: curl -s|sudo bash
cd ~
echo "Downloading docker binary";
curl -Ls "" -o "Boot2Docker-1.2.0.pkg";
echo "Installing docker service";
installer -pkg Boot2Docker-1.2.0.pkg -target /;
bhgraham / 0_reuse_code.js
Created Aug 17, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
bhgraham / projects.rb
Created Feb 14, 2013
gitlab/lib/api/projects.rb only changed the lines mentioning namespace_id. these were added to allow project creation within namespace (from API). If not used, it defaults to your username. This allows gh2gl to work "git clone" for github to gitlab migrations.
View projects.rb
# Create new project
# Parameters:
# name (required) - name for new project
# description (optional) - short project description
# default_branch (optional) - 'master' by default
# issues_enabled (optional) - enabled by default
# wall_enabled (optional) - enabled by default
# merge_requests_enabled (optional) - enabled by default
# wiki_enabled (optional) - enabled by default
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1
ln -s /usr/bin/ruby /usr/local/bin/ruby
ln -s /usr/bin/gem1.9.1 /usr/local/bin/gem
rm /usr/bin/ruby /usr/bin/gem
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
View .gitignore
You can’t perform that action at this time.