Skip to content

Instantly share code, notes, and snippets.

View avary's full-sized avatar

Abdulhafiz KAŞGARLI avary

View GitHub Profile
@avary
avary / export.go
Created July 12, 2023 13:00 — forked from salrashid123/export.go
Threshold key generation and signing with serialization to file
package main
import (
"encoding/base64"
"flag"
"fmt"
"io/ioutil"
"os"
"go.dedis.ch/kyber/v3/pairing/bn256"
@avary
avary / main.go
Created July 12, 2023 13:00 — forked from salrashid123/main.go
Threshold key encryption in golang
package main
import (
"encoding/base64"
"flag"
"fmt"
"io/ioutil"
"os"
"go.dedis.ch/kyber/v4/encrypt/ecies"
@avary
avary / gpg_golang.md
Created July 12, 2023 12:59 — forked from salrashid123/gpg_golang.md
Another GPG encryption/decryption sign/verify script on gist
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@avary
avary / 2019-https-localhost.md
Created July 5, 2023 15:31 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@avary
avary / letsencrypt_2020.md
Created July 5, 2023 15:31 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@avary
avary / README.txt
Created July 5, 2023 14:55 — forked from ncw/README.txt
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
./makecert.sh [email protected]
Run the server in one terminal
go run server.go
@avary
avary / main.go
Created July 3, 2023 10:59 — forked from manakuro/main.go
import (
...
rc "firebase-authentication-with-react-and-go/backend/router/context"
m "firebase-authentication-with-react-and-go/backend/router/middleware"
)
func main() {
// ...
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
@avary
avary / auth.go
Created July 3, 2023 10:59 — forked from manakuro/auth.go
package middleware
import (
"context"
"net/http"
"strings"
firebase "firebase.google.com/go"
"github.com/labstack/echo"
@avary
avary / auth.go
Created July 3, 2023 10:59 — forked from manakuro/auth.go
package middleware
import (
"context"
"net/http"
"strings"
firebase "firebase.google.com/go"
"github.com/labstack/echo"