Skip to content

Instantly share code, notes, and snippets.

Trent Mick trentm

Block or report user

Report or block trentm

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
updates-imgadm get-file -o $(updates-imgadm list name=sdcadm --latest -H -o uuid)
trentm / hacktime.js
Created Sep 8, 2015
Show a Bunyan raw stream that hacks 'rec.time' to a custom format, if desired.
View hacktime.js
var bunyan = require('./');
function HackTimeStream(stream) { = stream || process.stderr;
HackTimeStream.prototype.write = function write(rec) {
rec.time += 'wallawalla'; + '\n');
View after.txt
$ node examples/listRepoTags.js bogus
listRepoTags: error: bogus repo not found
trentm / magic.js
Created Mar 24, 2015
compressed file type detection using magic numbers. Wrote it. Don't need it right now.
View magic.js
* 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
View gist:9fce26a4cc820a5f4013
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 / hack.bash
Created Nov 6, 2014
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.
View hack.bash
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 "
View gist:fcf7734b5537ef0f259d
$ 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.

Keybase proof

I hereby claim:

  • I am trentm on github.
  • I am 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:

trentm /
Created Jul 31, 2013
Bash function to use the URL shortener on stdin. See <> TODO: pbcopy it too if that command is available
# echo URL | googl
function googl {
local url=$(cat <&0)
set -e pipefail;
echo "{}" \
| json -e "this.longUrl='$url'" \
| curl -sf \
-H 'Content-Type: application/json' -d@- \
| json id
View example.yaml
- Mark McGwire
# Following node labeled SS
- &SS Sammy Sosa
- *SS # Subsequent occurrence
- Ken Griffey
You can’t perform that action at this time.