Skip to content

Instantly share code, notes, and snippets.

@slumos
slumos / osx-for-hackers.sh
Created May 28, 2017 04:17 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
#!/bin/sh
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Set the colours you can use
black='\033[0;30m'
using NUnit.Framework;
using metrics.Stats;
namespace metrics.Tests.Stats
{
[TestFixture]
public class ExponentiallyDecayingSampleTests
{
[Test]
public void HoldsRequestedNumberOfSamples()

Rolling with Homebrew (rather than MacPorts)

First, we have to install Homebrew. Once it's installed, we can do pretty much everything else via Homebrew. By default Homebrew will install to /usr/local. It's possible to choose a different directory but everything I've read so far says it's a PITA. I'm sticking with the default.

ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"

Getting your development environment running requires a few servers. You could get by with as little as Postgres and Memcached but it'll be better if you have Nginx and RabbitMQ as well. Eventually you'll probably want Redis and Artie as well.

TODO: instructions for Redis and Artie

#!/bin/sh
export BUILD_ROOT=`pwd`/build
mkdir -p $BUILD_ROOT
export RUBY_VERSION=ruby-1.9.1-p243
export NGINX_VERSION=nginx-0.7.62
export PREFIX=/opt/ruby19
Steven: Katsu Curry with White Rice
#!/usr/bin/env ruby
class Munin
class LogReader
attr_accessor :log_file, :me, :pluginstatedir, :statefile
def initialize(file_name)
@file_name = file_name
@me = File.basename($0)
@pluginstatedir = ENV['MUNIN_PLUGSTATE'] || '/var/lib/munin/plugin-state'