Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Hamilton Eriner

View GitHub Profile
@Eriner
Eriner / k.sh
Last active Sep 9, 2020
This now has a dedicated repository, https://github.com/soluble-ai/k.sh
View k.sh
#!/bin/sh
k() {
if [[ ${1} == 'prod' ]]; then
KUBECONFIG=${HOME}/.kube/configs/prod
shift
kubectl ${@}
else
kubectl ${@}
fi
View keycloak_dos_cve_2020_10758.zsh
#!/bin/zsh
# Keycloak Vuln disclosure: https://www.soluble.ai/blog/keycloak-cve-2020-10758
#
# LWN post about HTTP POST Content-Length DoS: https://lwn.net/Articles/418017/
#
# Original research by Wong Onn Chee in 2010: http://www.owasp.org/images/4/43/Layer_7_DDOS.pdf
i=20
host="http://mykeycloakinstall.example:9000"
@Eriner
Eriner / CAs.txt
Last active May 19, 2020
Enabled CAs
View CAs.txt
AAA Certificate Services
Amazon Root CA*
Apple Root*
Apple Worldwide Developer Relations Certificate Authority
Baltimore CyberTrust Root
com.apple.kerberos.kdc
com.apple.systemdefault
COMODO Certification Authority
COMODO ECC Certification Authority
COMODO RSA Certification Authority
@Eriner
Eriner / audit.json
Created Feb 19, 2020
Kubernets Audit JSON Sample
View audit.json
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "Request",
"auditID": "547daa8a-bed4-33a2-7bd4-43341aab43ae",
"stage": "RequestReceived",
"requestURI": "/apis/extensions/v1beta1/namespaces/default/deployments/soluble-deployment/scale",
"verb": "update",
"user": {
"username": "kubernetes-admin",
View keybase.md

Keybase proof

I hereby claim:

  • I am eriner on github.
  • I am eriner (https://keybase.io/eriner) on keybase.
  • I have a public key whose fingerprint is 9FB7 FB60 8A2E 26E0 50FD 90C3 05F4 3239 FAD2 4D05

To claim this, I am signing this object:

@Eriner
Eriner / compress_it.zsh
Last active Feb 24, 2018
Brotli and Zopfli compression script for my blog's static resources.
View compress_it.zsh
#!/usr/bin/env zsh
# https://gist.github.com/Eriner/6be8c43d8aff8134f7d8fb547612aadf
filetypes=(html xml css)
zcomp() {
print "zopfli compressing ${1}"
for file in ./_site/**/*.${1}; do
zopfli --i1000 ${file}
done
View tqdm.diff
4,5c4,5
< pkgname=python-${_pkgname}
< pkgver=1.0
---
> pkgname=(python-${_pkgname} python2-${_pkgname})
> pkgver=3.8.0
14,15c14
< provides=('python2-tqdm')
< conflicts=('python2-tqdm')
---
View palindrome.zsh
#!/usr/bin/env zsh
input=($(<${1}))
for word in ${input}; do
if [[ ${word} == $(print -n ${word} | rev) ]]; then
print "True"
else
print "False"
fi
View summation.zsh
#!/usr/bin/env zsh
numbers=($(<${1}))
for n in {1..${#numbers}..2}; do
first=${numbers[n]}
second=${numbers[$(( n + 1 ))]}
sum=0
for i in {${first}..${second}}; do
View ascii_stuffs.zsh
#!/usr/bin/env zsh
# xxd ignores the first byte for some reason, so pad it
hex="66 $(<${1})"
print ${hex} | xxd -r
You can’t perform that action at this time.