Skip to content

Instantly share code, notes, and snippets.

View bored-engineer's full-sized avatar

Luke Young bored-engineer

View GitHub Profile
#!/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 00:30
A go program to expand a regular expression into every possible matching string
package main
import (
"os"
"fmt"
"strings"
"regexp/syntax"
"unicode/utf8"
)
@bored-engineer
bored-engineer / controlmaster_pid.go
Created March 30, 2020 08:37
Get the PID of a SSH controlmaster process
package main
import (
"bytes"
"encoding/binary"
"io"
"log"
"net"
"os"
"time"
@bored-engineer
bored-engineer / mq.go
Created January 29, 2020 20:01
jq but for MessagePack: go build mq.go -o mq
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
@bored-engineer
bored-engineer / watch.go
Created January 17, 2020 23:42
Watch new process spawns from userspace (without becoming root) via polling /proc (`GOOS=linux GOARCH=amd64 go build watch.go`)
package main
import (
"bufio"
"bytes"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
@bored-engineer
bored-engineer / _main.go
Last active March 31, 2023 15:07
[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.
// 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 February 13, 2019 14:34
A jq script to generate strongly typed golang structures based on results from a GraphQL introspection query

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 July 23, 2017 12:46
Command to run minio on a WD MyCloud
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
token=asdf
token="sad"
@bored-engineer
bored-engineer / lksjdfjlksdf
Created December 11, 2016 10:06
test (NOT my actual key)
-----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