Skip to content

Instantly share code, notes, and snippets.

View nexus166's full-sized avatar
🌪️
🐧

nexus166

🌪️
🐧
  • Earth
View GitHub Profile
@nexus166
nexus166 / kubectl-root-in-host.sh
Last active May 24, 2019 05:12 — forked from jjo/kubectl-root-in-host-nopriv.sh
`privileged: true` + `nsenter`
#!/bin/sh
node=${1}
if [ -n "${node}" ]; then
shift
nodeName=$(kubectl get node ${node} -o template --template='{{index .metadata.labels "kubernetes.io/hostname"}}') || exit 1
nodeSelector='"nodeSelector": { "kubernetes.io/hostname": "'${nodeName:?}'" },'
podName=${USER+${USER}-}sudo-${node}
else
nodeSelector=""
podName=${USER+${USER}-}sudo
@nexus166
nexus166 / web-servers.md
Created March 16, 2019 15:19 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@nexus166
nexus166 / golang-tls.md
Last active March 9, 2019 19:51 — 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)