Skip to content

Instantly share code, notes, and snippets.

@acacio
acacio / libfido2-test.md
Created September 1, 2024 02:36 — forked from ueno/libfido2-test.md
Testing FIDO2 with libfido2

Install libfido2 package from copr

$ sudo dnf copr enable gtb/libfido2

Create a credential (a keypair on the token)

Create a parameters file

$ echo credential challenge | openssl sha256 -binary | base64 > cred_param
@acacio
acacio / autocert.go
Created August 5, 2024 23:11 — forked from alexedwards/gist.go
ACME Autocert for Go
package main
import (
"crypto/tls"
"flag"
"fmt"
"log"
"net/http"
"time"
@acacio
acacio / servers.csv
Created June 5, 2023 15:57 — forked from ofou/servers.csv
List of servers to test speedtest-cli
We can't make this file beautiful and searchable because it's too large.
Country,City,Provider,Host,ID
Abkhazia,Sukhum,Aquafon GSM,62.182.8.78:8080,9058
Abkhazia,Sukhum,"Systema, LTD",cyxym.net:8080,5089
Abkhaziya,Sukhum,A-Mobile,speedtest.a-mobile.biz:8080,9714
Afghanistan,Herat,Afghan Wireless,hrtspeedtest.afghan-wireless.com:8080,9622
Afghanistan,Kabul,Afghan Telecom,sp1.afghantelecom.af:8080,11019
Afghanistan,Kabul,etisalat Afghanistan,speedtest.etisalat.af:8080,21807
Afghanistan,Kabul,Afghan Wireless,speedtest.afghan-wireless.com:8080,5189
Afghanistan,Kabul,Afghan Wireless Communication Company,kdzspeedtest.afghan-wireless.com:8080,13501
Afghanistan,Kabul,Insta Telecom,speedtest.instatelecom.com:8080,12798
@acacio
acacio / rsa_util.go
Created November 14, 2021 20:03 — 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"
)
@acacio
acacio / dsa.go
Created January 5, 2021 21:13 — forked from xjdrew/dsa.go
DSA example
package main
import (
"crypto/dsa"
"crypto/rand"
"crypto/sha1"
"crypto/x509"
"encoding/asn1"
"encoding/pem"
"errors"
@acacio
acacio / client.go
Created January 5, 2021 21:08 — forked from xjdrew/client.go
golang tls client and server, require and verify certificate in double direction
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
@acacio
acacio / script-template.sh
Created December 21, 2020 10:31 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@acacio
acacio / main.go
Created February 16, 2020 21:00 — forked from walm/main.go
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@acacio
acacio / git-remove-file.sh
Created December 5, 2018 13:45 — forked from bartlomiejdanek/git-remove-file.sh
remove file from git history
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0