Skip to content

Instantly share code, notes, and snippets.

View kylemeow's full-sized avatar
📆
Fabricating the cloud

Kyle Dong kylemeow

📆
Fabricating the cloud
View GitHub Profile
@mimoo
mimoo / compress_tar_gzip.go
Last active May 27, 2024 20:01
How to compress a folder in Golang using tar and gzip (works with nested folders)
package main
import (
"archive/tar"
"bytes"
"compress/gzip"
"fmt"
"io"
"os"
"path/filepath"
@xeoncross
xeoncross / base64.go
Created July 6, 2018 18:21
Base 64 encode and decode a byte array in Golang. https://play.golang.org/p/X4z9zq0nXlW
package main
import (
"fmt"
"encoding/base64"
)
func main() {
str := "Hello, playground :)"
@thomasdarimont
thomasdarimont / ReportCpuCount.java
Last active January 11, 2024 08:03
Using LD_PRELOAD to pass a fake CPU count to Java on Linux
public class ReportCpuCount {
public static void main(String[] args) throws Exception{
while(true){
System.out.printf("#Found %d CPUs%n", Runtime.getRuntime().availableProcessors());
Thread.sleep(1000);
}
}
}
package gziphandler
import (
"compress/gzip"
"log"
"net/http"
"strings"
"sync"
)
@denji
denji / golang-tls.md
Last active June 13, 2024 10:07 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
301 https://github.com/zxdrive/imouto.host