Skip to content

Instantly share code, notes, and snippets.

View unixorn's full-sized avatar
💭
90% Snark by weight

Joe Block unixorn

💭
90% Snark by weight
View GitHub Profile
From 30e354fd338d85529f81eee7150659d662026c91 Mon Sep 17 00:00:00 2001
From: Chris Adams <chris@improbable.org>
Date: Sun, 22 Feb 2009 22:46:51 -0500
Subject: [PATCH] Import of wtfUpdate.py
---
utilities/wtfUpdate.py | 176 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 176 insertions(+), 0 deletions(-)
create mode 100644 utilities/wtfUpdate.py
@unixorn
unixorn / severalmanpages.makefile
Created January 24, 2011 02:31
example of copying a bunch of manpages
# stick a background image into /etc/hooks to use with iHook.
pack-dir-to-man8: l_usr_man_man8
@sudo cp my_man_dir/* ${WORK_D}/usr/share/man/man8
@sudo chmod 644 ${WORK_D}/usr/share/man/man8/*
@sudo chown root:admin ${WORK_D}/usr/share/man/man8/*
@unixorn
unixorn / pkgbuild.make
Created August 31, 2012 00:37
Use pkgbuild with the Luggage
compile_package: payload modify_packageroot
@-sudo rm -fr ${PAYLOAD_D}/${PACKAGE_FILE}
@echo "Creating ${PAYLOAD_D}/${PACKAGE_FILE} with pkgbuild"
@sudo pkgbuild --root ${WORK_D} \
--identifier ${PACKAGE_ID} \
--ownership preserve \
--version ${PACKAGE_VERSION} \
--scripts ${SCRIPT_D} \
${PAYLOAD_D}/${PACKAGE_FILE}
@unixorn
unixorn / keybase.md
Created January 6, 2015 08:14
keybase.md

Keybase proof

I hereby claim:

  • I am unixorn on github.
  • I am unixorn (https://keybase.io/unixorn) on keybase.
  • I have a public key whose fingerprint is 92EF 2BD5 0DAE 87E0 09E3 4127 C845 E8F1 6D8C F61B

To claim this, I am signing this object:

Verifying that +joeblock is my blockchain ID. https://onename.com/joeblock
@unixorn
unixorn / unpushed.gitconfig
Created April 20, 2016 19:54
Git rebase only unpushed commits
[alias]
rebase-unpushed = rebase -i @{u}
wip = rebase -i @{u}
work-in-progress = rebase -i @{u}
@unixorn
unixorn / sync-repo-to-s3.bash
Created October 12, 2016 17:51
Snippet that uploads a local repo directory to an s3-backed one
# Don't forget the trailing slash
REPO_BUCKET="s3://bucketname/"
sync-repo-to-s3() {
# Of course, this isn't as simple as just syncing the local repo to S3.
REPO_NAME=$(basename "$1")
SCRATCH_DIR="/tmp/daqri-repo-uploader.$$"
# We assume you've already run `dpkg-scanpackages` in the local copy of the repo
# Construct an s3 path that the s3 transport is happy with
@unixorn
unixorn / cookbook_helper.rb
Created January 10, 2017 19:10
Make it easier to specify a directory's contents in a Berksfile for test-kitchen
# Scan a directory in the gitroot for cookbook directories
def cookbook_search(book_directory, exclusions=[])
git_root = %x[ git rev-parse --show-toplevel ].chomp
Dir.entries("#{git_root}/#{book_directory}")
.reject { |i| %w(. ..).include?(i) }
.select { |i| File.directory?(File.join("#{git_root}/#{book_directory}", i)) }
.each do |cb|
if cb != File.basename(Dir.pwd) # Don't add an entry for ourself or Berks will error
if not exclusions.include?(cb)

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

#!/usr/bin/env bash
#
# Clean up an instance so packer can bake an AMI from it.
#
# Copyright 2017, Jiff Inc
# License: Apache 2.0
set -o pipefail
if [ ! -z "${DEBUG}" ]; then