Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nshalman
nshalman / fix-typo.patch
Last active August 29, 2015 14:19
typo in git-pbchk(1)
From 491936b61152d4b0fd28e91c5601f7a9f240fa1f Mon Sep 17 00:00:00 2001
From: Nahum Shalman <nshalman-github@elys.com>
Date: Thu, 23 Apr 2015 16:56:18 +0000
Subject: [PATCH] 5864 typo in git-pbchk(1) Reviewed by: Richard Lowe
<richlowe@richlowe.net> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
---
usr/src/tools/scripts/git-pbchk.1 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
@nshalman
nshalman / server.js
Created July 24, 2014 18:50
ZFS snapshot API
#!/usr/bin/env node
var parent_fs = "zones/snapapi/data"
var restify = require('restify');
var cp = require('child_process');
function snapshots(req, res, next) {
cp.exec("zfs list -Ho name -t snapshot -s creation -r " + parent_fs, function(err, stdout, stderr){
res.send(stdout.trim().split('\n').map(function(x){return x.split('@')[1]}));
@nshalman
nshalman / hgrep.c
Last active August 29, 2015 14:01
grep that preserves the header line
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
@nshalman
nshalman / README
Last active June 6, 2023 17:43 — forked from jperkin/README
Testing the lx brand on SmartOS
Grab /jperkin/public/lx/lenny.tar.gz from Manta
$ echo "10.0.0.0 255.255.255.0" >>/etc/netmasks
$ zoneadm -z lenny install -d /path/to/lenny.tar.gz
$ zlogin -C lenny
@nshalman
nshalman / ghost-privaddr.xml
Created November 21, 2013 02:56
Example SMF manifest for ghost that would allow the ghost user to listen on a privileged port
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Created by Manifold
-->
<service_bundle type="manifest" name="ghost">
<service name="site/ghost" type="service" version="1">
<create_default_instance enabled="false"/>
<single_instance/>
<dependency name="network" grouping="require_all" restart_on="error" type="service">
@nshalman
nshalman / explorer.js
Last active December 24, 2015 16:19
Manta Explorer
#!/usr/bin/env node
var restify = require('restify');
var path = require('path');
var fs = require('fs');
var assert = require('assert');
var manta = require('manta');
var client = manta.createClient({
sign: manta.privateKeySigner({