Skip to content

Instantly share code, notes, and snippets.

@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

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

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
@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
@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"
@bdha
bdha / gist:c456cf6e5484ea5ad256
Last active April 10, 2026 17:34
Building Haskell on SmartOS
@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.

@ddbeck
ddbeck / toggleDistractions.js.scpt
Last active August 29, 2015 14:22
A script to toggle distractions from Mac OS X Dock badges
// Use this Mac OS X automation script to quickly hide notifications for
// distracting apps. Put the names of the distracting apps in the
// `distractingApps` array and save the script. Run the script to toggle the
// badges on and off.
// Tip: To run this script much faster, move the distracting apps to the top of
// the list in System Preferences's Notifications pane.
var distractingApps = ['Tweetbot', 'Slack']
#! /bin/bash
CACERT='/etc/puppetlabs/puppet/ssl/certs/ca.pem'
CERT='/opt/puppet/share/puppet-dashboard/certs/pe-internal-dashboard.cert.pem'
KEY='/opt/puppet/share/puppet-dashboard/certs/pe-internal-dashboard.private_key.pem'
HOST=$(hostname -f)
URL='production/resource/node'
curl --cacert ${CACERT} --cert ${CERT} --key ${KEY} "https://${HOST}:8140/${URL}"
@bahamas10
bahamas10 / 0-README.md
Last active January 4, 2019 18:02
Joyent Manta Functions