Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jonyesno on github.
  • I am zomo (https://keybase.io/zomo) on keybase.
  • I have a public key ASB2G8Wn-n4x9PVUkyE7fjYfaefDd_-Oeep0rRVG0rjoDwo

To claim this, I am signing this object:

@jonyesno
jonyesno / puppetmaster-rc.d.patch
Created November 29, 2014 07:40
FreeBSD puppetmaster rc.d fix
--- /home/lemon/tmp/puppetmaster 2014-11-29 07:33:00.105610545 +0000
+++ /usr/local/etc/rc.d/puppetmaster 2014-11-29 07:33:44.000000000 +0000
@@ -28,13 +28,13 @@
unset puppetmaster_flags
pidfile="${puppetmaster_rundir}/master.pid"
-puppet_manifestdir="$($command config print manifestdir)"
+puppet_manifest="$($command config print manifest)"
start_precmd="puppetmaster_checkconfig"
@jonyesno
jonyesno / fixedfixer
Created November 13, 2014 03:38
Javascript bookmark to unfix headers page elements that resist scrolling
// from https://news.ycombinator.com/item?id=8554132
javascript:(function()%20{%20var%20s,e,i,ee=document.getElementsByTagName('*');%20for(i=0;%20e=ee[i];%20i++)%20{%20s=getComputedStyle(e);%20if%20(s%20&&%20s.position%20==%20'fixed')%20e.style.position='static';%20}%20})();
@jonyesno
jonyesno / keybase.md
Created March 13, 2014 01:49
Keybase verify wah wah

Keybase proof

I hereby claim:

  • I am zomo on github.
  • I am zomo (https://keybase.io/zomo) on keybase.
  • I have a public key whose fingerprint is 27A9 1057 DCC8 8FB7 BE78 9537 54CF 4162 57E8 4312

To claim this, I am signing this object:

@jonyesno
jonyesno / gist:6788381
Created October 2, 2013 02:41
login_duo on SmartOS
# install a build zone
# 9eac5c0c-a941-11e2-a7dc-57a6b041988f base64 13.1.0 smartos 2013-04-26T15:17:57Z
[root@hxd11 ~]# vmadm create -f smartos.json
[root@hxd11 ~]# I=...
[root@hxd11 ~]# zlogin ${I}
# Prereqs
[root@smartos ~]# pkgin install gcc47 openssl libpam zlib
@jonyesno
jonyesno / utils.py.patch
Created September 27, 2013 02:52
Cobbler's linkfile uses various device-based checks that fail inside LXC. This patch disables them.
--- /usr/lib/python2.6/site-packages/cobbler/utils.py- 2013-06-20 01:42:48.000000000 -0400
+++ /usr/lib/python2.6/site-packages/cobbler/utils.py 2013-09-26 22:51:42.000000000 -0400
@@ -1168,13 +1168,15 @@
# arg
raise "Internal error: API handle is required"
- is_remote = is_remote_file(src)
+ logger.info('skipping is_remote_file, is_safe_to_hardlink checks')
+ is_remote = False
+ # is_remote = is_remote_file(src)
@jonyesno
jonyesno / gist:5071720
Last active December 14, 2015 10:19
Extracting voicememo name and file location from iTunes
$ cp ~/Music/iTunes/iTunes\ Music\ Library.xml ~/itunes.xml
$ xml select --template \
--elem voicememos \
--match "//dict[string='Voice Memo']" \
--elem voicememo \
--elem name \
--copy-of "key[text()='Name']/following-sibling::string[1]/text()" \
--break \
--elem location \
@jonyesno
jonyesno / doober.rb
Created June 6, 2012 02:25
Convert pwman XML to KeePassX XML
#!/usr/bin/env ruby
require 'nokogiri'
require 'pp'
xin = Nokogiri::XML(STDIN)
xout = Nokogiri::XML::Builder.new do |x|
x.database {
xin.css('PwList').each do |list|
group = list['name']
@jonyesno
jonyesno / djbdns-osx-dscl.sh
Created April 23, 2012 03:41
runit/dnscache setup for OS X
#!/bin/sh
# taken from http://qmail.jms1.net/djbdns/osx.shtml
# find appropriate uid/gids by $ dscl . -list /Users UniqueID | sort -n -k2
# if you are working with a directory services path other than the
# local machine, put the correct path here.
DSPATH="."
# if you need different numeric UID/GID values, set them here
@jonyesno
jonyesno / wpmu-loop.php
Created January 29, 2012 23:04
Loop over WordPress MU (aka Network) sites, calling a script on each via HTTP
<?php
/* example use: http://example.com/wpmu-loop.php?script=wp-fixup-tags.php */
/* see also: https://gist.github.com/1645313 */
define('WP_INSTALLING', true);
require_once('wp-load.php');
/* get_blogs() only knows about sub-domain blogs, not sub-directory blogs
it's probably just a case of appending the path column to the result */