Skip to content

Instantly share code, notes, and snippets.

Avatar

Nahum Shalman nshalman

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am nshalman on github.
  • I am nahamu (https://keybase.io/nahamu) on keybase.
  • I have a public key whose fingerprint is A20A EC40 115E 5201 91F9 893E 8FA5 71E5 06FD 2543

To claim this, I am signing this object:

@nshalman
nshalman / cerana-dev-node.json
Created Jul 1, 2016
Booting CeranaOS on SmartOS
View cerana-dev-node.json
{
"alias": "cerana-dev-node",
"autoboot": "false",
"brand": "kvm",
"ram": 3072,
"vcpus": 3,
"boot": "order=dc",
"disks": [
{
"path": "/cerana.iso",
@nshalman
nshalman / Netboot.md
Last active Apr 21, 2016
Netboot Installer Documentation
View Netboot.md

Installing NixOS using the "netboot" media

Advanced users may wish to install NixOS using an existing PXE or iPXE setup.

These instructions assume that you have an existing PXE or iPXE infrastructure and simply want to add the NixOS installer as another option. To build the necessary files from a recent version of nixpkgs, you can run:

nix-build -A netboot nixos/release.nix

This will create a result directory containing:

  • bzImage -- the Linux kernel
@nshalman
nshalman / Netboot.md
Created Apr 21, 2016
Netboot Installer Documentation
View Netboot.md

Installing NixOS using the "netboot" media

These instructions assume that you have an existing PXE or iPXE infrastructure and simply want to add the NixOS installer as another option.

  1. Obtain netboot media consisting of:
  • bzImage -- the Linux kernel
  • initrd -- the initrd file
  • netboot.ipxe -- an example ipxe script demonstrating the appropriate kernel command line arguments for this image
  1. Place the bzImage, initrd, and optionally, the netboot.ipxe script on your HTTP/TFTP server
  2. Rename and/or customize the netboot.ipxe script with any required paths before the file names
  3. If you are not using the included netboot.ipxe file, make sure that when booted the kernel will get the appropriate kernel command line arguments that are included in it.
@nshalman
nshalman / branch-patch.diff
Last active Apr 19, 2016
patching the kernel
View branch-patch.diff
diff --git a/nixos/modules/profiles/cerana.nix b/nixos/modules/profiles/cerana.nix
index 5b312e0..91fb7ea 100644
--- a/nixos/modules/profiles/cerana.nix
+++ b/nixos/modules/profiles/cerana.nix
@@ -21,4 +21,12 @@
# Configure host id for ZFS to work
networking.hostId = lib.mkDefault "8425e349";
+
+ nixpkgs.config.packageOverrides =
@nshalman
nshalman / mac_hardware_data.py
Last active Feb 19, 2016
Reading Mac hardware data into salt grains
View mac_hardware_data.py
import plistlib
import subprocess
import platform
def mac_hardware_data():
'''
Get some Mac specific grains
'''
profiler_cmd = 'system_profiler SPHardwareDataType -xml'
@nshalman
nshalman / fix-typo.patch
Last active Aug 29, 2015
typo in git-pbchk(1)
View fix-typo.patch
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 Jul 24, 2014
ZFS snapshot API
View server.js
#!/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 Aug 29, 2015
grep that preserves the header line
View hgrep.c
/*
* 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 Aug 29, 2015 — forked from jperkin/README
Testing the lx brand on SmartOS
View README
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