Skip to content

Instantly share code, notes, and snippets.

@wardenlym
wardenlym / rfc.md
Created March 7, 2022 06:09 — forked from eminetto/rfc.md
Template of RFCs

Title

Problem description

We must explain the problem clearly and identify additional details that the team needs to know. We must here describe the context, what we did so far, and the current state.

The description also serves as a trail that we can go back to in the future to understand the reasoning we had at the time and see what restrictions and requirements have changed.

Possible approaches

@wardenlym
wardenlym / bash-skel.sh
Created March 23, 2021 09:13
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...]

Keybase proof

I hereby claim:

  • I am wardenlym on github.
  • I am wardenlym (https://keybase.io/wardenlym) on keybase.
  • I have a public key whose fingerprint is 0452 7818 EA3D 4927 01C6 CCE7 ACAB 6A34 49A9 D35E

To claim this, I am signing this object:

@wardenlym
wardenlym / golang-tls.md
Created May 12, 2020 07:20 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@wardenlym
wardenlym / deploy-https-cas-3.5.2.md
Created April 27, 2020 09:14
deploy https cas 3.5.2
wget https://github.com/apereo/cas/releases/download/v3.5.2/cas-server-3.5.2-release.zip

java -version

sudo apt-get install -y openjdk-8-jdk

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
export JRE_HOME=${JAVA_HOME}/jre
export PATH=${PATH}:${JAVA_HOME}/bin
@wardenlym
wardenlym / cas-get.sh
Last active May 22, 2020 02:41
cas-get.sh
#!/bin/sh
set -e
# Usage: cas-get.sh <dest-service> <cas-host> <username> <password>
# ./cas-get.sh https://www.baidu.com https://casserver.herokuapp.com casuser Mellon
DEST="$1"
CAS_HOSTNAME="$2"
@wardenlym
wardenlym / Vagrantfile
Created December 10, 2019 07:22
macvlan test
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
@wardenlym
wardenlym / dynamic_crds.go
Created May 15, 2019 05:20 — forked from tallclair/dynamic_crds.go
Example of using CRDs with the dynamic go client
package main
import (
"fmt"
"log"
"os/user"
"path/filepath"
"strings"
apixv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
#!/bin/sh
set -e
type TreeNode struct {
Val int
Left *TreeNode
Right *TreeNode
}
func order1(root *TreeNode) [][]int {
r := [][]int{}
collect := func(nodes []*TreeNode) ([]int, []*TreeNode) {