tmux new [-s name] [cmd]
(:new
) - new session
tmux ls
(:ls
) - list sessionstmux switch [-t name]
(:switch
) - switches to an existing session
========================================== ========================================== | |
TMUX COMMAND WINDOW (TAB) | |
========================================== ========================================== | |
List tmux ls List ^b w | |
New -s <session> Create ^b c | |
Attach att -t <session> Rename ^b , <name> | |
Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
Kill kill-session -t <session> Close ^b & |
type Shape = | |
{ kind: "circle", radius: number } | | |
{ kind: "rectangle", w: number, h: number } | | |
{ kind: "square", size: number }; | |
function assertNever(obj: never) { | |
throw new Error("Unexpected object"); | |
} | |
function getArea(shape: Shape) { |
// String utils | |
// | |
// resources: | |
// -- mout, https://github.com/mout/mout/tree/master/src/string | |
/** | |
* "Safer" String.toLowerCase() | |
*/ | |
function lowerCase(str){ | |
return str.toLowerCase(); |
import org.reactivestreams.Subscription; | |
import java.time.LocalTime; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.TimeUnit; | |
import java.util.function.Consumer; | |
import reactor.core.publisher.BaseSubscriber; | |
import reactor.core.publisher.Flux; | |
import reactor.core.publisher.Mono; |
#!/bin/bash | |
# Author: Jay Dansand, Technology Services, Lawrence University | |
# Date: 10/17/2014 | |
# OpenSSL requires a port specification; default to 443. | |
SERVER="$1:443" | |
SERVER_HOST=$(echo "$SERVER" | cut -d ":" -f 1) | |
SERVER_PORT=$(echo "$SERVER" | cut -d ":" -f 2) | |
if [[ -z "$SERVER_HOST" || -z "$SERVER_PORT" ]]; then | |
echo "Usage: $0 host[:port] [ciphers [delay in ms]]" |
The OpenFaaS documentation for faas-netes gives a clear explanation of how to install with Helm, but Pivotal Container Service (PKS) has 2 caveats since provisoned Kubernetes clusters are non-RBAC but are token backed and LoadBalancer inclusion with NSX-T. This is going to be a quick streamline of the documentation that adds out of the box support for PKS.
$ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
$ kubectl -n kube-system create sa tiller && kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
$ helm init --skip-refresh --upgrade --service-account tiller
$ kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
$ helm repo add openfaas https://openfaas.github.io/faas-netes/
$ helm repo update && helm upgrade openfaa
<repositories>
<repository>
<id>local-maven-repo</id>
<url>file:///${maven.multiModuleProjectDirectory or project.basedir}/local-maven-repo</url>
</repository>
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.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \ | |
-keyout example.key -out example.crt -subj "/CN=example.com" \ | |
-addext "subjectAltName=DNS:example.com,DNS:www.example.net,IP:10.0.0.1" | |
openssl req -x509 -newkey rsa:4096 -sha256 -days 1825 -nodes \ | |
-keyout example.key -out example.crt -extensions san -config \ | |
<(echo "[req]"; | |
echo distinguished_name=req; | |
echo "[san]"; | |
echo subjectAltName=DNS:example.com,DNS:www.example.net,IP:10.0.0.1 |