Skip to content

Instantly share code, notes, and snippets.

View jclulow's full-sized avatar
🌃
Cats & kittens grab your mittens; taking you through the night & into the mystic

Joshua M. Clulow jclulow

🌃
Cats & kittens grab your mittens; taking you through the night & into the mystic
View GitHub Profile
@jclulow
jclulow / Makefile
Created August 25, 2012 06:23
headers hooray
CC = gcc
xx: sigh.o sigh.h a.c
$(CC) -o xx sigh.o a.c
sigh.o: sigh.c
$(CC) -c -o sigh.o sigh.c
@jclulow
jclulow / ldap.xml
Created July 17, 2012 07:47
smartos ldap client
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="network-ldap-client" >
<service name="network/ldap/client" type="service" version="1" >
<create_default_instance enabled="true" />
<dependency name="dep0" grouping="require_all" restart_on="none" type="service" >
<service_fmri value="svc:/system/filesystem/minimal" />
</dependency>
<dependency name="dep1" grouping="require_all" restart_on="none" type="service" >
<service_fmri value="svc:/network/initial" />
@jclulow
jclulow / smfgen.diff
Created July 4, 2012 01:18
user/group/privs for smfgen
diff --git a/smfgen b/smfgen
index 20560e8..ac47cdf 100755
--- a/smfgen
+++ b/smfgen
@@ -23,7 +23,7 @@ var header_comment = [
* identifier (FMRI) will be constructed from the category
* and identifier.
*
- * [category] Service category (default: "application").
+ * [category] Service category (default: "site").
@jclulow
jclulow / pam.conf.4.diff
Created June 30, 2012 02:30
illumos pam.d
--- old_man Sat Jun 30 12:29:25 2012
+++ new_man_1 Sat Jun 30 12:29:15 2012
@@ -1,416 +1,433 @@
File Formats PAM.CONF(4)
@jclulow
jclulow / cr_notify.js
Created June 22, 2012 02:02
webrev rss bits
#!/usr/bin/env node
var restify = require('restify');
var pg = require('pg');
var log = console.log;
var C = require('/etc/opt/cr_rss.json');
Object.keys(C).forEach(function(k) {
pg.defaults[k] = C[k];
});
@jclulow
jclulow / Makefile
Created June 14, 2012 10:47
OpenSSL Hashdir Populator
.KEEP_STATE:
CC = /opt/gcc/4.4.4/bin/gcc
CFLAGS = -DDEBUG -Wall -Wextra -g
SRCFILES = certsdir.c utils.c scf.c
PROG = certsdir
OBJS = $(SRCFILES:%.c=%.o)
@jclulow
jclulow / aa_output.txt
Created June 13, 2012 02:55
git-outgoing v2
leftwing@onbld0 illumos-gate $ git outgoing -p gate/master -v
comparing with gate/master
searching for changes
commit: 45af0608fca3af691681276b34bac533d1867148
Author: Bryan Cantrill <bryan@joyent.com>
Date: Thu Mar 8 08:06:39 2012 +0000
description:
2574 mdb needs ::printf
@jclulow
jclulow / help_printf.txt
Created May 10, 2012 09:24
::help printf
leftwing@onbld0 illumos-gate $ proto/root_i386/usr/bin/mdb
> ::help printf
NAME
printf - print and format the member(s) of a data structure
SYNOPSIS
[ addr ] ::printf format type member ...
DESCRIPTION
@jclulow
jclulow / 00_info.md
Created May 5, 2012 23:46
SmartOS rc.local

So, to get something like /etc/rc.local you can use the custom SMF import facility. (See the source for more information about how this actually works.)

/opt is mounted out of zones/opt by default. You can create a directory /opt/custom/smf and populate it with SMF manifests. Any manifests you put in there will be imported by SmartOS when it boots. Below is an example SMF manifest that simply starts /opt/custom/bin/postboot, a self-explanatory shell script that you can use like /etc/rc.local.

Note that it would likely be better to customise and respin your own images, as putting a bunch of platform state in the zones pool undoes some of the benefits of the ramdisk platform architecture that SmartOS has.

@jclulow
jclulow / gist:2494575
Created April 25, 2012 23:56
bug in "df -h"
steps to reproduce:
1. make a cifs share on another host
2. mount it with smbfs
3. unshare the cifs share on that other host
4. df -h
problem:
dumps core with arithmetic exception here: