Skip to content

Instantly share code, notes, and snippets.

@sysbot
sysbot / gist:a042839337ed2910476bfd739be61531
Created June 8, 2016 17:28 — forked from lukewpatterson/gist:4242707
squeezing private SSH key into .travis.yml file
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@sysbot
sysbot / .kitchen.yml
Created March 29, 2016 23:25 — forked from jeffbyrnes/.kitchen.yml
Travis CI + Test Kitchen
language: ruby
rvm:
- 1.9.3
before_install:
- openssl aes-256-cbc -K $encrypted_755628117be5_key -iv $encrypted_755628117be5_iv
-in travis_ci_ec2.pem.enc -out ~/.ssh/travis_ci_ec2.pem -d
- chmod 600 ~/.ssh/travis_ci_ec2.pem
install:
- bundle install --without vagrant
- bundle exec berks install
@sysbot
sysbot / tmux-cheatsheet.markdown
Created October 25, 2015 23:11 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sysbot
sysbot / supermicro-ipmi-mac-address.md
Created October 23, 2015 17:42 — forked from DavidWittman/supermicro-ipmi-mac-address.md
Pull the LAN1/eth0 MAC address from SuperMicro IPMI

You can find the MAC address for LAN1/eth0 (not the BMC MAC) via the SuperMicro IPMI interface by running the following command:

$ ipmitool -U <redacted> -P <redacted> -H 10.4.0.10 raw 0x30 0x21 | tail -c 18
00 25 90 f0 be ef
@sysbot
sysbot / curvecp_handshake.rb
Created October 14, 2015 06:20 — forked from grantr/curvecp_handshake.rb
CurveCP handshake protocol in Ruby
# A demonstration of the CurveCP handshake protocol. This protocol has many
# favorable security properties described at http://curvecp.org.
#
# In addition to its security advantages, it has the following favorable properties:
# * Needs only 2 messages (1 from client, 1 from server) before application
# messages can be exchanged (3 before the server can send application messages)
# * Does not require the server to keep protocol state between handshake messages.
#
# An overview of the protocol:
#
@sysbot
sysbot / gist:cfafd22c2458036447ff
Created October 6, 2015 07:34 — forked from gotohr/gist:7005197
declarative function composition - golang
package main
import "fmt"
type F func(i int) int
func (f F) compose(inner F) F {
return func(i int) int { return f(inner(i)) }
}
@sysbot
sysbot / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env ruby
require 'json'
require 'yaml'
input = $stdin.read
data = YAML::load(input)
json = JSON.dump(data)
/usr/sbin/tcpdump -nnt -r tmp.pcap | egrep '[S]' | awk -F '.' '{print $1"."$2"."$3"."$4}\' | sort | uniq -c | sort -nr | head
require 'ipaddr'
def crc16(buf)
crc = 0x00
buf.each_byte do |b|
print "b: #{b}\n"
# ^ binary xor
# >> binary right shift
# & bitwise 'AND'
crc = ((crc >> 8) & 0xff) ^ CRC_LOOKUP[(crc ^ b) & 0xff]