Skip to content

Instantly share code, notes, and snippets.

Brian Bennett bahamat

Block or report user

Report or block bahamat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 0001-illumos-11894-zonecfg-export-should-quote-strings.patch
From 3cf036c03c6a9885353ad0d35edd5b6be7f6dcd2 Mon Sep 17 00:00:00 2001
From: Brian Bennett <brian.bennett@joyent.com>
Date: Tue, 29 Oct 2019 17:16:05 -0700
Subject: [PATCH] illumos#11894 zonecfg export should quote strings
---
usr/src/cmd/zonecfg/zonecfg.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/usr/src/cmd/zonecfg/zonecfg.c b/usr/src/cmd/zonecfg/zonecfg.c
@bahamat
bahamat / from_node-triton_cli.md
Created Oct 11, 2019
Example for setting up CLOUDAPI_SERVICES sapi metadata
View from_node-triton_cli.md
> triton -p west1 services
NAME    ENDPOINT
cmon    https://cmon.us-west-1.triton.zone:9163
docker  tcp://us-west-1.docker.joyent.com:2376
> triton -p west1 services -j
{"docker":"tcp://us-west-1.docker.joyent.com:2376","cmon":"https://cmon.us-west-1.triton.zone:9163"}
> triton -p west1 services -j | json
{
  "docker": "tcp://us-west-1.docker.joyent.com:2376",
@bahamat
bahamat / dnsupdate.py
Created Jul 27, 2019 — forked from pklaus/dnsupdate.py
dnsupdate is meant to replace nsupdate, the standard DDNS update tool created by BIND authors ISC. While nsupdate does the job it is awkward to wrap in scripts and its usage in general is just not very intuitive. dnsupdate is meant to work well from the command line or from scripts and easy to use. It also does some nice things like automaticall…
View dnsupdate.py
#!/usr/bin/env python2.7
# Matt's DNS management tool
# Manage DNS using DDNS features
#
# See http://planetfoo.org/blog/archive/2012/01/24/a-better-nsupdate/
#
# Usage: dnsupdate -s server -k key -t ttl add _minecraft._tcp.mc.example.com SRV 0 0 25566 mc.example.com.
# -h HELP!
# -s the server
# -k the key
@bahamat
bahamat / triton-grafana.json
Created Jul 16, 2019
Grafana dashboard template for Triton
View triton-grafana.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@bahamat
bahamat / gist:c89147d594ad7382fbdeef7c85cb5a7d
Last active Mar 17, 2019
zfs compressed data counts less against the quota.
View gist:c89147d594ad7382fbdeef7c85cb5a7d
[root@smartos-iso /zones/compquota]# zfs get compression,used,quota,avail zones/compquota
NAME PROPERTY VALUE SOURCE
zones/compquota compression on inherited from zones
zones/compquota used 23K -
zones/compquota quota 10M local
zones/compquota available 9.98M -
[root@smartos-iso /zones/compquota]# ls -lh
total 1
-rw-r--r-- 1 root root 500M Mar 17 21:33 zero
View gist:a8b5aac79ba707c8a4f53b08f52d236f
NAME STATE READ WRITE CKSUM
zones ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c10t01d0 ONLINE 0 0 0
c11t01d0 ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
c1t05d0 ONLINE 0 0 0
c2t0Dd0 ONLINE 0 0 0
mirror-2 ONLINE 0 0 0
c3t09d0 ONLINE 0 0 0
@bahamat
bahamat / auto_homedir
Created Nov 17, 2018
auto_homedir for use with illumos autofs to create user home directories on first access
View auto_homedir
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright 2018 Brian Bennett <brian.bennett@joyent.com>
# Inspired by
# http://znogger.blogspot.com/2010/05/solaris-automatic-creation-of-home-dirs.html
@bahamat
bahamat / flask_example.md
Created Jul 25, 2017
Simple flask example.
View flask_example.md
@bahamat
bahamat / manta-pipasswd
Last active Jun 14, 2018
Get the default root password for platform images installed in Triton (manta-pipasswd, triton-pipasswd, pipasswd)
View manta-pipasswd
#!/bin/bash
# This will retrieve the default root password for platform images stored in Joyent's Manta service.
# Run this from your workstation.
# This only makes sense in the context of Joyent's cloud, because that's where the
# build artifacts are.
export MANTA_URL=https://us-east.manta.joyent.com/
if [[ -n "$TRACE" ]]; then
@bahamat
bahamat / pkgsrc-brew.md
Created May 22, 2017
Packages I get from brew instead of pkgsrc, and why
View pkgsrc-brew.md
pkg why
dnstracer not available
fortune not available
ghc not available on mac
hping out of date (pkgsrc==hping2, brew==hping3)
nagios-plugins does not compile on mac. Maybe brew patch(es) can be used?
shunit2 not available
tcpflow out of date (pkgrsc==0.21, brew==1.4); depends on dfxml which does not compile on smartos due to missing MAP_FILE ([tcpflow#91)[https://github.com/simsong/tcpflow/issues/91])
You can’t perform that action at this time.