Skip to content

Instantly share code, notes, and snippets.

View ejcx's full-sized avatar

Evan J Johnson ejcx

View GitHub Profile
@ejcx
ejcx / .tmux.conf
Last active August 29, 2015 14:04
config
set -g default-terminal "xterm-256color"
setw -g xterm-keys on
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
bind h select-pane -L
bind j select-pane -D
@ejcx
ejcx / gist:1ff9848b2f8fc42f21c3
Created November 4, 2014 00:05
golang print json
package main
import (
"fmt"
"os"
"encoding/json"
)
type Foobar struct {
A_int int
### Keybase proof
I hereby claim:
* I am steakejjs on github.
* I am ej (https://keybase.io/ej) on keybase.
* I have a public key whose fingerprint is 9AA6 07A3 AD1D 45DA BDE3 3CEE 82A5 93BA A90B E68C
To claim this, I am signing this object:
@ejcx
ejcx / gist:6c17f07c4ca72115bfec
Created April 15, 2015 04:57
Gorilla Session Decode
~ echo "MTQyODg2MTkwOHxEdi1CQkFFQ180SUFBUkFCRUFBQU1QLUNBQUlHYzNSeWFXNW5EQVVBQTJadmJ3WnpkSEpwYm1jTUJRQURZbUZ5QTJsdWRBUUNBRlFEYVc1MEJBSUFWZz09fGZWZuwf1oFeGx0R7d7EzCqJix5E-N4AGeXlMXNb0Uju" | base64 -D
1428861908|Dv-BBAEC_4IAARABEAAAMP-CAAIGc3RyaW5nDAUAA2ZvbwZzdHJpbmcMBQADYmFyA2ludAQCAFQDaW50BAIAVg==|fVf�ց^����*��D����1s[�H�%
➜ ~ echo "Dv-BBAEC_4IAARABEAAAMP-CAAIGc3RyaW5nDAUAA2ZvbwZzdHJpbmcMBQADYmFyA2ludAQCAFQDaW50BAIAVg==" | base64 -D
����0��stringfoostringbarintTintV%
### Keybase proof
I hereby claim:
* I am ejcx on github.
* I am ej (https://keybase.io/ej) on keybase.
* I have a public key whose fingerprint is 9AA6 07A3 AD1D 45DA BDE3 3CEE 82A5 93BA A90B E68C
To claim this, I am signing this object:
@ejcx
ejcx / bigfavicon.go
Last active August 29, 2015 14:23
PoC to make browsers download favicons that are way bigger than should be allowed.
package main
import (
"crypto/rand"
"fmt"
"log"
"net/http"
"os"
)
package main
import (
"crypto/rand"
"fmt"
"log"
"net/http"
"os"
)
@ejcx
ejcx / newbox.sh
Created June 19, 2015 20:36
newbox.sh
#!/bin/bash
cd
echo "export PATH=\"/usr/local/go/bin/\":\$PATH
export GOPATH=\"/root/go\"" >> ~/.bashrc
curl https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz > go.1.4.2.tar.gz
tar -zxvf go.1.4.2.tar.gz
mv go /usr/local/
mkdir go
cd go
mkdir src bin pkg
@ejcx
ejcx / badexec.go
Last active August 29, 2015 14:24
package main
import (
"os/exec"
"fmt"
)
func main() {
err := exec.Command("man", "-P /tmp/runme.sh", "man").Run()
fmt.Println(err)
@ejcx
ejcx / badAuthPattern.go
Last active January 2, 2016 20:08
Go Authentication Design Patterns
package main
import (
"log"
"net/http"
"os"
"github.com/gorilla/sessions"
)