Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am trentm on github.
  • I am trentm (https://keybase.io/trentm) on keybase.
  • I have a public key whose fingerprint is 89FB E5A2 CF9E C32D 9D53 746C 3608 1DFD 9D74 41BA

To claim this, I am signing this object:

$ echo quote what? ; read quoteme ; printf %q "$quoteme" ; echo
quote what?
The horse said "$)#*@(!!%" when he stubbed his hoof.
The\ horse\ said\ \"\$\)#\*@\(\!\!%\"\ when\ he\ stubbed\ his\ hoof.
$
@trentm
trentm / hack.bash
Created November 6, 2014 18:45
Hack SmartDataCenter's CNAPI (historically this chunk of functionality was called DAPI) to allow "customer" provisioning (i.e. via cloudapi) on the headnode for dev/testing.
function hack_dapi_for_headnode_provisioning {
local cnapi_zone=\$(vmadm lookup -1 alias=cnapi0)
# TODO: don't change if already done
echo "# Hack DAPI to allow headnode provisioning"
local config_path=/zones/\$cnapi_zone/root/opt/smartdc/cnapi/sapi_manifests/cnapi/template
sed -e "
s:hard-filter-headnode:identity:g;
s:hard-filter-min-ram:identity:g;
s:hard-filter-min-disk:identity:g;
s:hard-filter-min-cpu:identity:g;
a: I have 1854430734d43a of smartos-live in the platform that I'm building for testing ... Do I need to update?
b: yes. That's ancient. :)
a: It's like 10 days old!
b: 10 whole days!!!
a: flip table
@trentm
trentm / magic.js
Created March 24, 2015 02:35
compressed file type detection using magic numbers. Wrote it. Don't need it right now.
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at http://smartos.org/CDDL
*
@trentm
trentm / Makefile.py
Created July 21, 2010 21:31
play boilerplate
#!python
#...
# Makefile
#...
print "hi there, tester"
@trentm
trentm / Makefile.py
Created July 27, 2010 06:22
Makefile.py: mk makefile boilerplate
# This is a Makefile for the `mk` tool. (Limited) details for that here:
# <http://github.com/activestate/mk>
import sys
import os
from os.path import join
import re
import mklib
from mklib.common import MkError
@trentm
trentm / {{module}}.py
Created July 28, 2010 03:54
python-module: Python module boilerplate
"""{{ docstring }}"""
import logging
{{ imports }}
#---- globals
log = logging.getLogger("{{ loggername }}")