Skip to content

Instantly share code, notes, and snippets.

@tylerflint
tylerflint / gist:601a88756ab468fc5ce7
Last active August 29, 2015 14:13
SmartOS cleanup crufty zone datasets
#!/usr/bin/env bash
zfs_uuids=$(zfs list | /usr/xpg4/bin/grep -E -e 'zones/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$' | awk '{ print $1 }' | awk -F/ '{ print $2 }')
vmadm_uuids=$(vmadm list | tail -n +2 | awk '{ print $1 }')
imgadm_uuids=$(ls -1 /var/imgadm/images | sed 's/zones-//' | sed 's/\.json//')
symmetric_uuids=$(comm -3 <(echo "$zfs_uuids" | sort -) <(echo "$vmadm_uuids" | sort -))
symmetric_uuids=$(comm -3 <(echo "$symmetric_uuids" | sort -) <(echo "$imgadm_uuids" | sort -))
for uuid in $symmetric_uuids
do
@tylerflint
tylerflint / cache.txt
Last active August 29, 2015 14:12
smartos zone create bottleneck
key min .-------------------. max | count
ps 262144 : █ : 68719476736 | 1
mktemp 262144 : ▂▆ ▁ : 68719476736 | 20
autopush 262144 : ▁▇▂ : 68719476736 | 20
isainfo 262144 : ▂▅▂▂ : 68719476736 | 20
m4 262144 : ▁▆▂▁▁ : 68719476736 | 20
hostname 262144 : ▂▆▁▁ : 68719476736 | 40
soconfig 262144 : ▃▅▂▁ : 68719476736 | 20
logger 262144 : ▅▃ ▂▁ : 68719476736 | 20
expr 262144 : ▂▆▂ ▁ : 68719476736 | 40
@tylerflint
tylerflint / workflow.md
Last active January 12, 2019 06:56
smartos-live src development workflow

Workflow

This workflow was designed specifically to aid in development and testing the components within smartos-live/src. SmartOS is designed to be a read-only operating system that is loaded onto a ramdisk during boot. While this design is very helpful in a datacenter, it is not well suited for local incremental development. This workflow will temporarily alter the behavior of SmartOS to allow a quick and iterative workflow for development.

Goals

The goals of this workflow are to allow the following:

  1. Development occurs directly on the developers workstation, in his or her native editor and toolchain.
  2. All sources within the smartos-live/src directory are compiled when changed, including c files.
@tylerflint
tylerflint / nanobox-expectation-values.md
Last active August 25, 2017 19:21
Nanobox dev expectations and values

You are an artisan, not an engineer

An engineer makes something work. You are more than that, you are an artisan. Artisans practice a craft and may through experience and aptitude reach the expressive levels of an artist.

Approach your work as a master craftsman.

Style matters

Just because we're building infrastructure and tools doesn't mean it can't be cool, stylish, and fun. Aesthetic matters. See The Substance of Style

@tylerflint
tylerflint / pagodabox-expectation-values.mk
Created August 25, 2014 17:09
Pagoda Box artisan expectations and values
## You are an artisan, not an engineer
An engineer makes something work. You are more than that, you are an artisan. Artisans practice a craft and may through experience and aptitude reach the expressive levels of an artist.
Approach your work as a master craftsman.
Demand perfection of yourself.
## Style matters
@tylerflint
tylerflint / gist:3116831e7ba627401e73
Last active August 29, 2015 14:03
example output
PREPARING DEPLOY
______________________________________________________________
NAME :: devo
KIND :: Tinker App
URL :: devo.pagodabox.com
Your Deploy has been received and will begin shortly.
-> Boxfile.install was merged into Boxfile
@tylerflint
tylerflint / myapp.conf
Created March 21, 2014 15:10
sample cuttlefish config file with hanoidb snippet
## hanoidb database directory
hanoidb.db_path = ./data/hanoidb
## Enable/disable on-disk compression.
hanoidb.compress = none
## Expire (automatically delete) entries after N seconds.
## When this value is 0 (zero), entries never expire.
hanoidb.expiry_secs = 0
@tylerflint
tylerflint / macro.ex
Last active August 29, 2015 13:57
playing around with elixir macros
#!/usr/bin/env elixir
defmodule Dsl do
defmacro __using__(_opts) do
quote do
import Dsl
@before_compile Dsl
@list Keyword.new
@tylerflint
tylerflint / hypervisor-alert.json
Last active August 29, 2015 13:57
skynet payloads
{
"type": "alert",
"scope": "hypervisor",
"time": 1395205200000,
"tags": {
"hostname": "hypervisor1",
"organization": "53287e364feb6379d500000b"
},
"alert": "something bad happened"
}
@tylerflint
tylerflint / hanoidb.schema
Last active August 29, 2015 13:57
hanoidb cuttlefish schema
%% -*- mode: erlang; tab-width: 4; indent-tabs-mode: 1; st-rulers: [70] -*-
%% vim: ts=4 sw=4 ft=erlang noet
%%%===================================================================
%%% hanoidb
%%%===================================================================
%% @doc hanoidb database directory
{mapping, "hanoidb.db_path", "hanoidb.data_root", [
{datatype, string},