Skip to content

Instantly share code, notes, and snippets.

@harmon
harmon / osx_bootstrap.sh
Created September 21, 2020 19:10 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@harmon
harmon / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@harmon
harmon / postinstall.sh
Last active August 29, 2015 14:09 — forked from JeffreyVdb/postinstall.sh
Better postinstall.sh
#!/bin/bash
# Setup a debian based vagrant machine
TO_CLEAN_PKGS=()
nullify_free_space() {
echo 'clearing free space'
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
}
# Apt-install various things necessary for Ruby, guest additions,
# etc., and remove optional things to trim down the machine.
apt-get -y update
apt-get -y remove apparmor
apt-get -y install linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g zlib1g-dev libxml2 libxml2-dev libxslt-dev libssl-dev openssl libreadline5-dev
apt-get clean
# Remove this file to avoid dhclient issues with networking
rm -f /etc/udev/rules.d/70-persistent-net.rules
@harmon
harmon / gist:caae5afb27b6070002c9
Created July 5, 2014 21:34
S3cmd configuration
$ brew install s3cmd
$ s3cmd --version
s3cmd version 1.0.1
@harmon
harmon / git-pruning
Last active August 29, 2015 14:01
Git Branch Pruning Script
#!/bin/bash
# From http://devblog.springest.com/a-script-to-remove-old-git-branches/
# This will remove all remote branches that have been merged into develop (excluding develop, stage, production branches)!
#
echo "The following remote branches have been removed from origin and will be pruned:"
git remote prune origin --dry-run
say "The following remote branches have been removed from origin and will be pruned:"
read -p "Continue (y/n)? " REPLY_1
if [ "$REPLY_1" == "y" ]; then
@harmon
harmon / bashrc
Last active August 29, 2015 14:00
AWS Helpers
# EC2 Helper
# Usage:
# $ ec2 ec2-254-254-254-254.compute-1.amazonaws.com
#
#============
ec2 () {
ssh -i ~/.ssh/<path_to_your_key_here> ec2-user@$1
}
@harmon
harmon / ipython_setup.sh
Last active August 29, 2015 13:57
Setup ipython notebook
##
# This installs virtualenv-wrapper via virtualenv-burrito.
# It allows for creating centralized virtualenvs in your HOME directory, creating a custom one
# for ipython notebook, installing the notebook, and setting up a command to run it.
##
# Install virtualenv-burrito
curl -s https://raw.github.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh | $SHELL
source ~/.venvburrito/startup.sh