Skip to content

Instantly share code, notes, and snippets.

Avatar

Luke Young bored-engineer

View GitHub Profile
View decrypt_github_enterprise.rb
#!/usr/bin/ruby
#
# This tool is only used to "decrypt" the github enterprise source code.
#
# Run in the /data directory of the instance.
require "zlib"
KEY = "This obfuscation is intended to discourage GitHub Enterprise customers "+
"from making modifications to the VM. We know this 'encryption' is easily broken. "
@bored-engineer
bored-engineer / exrex.go
Created May 19, 2020
A go program to expand a regular expression into every possible matching string
View exrex.go
package main
import (
"os"
"fmt"
"strings"
"regexp/syntax"
"unicode/utf8"
)
@bored-engineer
bored-engineer / controlmaster_pid.go
Created Mar 30, 2020
Get the PID of a SSH controlmaster process
View controlmaster_pid.go
package main
import (
"bytes"
"encoding/binary"
"io"
"log"
"net"
"os"
"time"
@bored-engineer
bored-engineer / mq.go
Created Jan 29, 2020
jq but for MessagePack: go build mq.go -o mq
View mq.go
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
@bored-engineer
bored-engineer / watch.go
Created Jan 17, 2020
Watch new process spawns from userspace (without becoming root) via polling /proc (`GOOS=linux GOARCH=amd64 go build watch.go`)
View watch.go
package main
import (
"bufio"
"bytes"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
@bored-engineer
bored-engineer / _main.go
Last active Dec 23, 2019
[Golang] PrefixReader (io.WriteCloser) wraps an io.Reader allowing data to be written ("prefixed") to the Reader which will be returned by subsequent Read calls until Close is called at which points all reads will pass-through to the underlying reader.
View _main.go
// THIS IS THE CORRECT SOLUTION, NOT WHAT WAS IN THIS GIST
package main
import (
"strings"
"io"
"io/ioutil"
"fmt"
)
@bored-engineer
bored-engineer / 0_usage.md
Last active Feb 13, 2019
A jq script to generate strongly typed golang structures based on results from a GraphQL introspection query
View 0_usage.md

Usage (using get-graphql-schema to fetch the schema):

get-graphql-schema https://hackerone.com/graphql --json | jq -rf graphql.jq

Supports Union types, Enum types, Interfaces, Input Objects and regular Objects.

See bored-engineer/hackeroni-ql for an example library generated with this script.

@bored-engineer
bored-engineer / command.sh
Last active Jul 23, 2017
Command to run minio on a WD MyCloud
View command.sh
docker run -d -p 9000:9000 --name $share -v /mnt/HD/HD_a2/$share/:/export -v /mnt/HD/HD_a2/$share/config:/root/.minio minio/minio server /export/data
@bored-engineer
bored-engineer / lksjdfjlksdf
Created Dec 11, 2016
test (NOT my actual key)
View lksjdfjlksdf
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp
wmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ5
1s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQABAoGAFijko56+qGyN8M0RVyaRAXz++xTqHBLh
3tx4VgMtrQ+WEgCjhoTwo23KMBAuJGSYnRmoBZM3lMfTKevIkAidPExvYCdm5dYq3XToLkkLv5L2
pIIVOFMDG+KESnAFV7l2c+cnzRMW0+b6f8mR1CJzZuxVLL6Q02fvLi55/mbSYxECQQDeAw6fiIQX
GukBI4eMZZt4nscy2o12KyYner3VpoeE+Np2q+Z3pvAMd/aNzQ/W9WaI+NRfcxUJrmfPwIGm63il
AkEAxCL5HQb2bQr4ByorcMWm/hEP2MZzROV73yF41hPsRC9m66KrheO9HPTJuo3/9s5p+sqGxOlF
L0NDt4SkosjgGwJAFklyR1uZ/wPJjj611cdBcztlPdqoxssQGnh85BzCj/u3WqBpE2vjvyyvyI5k
X6zk7S0ljKtt2jny2+00VsBerQJBAJGC1Mg5Oydo5NwD6BiROrPxGo2bpTbu/fhrT8ebHkTz2epl