Skip to content

Instantly share code, notes, and snippets.

@d4z3x
d4z3x / golang_on_rpi.md
Created March 28, 2019 00:05 — forked from simoncos/golang_on_rpi.md
Install Golang 1.9 on Raspberry Pi

Install Golang 1.9:

wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile

If already installed old golang with apt-get:

@d4z3x
d4z3x / GzipStream.go
Created November 27, 2019 08:50 — forked from avelino/GzipStream.go
golang gzip stream
func GetGzip(path string) string {
println(path)
client := &http.Client{
Transport: &transport.Transport{
ReadTimeout: 10 * time.Second,
RequestTimeout: 15 * time.Second,
},
}
@d4z3x
d4z3x / rsa_util.go
Created June 4, 2020 23:21 — forked from miguelmota/rsa_util.go
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@d4z3x
d4z3x / decrypt.go
Created June 5, 2020 00:43 — forked from apokalyptik/decrypt.go
Go RSA private key decryption example. Compatible with data encrypted via http://us3.php.net/openssl_public_encrypt
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"flag"
"fmt"
"io/ioutil"
@d4z3x
d4z3x / fnv_example.go
Created December 23, 2020 07:11 — forked from lenage/fnv_example.go
golang fnv example
package main
import (
"bufio"
"fmt"
"hash/fnv"
"io"
"os"
)
@d4z3x
d4z3x / auto-cert-reload.go
Created November 21, 2023 06:49 — forked from KaiserWerk/auto-cert-reload.go
Golang: Automatic TLS Certificate Reload
package main
import (
"crypto/tls"
"fmt"
"io"
"net/http"
)
func main() {
@d4z3x
d4z3x / split_file.bash
Created December 5, 2023 02:00 — forked from pmarreck/split_file.bash
Split a text file into a directory of files each of which contains 1 line from the original file
#!/usr/bin/env bash
# Ensure a file name is provided
if [ -z "$1" ]
then
echo "No file name provided. Usage: ./split_file.bash <filename>"
exit 1
fi
# Extract the directory and base name from the file
@d4z3x
d4z3x / sshclient.go
Created February 24, 2024 19:30 — forked from Mebus/sshclient.go
Golang SSH Client
package main
import (
"bufio"
"io/ioutil"
"os/signal"
//"syscall"
"fmt"
"log"
"os"