Skip to content

Instantly share code, notes, and snippets.

@bdha
bdha / smartos_hackery.md
Last active April 7, 2018 10:10
Modify a SmartOS vmware platform image

Using OS X and vmware Fusion. Requires an actual Solarish system or VM to modify the boot_archive.

Why would you want to do this? Well, it's an easy way of modifying an excellent platform for your own nefarious ends. Maybe you want to inject some extra (or less) work into the install scripts. Or just add some extra default services. Or drop in some leet figlet into /etc/issue. Or more usefully: Drop your application bootstrapping code into the platform to create turnkey appliances.

Prep

Download and decompress the SmartOS VMware image.

Copy the boot image out of the VM directory and mount it.

@bdha
bdha / gist:c456cf6e5484ea5ad256
Last active August 29, 2015 14:15
Building Haskell on SmartOS
@mrzarquon
mrzarquon / gist:0d2e198f26960c4ffb14
Created November 2, 2014 17:44
show_classification.sh "PE Master" - to see the full json rule / configuration for the "PE Master" classification group in the console
#!/bin/bash
# simple 3.7 NC classifier commands
declare -x PE_CERT=$(/opt/puppet/bin/puppet agent --configprint hostcert)
declare -x PE_KEY=$(/opt/puppet/bin/puppet agent --configprint hostprivkey)
declare -x PE_CA=$(/opt/puppet/bin/puppet agent --configprint localcacert)
declare -x NC_CURL_OPT="-s --cacert $PE_CA --cert $PE_CERT --key $PE_KEY --insecure"
@awaxa
awaxa / load
Last active August 29, 2015 14:06
# Copyright (c) 2014 Greg Kitson https://github.com/awaxa
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
This tool is used to compare microbenchmarks across two versions of code. It's
paranoid about nulling out timing error, so the numbers should be meaningful.
It runs the benchmarks many times, scaling the iterations up if the benchmark
is extremely short, and it nulls out its own timing overhead while doing so. It
reports results graphically with a text interface in the terminal.
You first run it with --record, which generates a JSON dotfile with runtimes
for each of your benchmarks. Then you change the code and run again with
--compare, which re-runs and generates comparison plots between your recorded
and current times. In the example output, I did a --record on the master

http://filippo.io/Heartbleed/ is a great service to the community.

I wouldn’t recommend testing hosts againt an online tool. All you do is create a log for a security savvy person with vulnerable hosts. While not quite the same, this is similar to uploading private keys or passwords to a service to check if they are secure.

Luckily it is easy to run the software locally, as the author was so kind to provide the source. I don’t read go very well, but a cursory glance suggests that the software does what it says on the tin, so we don’t worry about it phoning home.

This is the first time I’m building a go project, so I have to install go first. brew install go is easily done. You can get binary distributions for your OS from the go homepage: https://code.google.com/p/go/downloads/list

@selenamarie
selenamarie / prod_postgres.md
Last active March 15, 2019 05:12
An Ideal Postgres Environment

Ideal Postgres environment

Documentation

  • Documented replication topology
  • Documented network topology
  • Documented interface topology - including users, passwords, connection estimates, load balancers, connection proxies
  • Documented procedure, schedule for failover and testing
  • Documented procedure, schedule for disaster recovery and testing
@ftrain
ftrain / rhymes.clj
Last active July 14, 2023 22:20
Annotated rhyming dictionary
;; This is at: https://gist.github.com/8655399
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up
;; this code here:
;;
;; https://gist.github.com/jackrusher/8640437
;;
;; I'm going to study this code and learn as I go.
;;
;; First I put it in a namespace.
#! /usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'optparse'
options = {}
optparse = OptionParser.new { |opts|
opts.banner = "Usage : howmuch.rb [-c <city> -s <state>] | [-z <zip>]
#!/bin/sh
# hackyfix ze puppets to run on mavericks
cd /usr/lib/ruby/site_ruby/2.0.0
for i in "facter hiera hiera_puppet.rb puppet.rb puppetx.rb facter.rb hiera.rb puppet puppetx semver.rb"
do
sudo ln -s ../1.8/${i} ${i}
done