Skip to content

Instantly share code, notes, and snippets.

@zesty
zesty / gist:00da1cf0e11aee585b104c81e65d0dab
Created April 24, 2022 20:15
owasp zap update latest download
% cat zapup.sh
#!/bin/zsh
cd $HOME/Downloads
curl -s https://raw.githubusercontent.com/zaproxy/zap-admin/master/ZapVersions.xml | xmllint --xpath '//core/daily/url/text()' - > /tmp/zzzzap
if [[ -z "$(find $HOME/Downloads -name 'ZAP_D*' | head -1)" ]] || ! $(grep $(ls -d ZAP_D* | sed -e "s/ZAP_//") /tmp/zzzzap >& /dev/null)
then
/bin/rm -f $HOME/Downloads/zap
@zesty
zesty / kalidocker.txt
Last active May 14, 2022 10:02
kali linux via docker on ubuntu with vnc
mkdir $HOME/kali
# assumes you're in the docker group ...
# if you want net_admin inside the container
# docker run -td --name mykali --network host -v $HOME/kali:/tmp/home --device=/dev/net/tun --cap-add=net_admin kalilinux/kali-rolling
docker run -td --name mykali --network host -v $HOME/kali:/tmp/home kalilinux/kali-rolling
docker exec -it mykali bash
apt update
# tested on ubuntu 20.04
k3d cluster create mycluster --port 8080:80@loadbalancer --port 8443:443@loadbalancer
kubectl get all
kubectl create -f helloworld.yaml
kubectl expose deployment helloworld
kubectl create -f helloworld-ingress.yaml
kubectl get pod,svc,ing
# http://localhost:8443 the default self-signed traefik cert will cause a browser warning, but it does work
@zesty
zesty / afm_fonts.py
Last active August 8, 2020 06:44
afm fonts have odd font weights
# inspect the afm fonts
# I punted and went with: matplotlib.font_manager.weight_dict
# see: https://gist.github.com/zesty/de6f872908add8aca3c3a156431baa3b for the pretty stuff
# ref: Commonly used names for CSS font-weight values https://gist.github.com/lukaszgrolik/5849599
import pandas as pd
import matplotlib.font_manager
df = pd.DataFrame(
# [(f.name, f.stretch, f.style, f.variant, f.weight, f.size) for f in matplotlib.font_manager.fontManager.ttflist] +
@zesty
zesty / fonts.py
Last active August 9, 2020 03:23
More complete view of available fonts in matplotlib (jupyter)
# run this in a jupyter notebook; looks much better in jupyter lab
# based on: http://jonathansoma.com/lede/data-studio/matplotlib/list-all-fonts-available-in-matplotlib-plus-samples/
import matplotlib.font_manager
from IPython.core.display import HTML
def make_html(font, fonts):
default_size = '26px'
html = f"<p>{font}<br>"