Skip to content

Instantly share code, notes, and snippets.

#!/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 / foo.clj
Created August 20, 2015 20:43
Indexing multiple times
(let [index (index)]
(streams
index ; Index everything to begin with
(where (<= 0 metric 5)
(with :state "ok" index)
(else
(with :state "warning" index)))))
@mivok
mivok / openvpn.conf
Last active June 30, 2016 20:56
Openvpn config
# 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.
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
# 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"
@mivok
mivok / keybase.md
Created July 25, 2018 19:29
keybase

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:

@mivok
mivok / colorFilter
Created June 21, 2009 03:18
Color hilighting for todo.sh
#!/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\" }