Skip to content

Instantly share code, notes, and snippets.

compdef _tsh tsh
zstyle ':completion:*' group-name ''
zstyle ':completion:*:*:-command-:*:*' group-order alias builtins commands hosts functions
global_args=('-l[Remote host login]' \
'--login[Remote host login]' \
'--proxy[SSH proxy address]' \
'--user[SSH proxy user]' \
'--ttl[Minutes to live for a SSH session]' \
'-i[Identity file]' \
#!/usr/bin/env python3
import sys, json, base64, subprocess
import os.path
from os import path
from pathlib import Path
import socket
import fcntl
import struct
import ipaddress
On gateway machine:
ip link add gretap type gretap remote <dst_host_public_ipv4> ttl 64
ip link set gretap up
ip -6 a a fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:yyyy/64 dev gretap
ip -6 route add <public::ipv6::address:routed::to:host/64> via fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:zzzz dev gretap
On destination machine:
On gateway machine:
ip link add gretap type gretap remote <dst_host_public_ipv4> ttl 64
ip link set gretap up
ip -6 a a fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:yyyy/64 dev gretap
ip -6 route add <public::ipv6::address:routed::to:host/64> via fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:zzzz dev gretap
On destination machine:
@steveberryman
steveberryman / gist:e0a620cc118cf0e9f53f723fd853f414
Created September 5, 2018 18:45
make modern rogue articles look really boring
#logoWrapper {
visibility: hidden
}
body:not(.has-banner-image).transparent-header #header,
#header {
background-color: #ffffff
}
.collection-type-blog article header {
text-align: left
}
@steveberryman
steveberryman / hipchat.rb
Created October 1, 2014 18:11
sensu hipchat extension
#/usr/bin/env ruby
# Sends events to hipchat for wonderful chatty notifications
#
# This extension requires the hipchat gem
#
# The reason I wrote this instead of using the normal hipchat handler, is that with Flapjack
# all events are handled unless you do crazy filtering stuff. Also with a large number of events
# and checks the sensu server can get overloaded with forking stuff. So anyway, hipchat extension :)
#
@steveberryman
steveberryman / gist:170d23d1258543e7ab53
Created July 23, 2014 16:41
hipchat-extension.rb
#/usr/bin/env ruby
# Sends events to hipchat for wonderful chatty notifications
#
# This extension requires the hipchat gem
#
# The reason I wrote this instead of using the normal hipchat handler, is that with Flapjack
# all events are handled unless you do crazy filtering stuff. Also with a large number of events
# and checks the sensu server can get overloaded with forking stuff. So anyway, hipchat extension :)
#
### Keybase proof
I hereby claim:
* I am steveberryman on github.
* I am steveberryman (https://keybase.io/steveberryman) on keybase.
* I have a public key whose fingerprint is B07B 0EA6 64B5 8FDD 9ED5 9718 AE47 AA94 A4FC 2E76
To claim this, I am signing this object:
#!/usr/bin/env ruby
require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'sensu-handler'
require 'hipchat'
require 'timeout'
module Sensu::Extension
class Hipchat < Handler # Sub-class the appropriate extension type
#!/usr/bin/ruby
require 'chef'
require 'chef/rest'
Chef::Log.debug("Authenticating via openid")
response = @rest.post_rest('openid/consumer/start', {
"openid_identifier" => "#{Chef::Config[:openid_url]}/openid/server/node/program_auth",
"submit" => "Verify"
})