Skip to content

Instantly share code, notes, and snippets.

View kmullin's full-sized avatar

Kevin Mullin kmullin

View GitHub Profile
@kmullin
kmullin / keybase.md
Last active January 11, 2017 21:31
Keybase Github Proof

Keybase proof

I hereby claim:

  • I am kmullin on github.
  • I am kmullin (https://keybase.io/kmullin) on keybase.
  • I have a public key whose fingerprint is D5BE 6C6F 7DCA 6124 7545 FF75 77F3 D706 B394 1E45

To claim this, I am signing this object:

# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done
@kmullin
kmullin / read_metadata.sh
Last active August 29, 2015 14:04
Shairport Metadata JSON generator
#!/bin/bash
pipe=/home/shairport/metadata/now_playing
datafile=$pipe.json
stringify() {
a=${1%%=*}
b=${1##*=}
echo "\"$a\": \"$b\""
}
@kmullin
kmullin / OUTPUT
Last active August 29, 2015 13:57
Puppet Weirdness
$ sudo bash puppet.sh
Info: Loading facts in /puppet/modules/puppetlabs-stdlib/lib/facter/facter_dot_d.rb
Info: Loading facts in /puppet/modules/puppetlabs-stdlib/lib/facter/pe_version.rb
Info: Loading facts in /puppet/modules/puppetlabs-stdlib/lib/facter/puppet_vardir.rb
Info: Loading facts in /puppet/modules/puppetlabs-stdlib/lib/facter/root_home.rb
Debug: hiera(): Hiera YAML backend starting
Debug: hiera(): Looking up number in YAML backend
Debug: hiera(): Looking for data source default
Debug: hiera(): Found number in default
@kmullin
kmullin / README.md
Last active January 4, 2016 01:49
FreeDOS BIOS Flasher / Util bootdisk

Create a FreeDOS BIOS Flash bootdisk

General Info

Those BIOS images not fitting onto 1.44MB floppy anymore?

Did you need to use some other utilities in a minimal DOS environment?

In order to boot a system into DOS and have an emulated CDROM drive with the extra utilities, we need to first create a boot floppy

@kmullin
kmullin / streamtop.rb
Created January 8, 2014 04:22
streamtop.rb a quick (poorly written) ruby hi_scores list for checking http log files to quickly find trends
#!/usr/bin/env ruby
require 'optparse'
$ctable = Hash.new(0) # table of string => count
def clearTerm
print "\e[2J\e[f"
end
@kmullin
kmullin / get_nic_speeds.c
Last active September 12, 2019 15:23
determine speed of network interfaces in linux using ioctl, and getifaddrs(3) will detect bonding interfaces, and sum speeds of slave devices. purpose for writing was to use with puppet and external facts
/*
* most of the code shamelessly stolen from:
* http://stackoverflow.com/a/2876605
*
* more code stolen from getifaddrs(3) manpage
*
* output is: interface=speed
* written by Kevin Mullin 01/07/14
*
*/
@kmullin
kmullin / sphinx.rb
Last active March 8, 2016 19:14
sphinx.rb
require 'formula'
class Sphinx < Formula
url 'http://sphinxsearch.com/files/archive/sphinx-0.9.9.tar.gz'
homepage 'http://www.sphinxsearch.com'
md5 '7b9b618cb9b378f949bb1b91ddcc4f54'
depends_on 'mysql'
def install
@kmullin
kmullin / bootstrap_ruby.sh
Last active December 19, 2015 13:19
script to install ruby from source curl -s https://gist.github.com/kmullin/5961565/raw/bootstrap_ruby.sh | bash -x
#!/bin/bash
RUBY_URL=${RUBY_URL:-"ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.gz"}
RUBY_MD5=${RUBY_MD5:-"993c72f7f805a9eb453f90b0b7fe0d2b"}
LIBYAML_URL=${LIBYAML_URL:-"http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"}
LIBYAML_MD5=${LIBYAML_MD5:-"36c852831d02cf90508c29852361d01b"}
get_source() {
# 1: url
@kmullin
kmullin / flac_to_alac.sh
Created June 17, 2013 18:22
flac to apple lossless
#!/bin/sh
for i in *.flac; do
ffmpeg -i "$i" -acodec alac "${i%.flac}.m4a"
done