Skip to content

Instantly share code, notes, and snippets.

View hunner's full-sized avatar

Hunter Haugen hunner

View GitHub Profile
#!/usr/bin/env python
"""
Last.fm scrobbling for Pianobar, the command-line Pandora client. Requires Pianobar, Python, pyLast and Last.fm API credentials.
https://github.com/PromyLOPh/pianobar/
http://code.google.com/p/pylast/
http://www.last.fm/api/account
Installation:
1) Copy this script and pylast.py to the Pianobar config directory, ~/.config/pianobar/, and make sure this script is executable
@hunner
hunner / connect.c
Created May 23, 2012 11:18 — forked from shwangdev/connect.c
connect.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <memory.h>
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
#include <stdarg.h>
#include <fcntl.h>
Facter.add("dbservers") do
setcode do
hosts = nil
if File.exists?('/etc/bookings/db.conf')
hosts = File.readlines('/etc/bookings/db.conf').collect do |line|
next if ! line.match(/dbi:mysql:/)
match = line.match(/host=([^;]+);/)
match[1] if match
end.compact.join(',')
end
applications:
app::core::instance:
'01':
index: '01'
'02':
index: '02'
@hunner
hunner / gist:3342358
Created August 13, 2012 16:29 — forked from bwhaley/gist:3318910
post-receive hook for updating git repos on multiple puppet masters
#!/bin/sh
set -e
git-update-server-info
#
# Hook to update the /etc/puppetlabs/puppet with the lastest git changes
#
# To enable this hook, rename this file to "post-receive".
syncuser="puppetsync"