Skip to content

Instantly share code, notes, and snippets.

@mattieb
mattieb / create_dmg.sh
Created November 4, 2015 02:51
Create a DMG installer for installing El Capitan into a VM
# Based on Tim Sutton's prepare_iso.sh from the excellent osx-vm-templates
# <https://github.com/timsutton/osx-vm-templates/blob/master/prepare_iso/prepare_iso.sh>
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg
hdiutil create -o tmp.dmg -size 10g -layout SPUD -fs HFS+J
hdiutil attach tmp.dmg
asr restore --source /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg --target /Volumes/untitled --erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -Rv /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -v /Volumes/OS\ X\ Install\ ESD/BaseSystem.* /Volumes/OS\ X\ Base\ System/
@silentbicycle
silentbicycle / pirate.cow
Created July 14, 2014 22:43
pirate.cow
$eye = chop($eyes);
$the_cow = <<"EOC";
$thoughts A__^
$thoughts ($eye#)\\_______
(__)\\ )\\/\\
$tongue ||----w |
J| |V
EOC
@mattes
mattes / cloud-config.yaml
Last active November 2, 2016 16:37
CoreOS on Google Compute Engine: push systemd journal logs to logentries.com https://medium.com/coreos-linux-for-massive-server-deployments/defb984185c5
#cloud-config
write_files:
- path: /home/core/journal2logentries.sh
permissions: '0744'
owner: root:root
content: |
#!/usr/bin/env bash
# CoreOS on Google Compute Engine: push systemd journal logs to logentries.com
# get your private token from logentries.com, see https://logentries.com/doc/input-token
@mattieb
mattieb / playbook.yml
Created April 1, 2014 01:37
First attempt to provision and configure a droplet with Ansible
# First attempt to provision and configure a Digital Ocean droplet
# using Ansible.
#
# After you run this the first time, you have to fill in the droplet
# id it prints into the id= parameter of the digital_ocean task. From
# there on out it's idempotent.
- hosts: 127.0.0.1
connection: local
gather_facts: False
@snipe
snipe / inputrc
Created April 17, 2013 16:44
~/.inputrc for nice bash history up-arrows. This allows you to search through your history using the up and down arrows … i.e. type "cd /" and press the up arrow and you'll search through everything in your history that starts with "cd /". Create ~/.inputrc and fill it with this:
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
@swinton
swinton / upstart_virtualenv_test.conf
Created March 5, 2012 15:44
Example of an upstart job running a python script under a virtualenv
########################################
##### upstart_virtualenv_test.conf #####
##### install in /etc/init #####
########################################
description "Testing virtualenv and upstart setup"
env PYTHON_HOME=/home/steve/.virtualenvs/upstart-test
start on runlevel [2345]