Skip to content

Instantly share code, notes, and snippets.

View cwjohnston's full-sized avatar

Cameron Johnston cwjohnston

  • Salt Lake City, UT
View GitHub Profile
anonymous
anonymous / -
Created September 24, 2016 21:19
<?xml version="1.0" encoding="UTF-8"?>
<PerformanceMeasurement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="iostat_schema.xsd" >
<ProcessingHeader>
<Command>iostat</Command>
<XmlFormatVersion>1.0</XmlFormatVersion>
<TimeStamp Name="GeneratedOn" Type="UtcSecs" >
1474672061
</TimeStamp>
<TimeStamp Name="GeneratedOn" Type="PrintableDate" >
@jdeathe
jdeathe / make-local-cert.sh
Last active April 8, 2025 02:36
Generate a Root CA + Intermediate CA for local (internal) use on Mac OSX using cfssl and add the intermediate certificate to your keychain so it can be trusted by your local browser.
#!/usr/bin/env bash
# REF: https://github.com/cloudflare/cfssl
# Change working directory
cd -- "$(
dirname "${0}"
)" || exit 1
readonly CA_ROOT_CERT_KEY="ca-root"
{
"handlers": {
"example_handler": {
"type": "pipe",
"command": "notify_somebody.rb",
"timeout": 30,
"filter": "filter_weekly_maintenance"
}
}
}
@chrisroberts
chrisroberts / slayer.bash
Created August 12, 2015 22:07
proc killer
#!/bin/bash
if [[ "$#" -gt 2 ]]; then
echo "ERROR: Only two arguments are allowed!"
exit -1
elif [[ "$#" -lt 1 ]]; then
echo "${0}: Kill processes running past limit (default is one hour)"
echo "Usage: "
echo ""
echo " ${0} PROC_PATTERN [MAX_AGE_IN_SECONDS]"
@garthk
garthk / profile
Created June 21, 2015 23:51
boot2docker 1.7.0 cert fix
wait4eth1() {
CNT=0
until ip a show eth1 | grep -q UP
do
[ $((CNT++)) -gt 60 ] && break || sleep 1
done
sleep 1
}
wait4eth1
@beardicus
beardicus / edgerouter-qos
Last active February 10, 2026 19:57
EdgeRouter Lite QOS Settings
#
# fair-queue based settings for EdgeRouter Lite traffic shaping
#
# download is typically 30 and change. everything can burst to 100%
# of bandwidth, priority rules keep the garbage in check
set traffic-policy shaper download
set traffic-policy shaper download bandwidth 30Mbit
@cwjohnston
cwjohnston / Gemfile
Last active August 29, 2015 14:08
How to Sparkle
gem 'knife-cloudformation', :git => 'https://github.com/heavywater/knife-cloudformation.git', :ref => 'feature/miasma'
gem 'miasma', :git => 'https://github.com/chrisroberts/miasma.git', :ref => 'develop'
@stantonk
stantonk / blah.scala
Created June 12, 2014 04:18
Black magic to tell sbt to choose the first duplicate class when resolving dependency collisions instead of just failing out.
/**
* Black magic to tell sbt to choose the first duplicate class when resolving dependency collisions instead of just
* failing out.
*/
mergeStrategy in assembly <<= (mergeStrategy in assembly) {
(old) => {
case x if Assembly.isConfigFile(x) =>
MergeStrategy.concat
case PathList(ps@_*) if Assembly.isReadme(ps.last) || Assembly.isLicenseFile(ps.last) =>
MergeStrategy.rename
@coderanger
coderanger / README.md
Last active August 29, 2015 13:56
Command to run depsolver

To use this snippet first replace the _default in the URL with your environment name if you are using somethign other than the global default. Next in the run list, replace ... with your cookbook names. Unlike other run lists, you cannot have roles here, and you don't use the 'recipe[foo]' syntax, just 'foo'.

@fnichol
fnichol / unfuck-vmware-net.sh
Created February 13, 2014 19:32
"Fix" VMware Network
#!/usr/bin/env bash
set -e
[ -n "$DEBUG" ] && set -x
banner() { printf -- "-----> $*\n"; }
banner "Restarting VMware networking"
banner "Stoping networking"
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop