Skip to content

Instantly share code, notes, and snippets.

View mattconnolly's full-sized avatar

Matt Connolly mattconnolly

View GitHub Profile
@mattconnolly
mattconnolly / svn_od.sh
Created June 1, 2011 01:00
use mac FileMerge (opendiff) to view differences to a file
#!/bin/bash
#
# use mac FileMerge (opendiff) to view differences to a file.
#
# usage: svn_od <filename>
#
# works with absolute and relative paths to files.
#
function svn_od {
DIR=`dirname "$1"`
@mattconnolly
mattconnolly / AppleVolumes.default
Created October 5, 2011 09:32
excerpt from my `AppleVolumes.default` netatalk config file.
# The line below sets some DEFAULT, starting with Netatalk 2.1.
:DEFAULT: options:upriv,usedots
# The "~" below indicates that Home directories are visible by default.
# If you do not wish to have people accessing their Home directories,
# please put a pound sign in front of the tilde or delete it.
~ cnidscheme:dbd options:usedots,invisibledots,upriv fperm:0660 dperm:0770
/MacBackup/Archives "Archives" cnidscheme:dbd options:usedots,invisibledots,upriv,tm fperm:0660 dperm:0770
/MacBackup/TimeMachine "TimeMachine" cnidscheme:dbd options:usedots,invisibledots,upriv,tm fperm:0660 dperm:0770
require 'rubygems'
#require 'bundler/setup'
GEMSET = 'rails_backup_migrate'
def rvm_do(version, command)
# using inspect to place command in quotes, and escape other quotes
script = "rvm #{version}@#{GEMSET} do #{command.inspect}"
puts "about to execute: #{script}"
`#{script}`
@mattconnolly
mattconnolly / gist:1369683
Created November 16, 2011 09:40
zpool status
root@vault:/# /sbin/zpool status
pool: rpool
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-2Q
scan: resilvered 1.41M in 0h0m with 0 errors on Tue Nov 15 05:31:36 2011
config:
@mattconnolly
mattconnolly / gist:1597508
Created January 11, 2012 23:43
Last `top` output before unresponsive system
load averages: 28.4, 11.5, 6.70; up 3+00:50:14 09:33:34
151 processes: 135 sleeping, 13 running, 3 on cpu
CPU states: 0.1% idle, 3.6% user, 96.3% kernel, 0.0% iowait, 0.0% swap
Kernel: 319 ctxsw, 15 trap, 517572 intr, 334874 syscall
Memory: 16G phys mem, 2054M free mem, 8054M total swap, 8054M free swap
PID USERNAME NLWP PRI NICE SIZE RES STATE TIME CPU COMMAND
1063 matt 8 59 0 1066M 1054M cpu/5 221:45 43.67% qemu-kvm-system
4557 matt 7 59 0 2094M 2082M cpu/2 1:09 7.50% qemu-kvm-system
1062 matt 8 59 0 1077M 1065M run 375:51 0.06% qemu-kvm-system
@mattconnolly
mattconnolly / gist:2409344
Created April 17, 2012 21:55
mysql2 on max os x lion extension makefile
SHELL = /bin/sh
# V=0 quiet, V=1 verbose. other values don't work.
V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
n=$(NULLCMD)
ECHO1 = $(V:1=@$n)
ECHO = $(ECHO1:0=@echo)
@mattconnolly
mattconnolly / openvpn.xml
Created April 25, 2012 00:35
OpenIndiana SMF manifest for running openvpn as a service
<?xml version="1.0" ?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="export">
<service name="network/openvpn" type="service" version="0">
<create_default_instance enabled="true"/>
<single_instance/>
<dependency name="fs" grouping="require_all" restart_on="none" type="service">
<service_fmri value="svc:/system/filesystem/local"/>
</dependency>
<dependency name="net" grouping="require_all" restart_on="none" type="service">
@mattconnolly
mattconnolly / usrlocalrvmlogreadlineautoreconf.log
Created October 23, 2012 11:43
rvm pkg readline: error message
autoheader: warning: missing template: CTYPE_NON_ASCII
autoheader: Use AC_DEFINE([CTYPE_NON_ASCII], [], [Description])
autoheader: warning: missing template: FIONREAD_IN_SYS_IOCTL
autoheader: warning: missing template: HAVE_BSD_SIGNALS
autoheader: warning: missing template: HAVE_GETPW_DECLS
autoheader: warning: missing template: HAVE_LANGINFO_CODESET
autoheader: warning: missing template: HAVE_MBRLEN
autoheader: warning: missing template: HAVE_MBSCMP
autoheader: warning: missing template: HAVE_MBSNRTOWCS
autoheader: warning: missing template: HAVE_MBSRTOWCS
@mattconnolly
mattconnolly / rvm-smartos.patch
Created November 18, 2012 08:45
A patch for building ruby 1.9.3 in SmartOS / OpenIndiana
diff --git a/siphash.c b/siphash.c
index c100b14..589cdec 100644
--- a/siphash.c
+++ b/siphash.c
@@ -8,7 +8,11 @@
#ifdef _WIN32
#define BYTE_ORDER __LITTLE_ENDIAN
#elif !defined BYTE_ORDER
- #include <endian.h>
+ #if defined(sun)