Skip to content

Instantly share code, notes, and snippets.

@jperkin
jperkin / gist:2377900
Created April 13, 2012 15:56
dsadm EPIPE
# uname -a
SunOS 08-00-27-2e-42-5d 5.11 joyent_20120405T204624Z i86pc i386 i86pc
# dsadm avail | head
UUID OS PUBLISHED URN
b2845b76-80c5-11e1-9d72-5b4ca4191e12 smartos 2012-04-07 sdc:sdc:smartosplus64:3.2.0
c36a3d28-80c2-11e1-9ec6-df5bd8b43f76 smartos 2012-04-07 sdc:sdc:smartosplus:3.2.0
ce610cc2-80ac-11e1-8626-d788d6268d5b smartos 2012-04-07 sdc:sdc:smartos64:1.6.2
a93fda38-80aa-11e1-b8c1-8b1f33cd9007 smartos 2012-04-07 sdc:sdc:smartos:1.6.2
e4cd7b9e-4330-11e1-81cf-3bb50a972bda linux 2012-04-04 sdc:jpc:centos-6:1.0.1
@jperkin
jperkin / multiline.diff
Created May 24, 2012 09:59
Fix for irssi XMPP multi-line paste (/set paste_send_multiline on)
--- irssi-0.8.15/src/fe-text/gui-readline.c 2010-04-03 17:19:42.000000000 +0100
+++ irssi-0.8.15/src/fe-text/gui-readline.c 2012-05-24 10:25:04.000000000 +0100
@@ -64,6 +64,7 @@
static char *paste_old_prompt;
static int paste_prompt, paste_line_count;
static int paste_join_multiline;
+static int paste_send_multiline;
static int paste_timeout_id;
static void sig_input(void);
@jperkin
jperkin / gist:2894688
Created June 8, 2012 09:26
list of packages required for pbulk on SmartOS
[root@pkgsrc-bulk-clean /opt/pkgsrc/pkgtools/pbulk]# /opt/pbulk/sbin/pkg_info
libffi-3.0.9nb1 Foreign function interface
python27-2.7.3 Interpreted, interactive, object-oriented programming language
tiff-4.0.1nb1 Library and tools for reading and writing TIFF data files
db4-4.8.30 Berkeley DB version 4 from Oracle
libXau-1.0.7 Authorization Protocol for X from X.org
libXaw-1.0.11 X Athena Widgets Library from modular Xorg X11
libiconv-1.14nb2 Character set conversion library
pkg_install-20120221 Package management and administration tools for pkgsrc
jasper-1.900.1nb6 Software-based reference implementation of the JPEG-2000 codec
Why is git treating these two files differently, and why is the status
changing in between 'status' and 'commit'? I want to ensure that the
history of gcc47/buildlink3.mk is preserved.
Irrelevant lines have been omitted.
$ git status
# Changes to be committed:
# renamed: gcc47/buildlink3.mk -> gcc47-compiler/buildlink3.mk
# renamed: gcc47/Makefile -> gcc47/Makefile.common
@jperkin
jperkin / gist:3170015
Created July 24, 2012 13:54
ksh93 oddity
Why does ksh93 behave differently to every other bourne-derived shell (and ksh88)?
Turning braceexpand off makes no difference.
# Solaris 9 bourne shell
$ sh -c 'set -- "foo={one,two}"; echo $1'
foo={one,two}
# dash from Ubuntu
$ dash -c 'set -- "foo={one,two}"; echo $1'
@jperkin
jperkin / gist:3436515
Created August 23, 2012 13:18
Upgrade SmartOS pkgsrc
From 2012Q1 to 2012Q2, assuming 32-bit dataset (i386)
# Update repositories.conf for pkgin, and set $PKG_PATH for pkg_add
REPO=http://pkgsrc.joyent.com/sdc6/2012Q2/i386/All
echo ${REPO} >/opt/local/etc/pkgin/repositories.conf
export PKG_PATH=${REPO}
# Update core packages manually
pkg_add -u bootstrap-mk-files bmake
@jperkin
jperkin / gist:3736970
Created September 17, 2012 12:16
If the git authors designed ping...
UPDATE: Solved, looks like a bug in the version of 'git' distributed with OSX Lion.
# OSX Lion version exhibits the problem
$ /usr/bin/git version
git version 1.7.7.5 (Apple Git-26)
# pkgsrc version does not
$ /usr/pkg/bin/git version
git version 1.7.10.5
@jperkin
jperkin / gist:3776050
Created September 24, 2012 13:50
Solve jsonn/pkgsrc.git breakage

The problem

jsonn/pkgsrc.git, our upstream repository, has been corrupted due to the cvs conversion from cvs.netbsd.org going awry with 'cvs admin -m' usage.

The issue is manifest when trying to merge:

$ git remote -v
origin  git@github.com:joyent/pkgsrc.git (fetch)
origin  git@github.com:joyent/pkgsrc.git (push)
@jperkin
jperkin / gist:3812675
Created October 1, 2012 15:59
git branching plan
--A-------B-------C--D------------E------F--- origin/trunk
/ / / /
--------------------------------------------- upstream/trunk
\ \
-- upstream/pkgsrc_2012Q2 -- upstream/pkgsrc_2012Q3
- upstream/trunk is clean pkgsrc HEAD
- origin/trunk tracks upstream/trunk periodically, and adds Joyent-specific changes
- pkgsrc gets branched every quarter
@jperkin
jperkin / gist:3947355
Created October 24, 2012 17:05
vm spec
{
"brand": "joyent",
"zfs_io_priority": 30,
"image_uuid": "55330ab4-066f-11e2-bd0f-434f2462fada",
"max_physical_memory": 256,
"nics": [
{
"nic_tag": "admin",
"ip": "192.168.1.12",
"gateway": "192.168.1.1"