Skip to content

Instantly share code, notes, and snippets.

View stephenrjohnson's full-sized avatar

Stephen Johnson stephenrjohnson

View GitHub Profile
module Puppet::Parser::Functions
newfunction(:type, :type => :rvalue, :doc => "Return the type requested when given the certname") do |arguments|
if (arguments.size != 2) then
raise(Puppet::ParseError, "type(): Wrong number of arguments "+
"given #{arguments.size} for 2 argument required")
end
certname = arguments[0]
type = arguments[1]
rx = /([a-z]{2}[a-z0-9][a-z]?)[0-9]{2}\.([a-z])([a-z])\.([a-z]{3}[a-z0-9][0-9])/
if match = rx.match(certname)
require 'serverspec'
require 'pathname'
require 'net/ssh'
include Serverspec::Helper::Ssh
include Serverspec::Helper::DetectOS
RSpec.configure do |c|
if ENV['ASK_SUDO_PASSWORD']
require 'highline/import'
require 'formula'
class Muttkg < Formula
homepage 'http://www.mutt.org/'
url 'https://github.com/karelzak/mutt-kz.git'
# sha1 ''
option "with-debug", "Build with debug option enabled"
option "with-notmuch", "Build with not much"
#!/usr/bin/python
import re, commands
def get_keychain_pass(account=None, server=None):
params = {
'security': '/usr/bin/security',
'command': 'find-internet-password',
'account': account,
'server': server
}
command = "%(security)s %(command)s -g -a %(account)s -s %(server)s" % params
@stephenrjohnson
stephenrjohnson / center-im.patch
Created November 29, 2012 14:34
centerim patch
--- ./libjabber/jconn.c.orig 2012-11-29 14:31:36.000000000 +0000
+++ ./libjabber/jconn.c 2012-11-29 14:32:16.000000000 +0000
@@ -824,7 +824,7 @@
free(hash);
close(sock);
close(fd_file);
- return;
+ return NULL;
}
@stephenrjohnson
stephenrjohnson / .bash_aliases
Created January 29, 2012 17:06
open sublime text with current dir
alias te='subl `pwd` -bn & disown $!'