Skip to content

Instantly share code, notes, and snippets.

View dcasati's full-sized avatar

Diego Casati dcasati

View GitHub Profile
@dcasati
dcasati / gist:106269802688f4ac76f0326e27222adf
Created January 17, 2021 18:20
executing cilium on a remote pod
# add this to your bashrc
cilium()(kubectl exec -it $(kubectl get pod -l k8s-app=cilium| head -n 2|tail -n 1 | awk '{print $1}') -- cilium $@)
@dcasati
dcasati / vcxsrv config
Created December 1, 2020 17:34
Running i3wm on WSL2 with two monitors (dual head)
C:\Program Files\VcXsrv>vcxsrv.exe -screen 0 @2 -wgl -nodecoration +xinerama -screen 1 @3 -wgl -nodecoration +xinerama -ac
then add this to your ~/.config/i3/config file:
fake-outputs 1920x1200+0+0,1920x1200+1920+0
@dcasati
dcasati / git-squash
Created April 25, 2019 21:12
git squash commit
# Switch to the master branch and make sure you are up to date.
git checkout master
git fetch # this may be necessary (depending on your git config) to receive updates on origin/master
git pull
# Merge the feature branch into the master branch.
git merge feature_branch
# Reset the master branch to origin's state.
git reset origin/master
@dcasati
dcasati / dakboard-pi
Created April 15, 2019 16:17
Dakboard Install on Raspberry Pi
# from https://www.raspberrypi.org/magpi/dakboard-wall-display/
# before proceeding, open the Raspberry Pi SD Card (mount that on Linux/Mac) and add the following:
#
# 1. enable ssh
# a) create an empty file called `ssh`.
# 2. enable wifi
# a) create a filled called `wpa_supplicant.conf` with a content similar to this.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Keybase proof

I hereby claim:

  • I am dcasati on github.
  • I am dcasati (https://keybase.io/dcasati) on keybase.
  • I have a public key ASCaWwh1ftEBAwbuCHA029qiOLWp-96IWAJtxxhSjeTCrQo

To claim this, I am signing this object:

@dcasati
dcasati / requirements.txt
Created March 7, 2019 00:04 — forked from zoni/requirements.txt
Example Python WSGI app which displays the hostname of the system it runs on when accessing /hostname
flask
@dcasati
dcasati / tcpdump-kubernetes
Created March 6, 2019 19:54
visualize a tcpdump capture from a Kubernetes POD on Wireshark in real time
run tcpdump on a POD and then (live) see that information through wireshark locally on my machine. the magic of ssh and fifo 
Topology
--------
[laptop with wireshark] ------> [AKS Node] ----> [POD (tcpdump is here)]. 
1. create the fifo on your local machine (where wireshark will run)
mkfifo /tmp/remote-capture.fifo
2. execute the following command to send traffic from within a POD to the stdout. This will then be redirected to the fifo locally
1. Create an user on the cisco device
username dcasati privilege 15 secret MYbiGsecrRETThatOnlyIknoW
2. Convert your pub key to less than 254 characters (otherwise it will not work)
$ fold -b -w 72 ~/.ssh/id_rsa.pub
3. Create the key
conf t
ip ssh pubkey-chain
@dcasati
dcasati / gist:f116827c425c4d2849f7ebd5477c1452
Last active March 5, 2019 22:44
i3wm on a multi-monitor setup (laptop + external display)
xrandr --output HDMI1 --scale 2x2 --mode 1920x1200 --fb 3840x4200 --pos 0x0
xrandr --output eDP1 --scale 1x1 --pos 320x2400
@dcasati
dcasati / freebsd-bluetooth-mouse.txt
Created July 5, 2018 21:00
Configure FreeBSD Bluetooth Mouse
Add to /boot/loader.conf:
ng_ubt_load="YES"
Add to /etc/rc.conf:
hcsecd_enable="YES"
sdpd_enable="YES"
bthidd_enable="YES"
Reboot, or run: