Skip to content

Instantly share code, notes, and snippets.

View mattconnolly's full-sized avatar

Matt Connolly mattconnolly

View GitHub Profile
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)
@mattconnolly
mattconnolly / gist:5023574
Created February 24, 2013 12:03
Trying to install ruby-2.0.0 with rvm on OpenIndiana
matt@vault:~$ ac_cv_func_dl_iterate_phdr=no rvm install ruby-2.0.0 --trace
ruby-2.0.0 --trace
rvm 1.18.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
+ 1361707359.143632375 /scripts/cli : __rvm_parse_args() 725 > [[ -n '' ]]
+ 1361707359.147223303 /scripts/cli : __rvm_parse_args() 727 > set -o errtrace
+ 1361707359.150826442 /scripts/cli : __rvm_parse_args() 728 > export 'PS4=+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ 1361707359.154520553 /scripts/cli : __rvm_parse_args() 728 > PS4='+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ 1361707359.158231865 /scripts/cli : __rvm_parse_args() 760 > [[ -z install ]]
diff --git a/distrib/initscripts/Makefile.am b/distrib/initscripts/Makefile.am
index 5bdf951..bee3677 100644
--- a/distrib/initscripts/Makefile.am
+++ b/distrib/initscripts/Makefile.am
@@ -140,7 +140,7 @@ endif
if USE_SOLARIS
-servicedir = /lib/svc/manifest/network/
+servicedir = /var/svc/manifest/network/
@mattconnolly
mattconnolly / netatalk 3.0.3 build output
Created March 26, 2013 11:22
Configure and make output for netatalk 3.0.3 on SmartOS
matt@vault:~/netatalk/netatalk-3.0.3$ ./configure --with-bdb=/opt/local --with-init-style=solaris --with-init-dir=/var/svc/manifest/network/ --prefix=/opt/local
checking build system type... x86_64-pc-solaris2.11
checking host system type... x86_64-pc-solaris2.11
checking target system type... x86_64-pc-solaris2.11
checking for a BSD-compatible install... /opt/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes