Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am mivok on github.
  • I am mharrison (https://keybase.io/mharrison) on keybase.
  • I have a public key ASCfJWlUVLhFoY8v54GZKu9DU7Fbs9jKqzNu3jqRsuSayQo

To claim this, I am signing this object:

View newcreds.rb
# Save this as ~/.chef/newcreds.rb
# Add require_relative 'newcreds' to your ~/.chef/knife.rb
require 'tomlrb'
require 'pathname'
context_file = "#{Dir.home}/.chef/context"
credentials_file = "#{Dir.home}/.chef/credentials"
context = File.read(context_file).chomp if File.exist?(context_file)
profile_name = ENV["CHEF_PROFILE"] || context || "default"
View cookbooks_test_libraries_helpers.rb
module MockDeliverySugar
module DSL
def automate_chef_server
@automate_chef_server ||= MockDeliverySugar::ChefServer.new
end
def load_delivery_chef_config
automate_chef_server.load_server_config
end
end
@mivok
mivok / openvpn.conf
Last active Jun 30, 2016
Openvpn config
View openvpn.conf
# On the client only
remote other-side.example.com
# Increase this if you have multiple vpn servers on the same instance
port 1194
# Use tun1, tun2 and so on if you have multiple vpn servers on the same instance
dev tun1
# Note: these IP addresses are private to the VPN server and don't need to be recorded anywhere.
# They can be reused across different vpn servers as long as they aren't on the same machine.
@mivok
mivok / foo.clj
Created Aug 20, 2015
Indexing multiple times
View foo.clj
(let [index (index)]
(streams
index ; Index everything to begin with
(where (<= 0 metric 5)
(with :state "ok" index)
(else
(with :state "warning" index)))))
View kittychat.rb
#!/usr/bin/env ruby
# Sends cat pics to hipchat using either the hipchat api or kitty command
#
# Go to https://yourcompany.hipchat.com/account/api to get an API key and put
# it in '.api_token' in the same directory as this script.
#
# To send ascii cats you need the 'kitty' gem installed: gem install kitty
#
require 'hipchat'
require 'json'
@mivok
mivok / colorFilter
Created Jun 21, 2009
Color hilighting for todo.sh
View colorFilter
#!/bin/bash
COLOR_CONTEXT=$GREEN
COLOR_PROJECT=$RED
COLOR_DATE=$LIGHT_GREEN
# Force gawk to behave posixly. Comment out if you get an error about
# no such option -W.
AWK_OPTIONS="-W posix"
if [ "$TODOTXT_PLAIN" -eq "0" ]; then
awk $AWK_OPTIONS "
{ color = \"$DEFAULT\" }