Skip to content

Instantly share code, notes, and snippets.

View jonmorehouse's full-sized avatar
💻
founder at nuon.co

Jon Morehouse jonmorehouse

💻
founder at nuon.co
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jonmorehouse on github.
  • I am jonmorehouse (https://keybase.io/jonmorehouse) on keybase.
  • I have a public key whose fingerprint is B7DE 28A9 E796 9029 8560 2A57 D61D D2B4 DD96 6C66

To claim this, I am signing this object:

@jonmorehouse
jonmorehouse / osx.sh
Created April 11, 2014 02:53
OSX customization / configuration
#!/usr/bin/env bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@jonmorehouse
jonmorehouse / backlog.sh
Created March 12, 2014 05:56
Backlog manager for daily file management
function backlog {
# assumes you are in the backlog directory
# create file contents as needed
# link readme each day - easy github management
# create proper commit message
file=$(date | awk '{ print tolower($1)"-"tolower($2)"-"$3 }')
file_path=current/$file.md
# generate file contents
[Unit]
Description=docker daemon
[Service]
PermissionsStartOnly=true
Type=forking
ExecStart=/usr/bin/docker -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock -d
@jonmorehouse
jonmorehouse / security-groups.sh
Last active August 29, 2015 13:57
Command line management of groups
# create a new security group
ec2-add-group -d "Group description" $groupName
# now delete a group
ec2-delete-group $groupName
# authorize rules for a group
ec2-authorize $groupName
# authorize a group to expose all tcp ports
@jonmorehouse
jonmorehouse / alias_generator.sh
Created March 3, 2014 08:17
Alias Generator - useful for creating name-spaced aliases for project directories
#!/usr/local/bin/bash
alias_path="$1"
if [ $# -gt 1 ]
then
# if _ or "" is passed in, then we want to just pass in a blank
if [[ $2 == "_" || $2 == "" ]]
then
alias_prefix=""
else
alias_prefix="$2-"
@jonmorehouse
jonmorehouse / ec2.sh
Last active August 29, 2015 13:56
EC2 one liners for setting up / breaking down machines
#!/usr/local/bin/bash
# create an ec2-instance and grab the instance id
instance_id=$(ec2-run-instances -g development -t t1.micro -k master $EC2_UBUNTU_AMI | grep INSTANCE | awk '{ print $2 }')
# create a tag for this instance as needed
ec2-create-tags -t Name=development $instance_id
# grab instance_id by tag
instance_id=$(ec2-describe-instances --filter "tag:Name=development" | grep INSTANCE | awk '{ print $2 }')
@jonmorehouse
jonmorehouse / tar.go
Created February 17, 2014 22:29
Quick golang script for creating a gzipped tarball
package main
import (
"os"
"archive/tar"
"log"
"io"
"compress/gzip"
)
package main
import (
"os"
)
func main() {
path := "test.txt"