Skip to content

Instantly share code, notes, and snippets.

@frank-dspeed
frank-dspeed / self-signed-certificate-with-custom-ca.md
Last active March 27, 2024 21:05 — forked from dkobia/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
@enyachoke
enyachoke / aes.go
Created January 15, 2019 06:51 — forked from tscholl2/aes.go
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
@yaxinr
yaxinr / go
Last active June 28, 2022 19:32
invoke(call) struct method in golang
package myreflect
import (
"fmt"
"reflect"
)
// Invoke - firstResult, err := invoke(AnyStructInterface, MethodName, Params...)
func Invoke(any interface{}, name string, args ...interface{}) (reflect.Value, error) {
method := reflect.ValueOf(any).MethodByName(name)
@Kaiepi
Kaiepi / csp.c
Last active May 7, 2021 02:53
CSP in C. Build with `gcc -o csp csp.c -lpthread`
#include <pthread.h>
#include <semaphore.h>
#include <stdlib.h>
#include <stdio.h>
struct channel_node {
void *val;
struct channel_node *next;
struct channel_node *prev;
};
@paolocarrasco
paolocarrasco / README.md
Last active May 20, 2024 10:32
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@tinti
tinti / aes-256-gcm.go
Last active May 8, 2021 15:37 — forked from cannium/aes-256-gcm.go
golang aes-256-gcm
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"flag"
"fmt"
"io"
@CAFxX
CAFxX / Colorized and formatted go tool objdump output.png
Last active July 7, 2023 17:51
Colorized and formatted go tool objdump output
Colorized and formatted go tool objdump output.png
@herotux
herotux / admin.py
Created May 11, 2018 11:32 — forked from padurets/admin.py
django rest api framework session auth example
from django.contrib import admin
from .models import User
admin.site.register([User])
@kkHAIKE
kkHAIKE / myrsa.go
Created April 8, 2018 03:40
golang rsa private key encrypt and public key decrypt
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/hex"
"encoding/pem"
"errors"
"fmt"