Skip to content

Instantly share code, notes, and snippets.

View phrawzty's full-sized avatar
🕺
probably karaoke

Daniel Maher phrawzty

🕺
probably karaoke
View GitHub Profile
@phrawzty
phrawzty / gist:8832281
Last active August 29, 2015 13:56
still EOF :(
$ md5 boot2docker.iso
MD5 (boot2docker.iso) = e58b30593a2db15afc98f9a12293567d
$ md5 boot2docker
MD5 (boot2docker) = a73b6e6dec322393983ed34f640c31e5
$ ./docker version
Client version: 0.8.0
Go version (client): go1.2
Git commit (client): cc3a8c8
@phrawzty
phrawzty / def_pushbot.pp
Created June 7, 2013 14:36
pushbot puppet stuff. WARNING: This is totally off the top of my dome. Has not been tested, nor placed anywhere near a parser. :)
define pushbot (
$irc_channel,
$pubsub,
$log_url,
$rev_url,
$repo_url,
$site_name,
$order = 500,
$redis_port = '9388',
$redis_host = 'localhost'
class desktop_disk_encrypter (
$dde_site_url,
$dde_db_name,
$dde_db_user,
$dde_db_pass,
$dde_secret,
$dde_binduser,
$dde_bindpass,
$gpg_key_ids,
$gpg_pubring,
@phrawzty
phrawzty / init.pp
Created April 27, 2012 12:33
Ersatz puppet module for dealing with node.js
class nodejs {
$packages = [ 'nodejs', 'nodejs-dev' ]
package { $packages:
ensure => present
}
exec { 'install_npm':
command => '/usr/bin/curl http://npmjs.org/install.sh | sh',
creates => '/usr/bin/npm'
@phrawzty
phrawzty / dilly.rb
Created February 15, 2012 15:52
Puppet plugin in the style of extlookup or yamlvar, but with precedence-based merging of results.
# USAGE: $variable = dilly(key, [order])
# Where order is an optional array of the order of precedence of the YAML files.
# If array $dillyorder exists in the scope, that will work too.
# Passing 'nodefault' in the order array will prevent default.yaml from being considered.
module Puppet::Parser::Functions
require 'yaml'
require 'deep_merge'
newfunction(:dilly, :type => :rvalue) do |args|
@phrawzty
phrawzty / genshadow.sh
Created January 24, 2012 15:35
Scipt to generate SHA-512 password fields suitable for /etc/shadow. Requires a relatively recent version of mkpasswd.
#!/bin/bash
if [ "x$1" == 'x' ]; then
echo "USAGE: $0 '<password>'"
exit 1
fi
# Get an md5sum of the string for eventual extraction.
md5=$( echo $1 | md5sum )
extract="${md5:2:8}"
@phrawzty
phrawzty / key.pp
Created January 24, 2012 14:10
APT hooks for Puppet
# Shamelessly based on https://gist.github.com/844735
define apt::key (
$keyserv,
$ensure = present
) {
$grep_for_key = "apt-key finger | grep fingerprint | awk '{print \$10 \$11 \$12 \$13}' | grep '${name}'"
case $ensure {
present: {
@phrawzty
phrawzty / gist:1590203
Created January 10, 2012 17:47
GNU sort on Debian vs CentOS
$ cat sortme
1234
abcd
ABCD
***
:::
debian$ cat sortme | sort
:::
@phrawzty
phrawzty / pv.sh
Created September 8, 2011 14:03
Quick bash script to validate puppet manifests before committing them. Uses the puppet parser and the puppet-lint gem to do the actual validation. Uses rvm because that's what's sane. :P
#!/bin/bash
OLD=`rvm current`
source "$HOME/.rvm/scripts/rvm"
rvm use 1.8.7
gem list --local
puppet parser validate $1
puppet-lint $1
rvm use $OLD
@phrawzty
phrawzty / Questions
Created September 7, 2011 13:46
GOTO Amsterdam
Day job: System Administration (with Devops tendencies).
What is your language of choice: Ruby (recently), Perl (traditionally).
Open Source contributions: Lots of little scripts, plugins, and so forth over the years.
How do you use GitHub: Handy way to maintain and distribute my modest contributions to the OSS community.