Skip to content

Instantly share code, notes, and snippets.

View xor-gate's full-sized avatar
👽

Jerry Jacobs xor-gate

👽
View GitHub Profile
@xor-gate
xor-gate / resp3.md
Created September 8, 2018 23:19 — forked from antirez/resp3.md
RESP3 protocol draft

RESP3 specification

Versions history:

  • 1.0, 2 May 2018, Initial draft to get community feedbacks.

Background

The Redis protocol has served us well in the past years, showing that, if carefully designed, a simple human readable protocol is not the bottleneck in the client server communication, and that the simplicity of the design is a major advantage in creating a healthy client libraries ecosystem.

Yet the Redis experience has shown that after about six years from its introduction (when it replaced the initial Redis protocol), the current RESP protocol could be improved, especially in order to make client implementations simpler and to support new features.

@xor-gate
xor-gate / pid, uid and gid of a remote unix-socket connection in golang.md
Created August 17, 2018 21:38
getting the pid, uid and gid of a remote unix-socket connection in golang
package main

import (
        "fmt"
        "net"
        "reflect"
        "runtime"
        "syscall"
)
@xor-gate
xor-gate / webdavserv.go
Created July 18, 2018 14:05 — forked from staaldraad/webdavserv.go
A small webdav server in go
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
"golang.org/x/net/webdav"
@xor-gate
xor-gate / nextcloud-install-sid.sh
Created July 12, 2018 21:22 — forked from yottu/nextcloud-install-sid.sh
Installing nextcloud 12.0 on Debian GNU/Linux (sid) [lighttpd/mariadb]
### Written: 2017-06-13
### Updated: -
### Get, verify and unpack, delete and move the distribution package (12.0)
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.0.tar.bz2
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.0.tar.bz2.sha256
sha256sum -c nextcloud-12.0.0.tar.bz2.sha256 < nextcloud-12.0.0.tar.bz2.sha256
tar xvf nextcloud-12.0.0.tar.bz2 && rm nextcloud-12.0.0.tar.bz2
sudo mv nextcloud /var/www/html
@xor-gate
xor-gate / rewriteImportPaths.go
Created July 9, 2018 10:45 — forked from jackspirou/rewriteImportPaths.go
A method for rewriting golang import paths.
package importpaths
import (
"log"
"os"
"strconv"
"strings"
"go/ast"
"go/parser"
@xor-gate
xor-gate / openssl.md
Created May 10, 2018 22:04 — forked from NoMan2000/openssl.md
Common OpenSSL Commands with Keys and Certificates

Common OpenSSL Commands with Keys and Certificates

SSL Info

Generate RSA private key with certificate in a single command

openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar

Generate Certificate Signing Request (CSR) from private key with passphrase

openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar

@xor-gate
xor-gate / rsasign.go
Created May 10, 2018 21:09 — forked from hansstimer/rsasign.go
Go: rsa signpkcs1v15 signing
package main
import (
"bytes"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"fmt"
)
@xor-gate
xor-gate / fetch.go
Created May 10, 2018 12:55 — forked from jtwaleson/fetch.go
Certificate fetcher in Go
package main
import "crypto/tls"
import "crypto/sha1"
import "crypto/x509"
import "fmt"
import "encoding/pem"
import "os"
import "time"
import "bufio"
@xor-gate
xor-gate / golang-tls.md
Created May 10, 2018 12:54 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
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)
@xor-gate
xor-gate / encrypt.go
Created May 10, 2018 12:42 — forked from apokalyptik/encrypt.go
Go RSA public key encryption example. Compatible with http://us3.php.net/manual/en/function.openssl-private-decrypt.php for decryption
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"log"