Skip to content

Instantly share code, notes, and snippets.

View Dj-Codeman's full-sized avatar

Darrion Whitfield Dj-Codeman

View GitHub Profile
@awadhwana
awadhwana / main.go
Last active April 7, 2025 16:58
Golang: aes-256-cbc ecrypt/decrypt examples (with iv, blockSize)
package main
// Working example: https://goplay.space/#Sa7qCLm6w65
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/hex"
"fmt"
@yingray
yingray / main.go
Last active April 7, 2025 16:57
Golang: aes-256-cbc examples (with iv, blockSize)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/hex"
"fmt"
)
@byrnedo
byrnedo / ComputeHmac256.go
Created September 12, 2016 07:32
Compute a hmac for a message in golang
func ComputeHmac256(message string, secret string) string {
key := []byte(secret)
h := hmac.New(sha256.New, key)
h.Write([]byte(message))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
If 2fa is enabled on github switch to ssh instead of https on linux
1. generate an ssh keypair on your linux box
ssh-keygen -t {rsa|dsa}
2. add the public key to github: profile - settings - ssh keys
3. switch from https to ssh
Check your repo remote:
@ross-spencer
ross-spencer / file-generator.go
Created November 12, 2015 21:00
Richard's example to make random files Golang
package main
import "io/ioutil"
func main() {
bigBuff := make([]byte, 750000000)
ioutil.WriteFile("bigfile.test", bigBuff, 0666)
}