Skip to content

Instantly share code, notes, and snippets.

View avary's full-sized avatar

Abdulhafiz KAŞGARLI avary

View GitHub Profile
@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 / 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).

package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@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
@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 / 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 / threshold.go
Created July 12, 2023 13:00 — forked from salrashid123/threshold.go
Threshild Signatures in Golang
package main
import (
"encoding/base64"
"fmt"
"go.dedis.ch/kyber/v3/pairing/bn256"
"go.dedis.ch/kyber/v3/share"
"go.dedis.ch/kyber/v3/sign/bls"
"go.dedis.ch/kyber/v3/sign/tbls"
@avary
avary / file-upload-multipart.go
Created July 13, 2023 09:57 — forked from andrewmilson/file-upload-multipart.go
Golang multipart/form-data File Upload
package main
import (
"net/http"
"os"
"bytes"
"path"
"path/filepath"
"mime/multipart"
"io"
@avary
avary / nullHandle_extends.go
Created July 13, 2023 10:29 — forked from rsudip90/nullHandle_extends.go
database rows null handling in go by extending types
package main
import (
"database/sql"
"encoding/json"
"fmt"
"log"
"time"
"github.com/go-sql-driver/mysql"
@avary
avary / client.go
Created July 13, 2023 11:17 — forked from ZenGround0/client.go
Golang HTTP multipart streaming
package main
import (
"io"
"mime/multipart"
"net/http"
"net/url"
"os"
"fmt"
)