Skip to content

Instantly share code, notes, and snippets.

@junftnt
junftnt / tun-ping-linux.go
Created January 28, 2023 04:01 — forked from glacjay/tun-ping-linux.go
Reading/Writing Linux's TUN/TAP device in Go.
package main
import (
"exec"
"log"
"os"
"syscall"
"unsafe"
)
@junftnt
junftnt / OVN.md
Created January 25, 2023 19:57 — forked from odivlad/OVN.md
OVN cheat sheet

Manpages

Architecture:

man ovn-architecture

OVN_Northbound:

@junftnt
junftnt / client.go
Created January 14, 2023 01:23 — forked from ZenGround0/client.go
Golang HTTP multipart streaming
package main
import (
"io"
"mime/multipart"
"net/http"
"net/url"
"os"
"fmt"
)
@junftnt
junftnt / wq.go
Created October 17, 2022 04:49 — forked from wallyqs/wq.go
Pull Subscribe + WorkQueuePolicy
package main
import (
"context"
"encoding/json"
"errors"
"math"
"time"
"log"
@junftnt
junftnt / gpg-import-and-export-instructions.md
Created October 10, 2022 03:40 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@junftnt
junftnt / ovs-cheat.md
Created August 16, 2022 03:46 — forked from djoreilly/ovs-cheat.md
OVS cheat sheet

DB

ovs-vsctl list open_vswitch
ovs-vsctl list interface
ovs-vsctl list interface vxlan-ac000344
ovs-vsctl --columns=options list interface vxlan-ac000344
ovs-vsctl --columns=ofport,name list Interface
ovs-vsctl --columns=ofport,name --format=table list Interface
ovs-vsctl -f csv --no-heading --columns=_uuid list controller
ovs-vsctl -f csv --no-heading -d bare --columns=other_config list port
@junftnt
junftnt / self-signed-certificate-with-custom-ca.md
Created September 10, 2021 17:22 — forked from frank-dspeed/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@junftnt
junftnt / Chromium Linux.md
Created September 10, 2021 03:33 — forked from marians/Chromium Linux.md
How to install CA certificates and PKCS12 key bundles on different platforms

We install certutil and pk12util if necessary:

sudo apt install libnss3-tools

On Linux, Chromium uses the NSS Shared DB. Check if you have the ~/.pki/nssdb directory:

ls $HOME/.pki/nssdb
@junftnt
junftnt / self-signed-certificate-with-custom-ca.md
Created September 9, 2021 02:45 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@junftnt
junftnt / how-to-generate-and-use-private-keys-with-openssl-tool.md
Created September 9, 2021 02:35 — forked from briansmith/how-to-generate-and-use-private-keys-with-openssl-tool.md
How to generate & use private keys using the OpenSSL command line tool

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use