Skip to content

Instantly share code, notes, and snippets.

View jyotty's full-sized avatar

Joshua Yotty jyotty

View GitHub Profile
$ docker inspect modeanalytics/bridge-client | jq '.[0].Config.Entrypoint'
[
"/bin/sh",
"-c",
"echo -n \"Downloading ${mode_bridge_release} client...\" && curl -s \"${MODE_DISTRIBUTION_URL}/public/release/mode-bridge/linux-container/${mode_bridge_release}.tgz\" | tar -xzf - && echo \"DONE\\nMode Bridge v$(cat /opt/mode/VERSION) is starting.\" && /opt/mode/mode-bridge"
]
@jyotty
jyotty / gist:6d484c350df9940ec7e664d9b0a57925
Created November 4, 2017 23:58
lol-inducing near-miss with cryptopals set1 ch6
theseus:cryptopals-go josh (master *+%)$ go run set1ch6.go
[{2 6} {3 8} {29 8.379310344827585} {5 8.4} {18 8.833333333333334} {31 9.096774193548388} {20 9.2} {13 9.307692307692308} {19 9.31578947368421} {8 9.375} {39 9.435897435897436} {40 9.45} {24 9.541666666666666} {30 9.566666666666666} {14 9.571428571428571} {34 9.617647058823529} {17 9.647058823529411} {37 9.64864864864865} {15 9.666666666666666} {9 9.666666666666666} {28 9.678571428571429} {35 9.714285714285714} {7 9.714285714285714} {25 9.72} {11 9.727272727272727} {23 9.826086956521738} {21 9.857142857142858} {38 9.868421052631579} {16 9.9375} {33 10.030303030303031} {26 10.115384615384615} {6 10.166666666666666} {32 10.21875} {12 10.25} {4 10.25} {27 10.296296296296296} {22 10.318181818181818} {10 10.4} {36 10.583333333333334}]
[2 3 29 5 18]
Found no suitable ASCII bytes to decode with key length %!s(int=2)
Found no suitable ASCII bytes to decode with key length %!s(int=3)
Key: Terminator X: Ering the noise
Lyrics: I'm back and I m ringin' the bell
@jyotty
jyotty / flapjack-etet.go
Created August 31, 2017 22:08
tiny flapjack webhook receiver for end-to-end testing
package main
import (
"encoding/json"
"fmt"
"github.com/PagerDuty/go-pagerduty"
"github.com/go-martini/martini"
"gopkg.in/alecthomas/kingpin.v2"
"io/ioutil"
"log"
@jyotty
jyotty / rhsm.conf.diff
Created January 18, 2017 23:50
SoftLayer rhsm.conf changes
[root@ironic-bm01 ~]# diff -u /etc/rhsm/rhsm.conf{.rpmnew,}
--- /etc/rhsm/rhsm.conf.rpmnew 2016-09-13 10:37:34.000000000 -0500
+++ /etc/rhsm/rhsm.conf 2017-01-16 13:32:44.153947329 -0600
@@ -3,10 +3,10 @@
# Unified Entitlement Platform Configuration
[server]
# Server hostname:
-hostname = subscription.rhsm.redhat.com
+hostname = rhnsatdal0601.service.networklayer.com
$ perl -CS -E'say map chr 0x1F1A5+ord$_,split// for@ARGV' US MX DE JP UZ FR RU BR
🇺🇸
🇲🇽
🇩🇪
🇯🇵
🇺🇿
🇫🇷
🇷🇺
🇧🇷
@jyotty
jyotty / gist:1270a236574592a2697f4b02a67a2dc6
Created June 2, 2016 17:33
tmux 2.1 vs 2.2 default socket path
jyotty@pleione:~$ tmux list-sessions
0: 1 windows (created Mon May 16 14:29:38 2016) [121x58] (attached)
2: 1 windows (created Thu Jun 2 10:26:19 2016) [100x29]
jyotty@pleione:~$ brew update && brew upgrade tmux
🍺 /usr/local/homebrew/Cellar/tmux/2.2: 9 files, 639.4K
jyotty@pleione:~$ tmux list-sessions
error connecting to /private/tmp/tmux-501/default (No such file or directory)
jyotty@pleione:~!$ ps aux|grep tmux
jyotty 2719 0.0 0.0 2461140 1168 ?? Ss 16May16 1:57.13 tmux
@jyotty
jyotty / gem_install_bench.sh
Last active March 7, 2016 20:54
testing throughput of gem mirror
#!/usr/bin/env bash
set -e
[ -n "$DEBUG" ] && set -x
jobs="${1:-8}"
pids=()
for i in $(seq "$jobs"); do
(
@jyotty
jyotty / adium-to-bitlbee-osx.sh
Created February 15, 2016 21:34
migrate Adium OTR private key and known fingerprints to bitlbee
# assuming you connect to bitlbee with your OS X username:
cp ~/Library/Application\ Support/Adium\ 2.0/Users/Default/otr.private_key /usr/local/var/bitlbee/lib/$USER.otr_keys
# change (name "1") to (name "your@jabber.id")
# and (protocol libpurple-Jabber) to (protocol jabber)
$EDITOR /usr/local/var/bitlbee/lib/$USER.otr_keys
cp ~/Library/Application\ Support/Adium\ 2.0/Users/Default/otr.fingerprints /usr/local/var/bitlbee/lib/$USER.otr_fingerprints
$EDITOR /usr/local/var/bitlbee/lib/$USER.otr_fingerprints
# file is TSV, column 2 is name and column 3 is protocol.
@jyotty
jyotty / crm.sh
Created July 14, 2015 00:25
pacemaker cluster status in $PS1
# Pick a resource that runs only on the master (clone/ms won't work)
# then, in your /root/.bash_profile:
# . path/to/crm.sh
# export CRM_PS1_RESOURCE=xxx
# export PS1='[\u@\h \W](crm: $(__crm_ps1))\$ '
function __crm_ps1() {
local nodename="$(uname -n)"
crm_resource --list -Q >/dev/null 2>&1 || { echo "dead"; return 1; }
@jyotty
jyotty / lwp-monkeypatch.pl
Created July 29, 2014 22:38
If for some sad reason you're stuck using perl+LWP 5.8 on RHEL 6, here's how to make HTTPS actually secure
# as far as I can tell the SSL_CERT_* environment variables are not
# respected, and the SSL_ca_path argument doesn't work at all. Yay.
sub lwp_58_extra_sock_opts {
# turn on peer verification without subclassing LWP::Protocol::https
use IO::Socket::SSL;
return (
SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_PEER,
SSL_ca_file => '/etc/pki/tls/certs/ca-bundle.crt',