Skip to content

Instantly share code, notes, and snippets.

View kmatt's full-sized avatar
😐

Matt Keranen kmatt

😐
  • SE US
View GitHub Profile
@kmatt
kmatt / gist:af459f7cf3e43db1de63a87940432673
Created July 31, 2020 16:51
PostgreSQL JDBC: SSL client key format
openssl pkcs8 -nocrypt -topk8 -inform PEM -outform DER -in client-key.pem -out client-key.pk8
@kmatt
kmatt / simplenamespace.py
Created July 28, 2020 00:54
Python JSON to SimpleNamespace Object
obj = json.loads(json.dumps(js), object_hook=lambda x: Namespace(**x))
js = vars(obj) # obj.__dict__
@kmatt
kmatt / what-is-my-ip-tcpdump
Last active June 17, 2020 23:45
What is my IP tcpdump
# Host
$ tcpdump -i ${iface} -nn port 5555
# Client
$ telnet ${hostip} 5555
# https://github.com/docker/for-linux/issues/123#issuecomment-346546953
ip link add name docker0 type bridge
ip addr add dev docker0 172.17.0.1/16
@kmatt
kmatt / colors
Created June 14, 2020 01:56 — forked from bohoomil/colors
show Xresources colours
#!/bin/sh
colors=($(xrdb -query | sed -n 's/.*color\([0-9]\)/\1/p' | sort -nu | cut -f2))
echo -e "\e[1;37m
Black Red Green Yellow Blue Magenta Cyan White
───────────────────────────────────────────────────────────────────────────────────────\e[0m"
for i in {0..7}; do echo -en "\e[$((30+$i))m β–ˆ ${colors[i]} \e[0m"; done
echo
for i in {8..15}; do echo -en "\e[1;$((22+$i))m β–ˆ ${colors[i]} \e[0m"; done
Xft.dpi: 192
URxvt.font: xft:FiraMono-Regular:size=10
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
@kmatt
kmatt / xlcompare.py
Last active May 17, 2020 19:13 — forked from sanzoghenzo/compare.py
Compare Excel sheets with Pandas
"""
Compare two Excel sheets
Inspired by https://pbpython.com/excel-diff-pandas-update.html
For the documentation, download this file and type:
python compare.py --help
"""
import argparse
import pandas as pd
@kmatt
kmatt / dwm-install.sh
Last active March 19, 2024 10:37
Dwm simple install
# http://dwm.suckless.org/
# s/dnf/rpm-ostree/ for Silverblue
# Xorg requirements
sudo dnf install xorg-x11-server-Xorg xorg-x11-drv-evdev xorg-x11-xinit xorg-x11-xinit-session xterm lightdm
# Build deps
sudo dnf install git make automake gcc gcc-c++
sudo dnf install libX11-devel libXft-devel libXinerama-devel libXrandr-devel
@kmatt
kmatt / node_tableau_services.sh
Last active February 10, 2020 23:44
Simple service status count for Prometheus monitoring of Tableau Server
# Configure node_exporter to start with --collector.processes --collector.textfile.directory=/var/lib/node_exporter
# Allow system information to be queried without a Tableau user
$ tsm configuration set -k wgserver.systeminfo.allow_referrer_ips -v {node_exporter host IP}
# Script to populate a text file with service status and count
$ cat << EOM >> /usr/local/bin/node_tableau_services
curl -s http://{Tableau Server Host}:/admin/systeminfo.xml | awk '/worker=/ { gsub(/[<\/>]/, "", $0); sub(/:[0-9]+/, "", $2); p["tableau_server_process_status {"$2 ",process=\"" $1 "\"," $3 "}"]++ } END { for (i in p) print i, p[i] }' > /tmp/tableau_services
mv -f /tmp/tableau_services /var/lib/node_exporter/tableau_services.prom
EOM
@kmatt
kmatt / spike-day-02-03-20.md
Created February 6, 2020 15:22 — forked from cldwalker/spike-day-02-03-20.md
GraalVM dive in Clojure at work

Spike

I looked into the state of GraalVM and Clojure and wrote some small work-related scripts.

GraalVM Build Tools