Skip to content

Instantly share code, notes, and snippets.

View r0mdau's full-sized avatar

Romain Dauby r0mdau

View GitHub Profile
@r0mdau
r0mdau / script.sh
Created November 24, 2023 00:27
Bash scripts cheat reliability sheet
#!/bin/bash
# Enable debug mode
set -x
# Log function
log() {
echo "[INFO] $1"
}
@r0mdau
r0mdau / portForward.ps1
Created June 6, 2023 22:56
Windows port-forward to WSL2
# port forwarding
netsh interface portproxy add v4tov4 listenport=8090 listenaddress=0.0.0.0 connectport=8080 connectaddress=127.0.0.1
# allow in firewall
netsh advfirewall firewall add rule name=”WSL2 Forward Port 8090” dir=in action=allow protocol=TCP localport=8080
@r0mdau
r0mdau / autoresponse.txt
Created November 29, 2022 00:40
Career Advice Nobody Gave Me: Never ignore a recruiter
Thanks so much for reaching out. I'm always interested in hearing about what new and exciting opportunities are out there. As a software engineer I'm sure you can imagine that I get a very high volume of recruiters reaching out on LinkedIn. It is a wonderful position of privilege to be in and I'm thankful for it.
It does however mean that I don't have the time to hop on a call with everyone who reaches out. A lot of the time, incoming messages represent a very poor fit indeed.
I would love to continue the conversation, but before I do, I'd like to set around the level of seniority that you're looking for.
Can you send along the company name, a job description and, total compensation details for the role you're reaching out in reference to?
While I very much appreciate the fact that exceptionally talented and engaged recruiters reach out consistently, sorting serious and high quality opportunities from spam would be a full time job without an autoresponder.
@r0mdau
r0mdau / curl.sh
Created April 25, 2022 17:39
Get the CA for curl
# 1 get the cert
echo quit | openssl s_client -showcerts -servername server -connect example.com:443 > example.com.pem
# 2 use it in curl command to test it
curl --cacert example.com.pem https://example.com
# 3 add it to your certificates store (Debian)
sudo mv example.com.pem /usr/share/ca-certificates/example.com.crt
# 4 update the store
sudo dpkg-reconfigure ca-certificates
# 4 bis
sudo update-ca-certificates --fresh
@r0mdau
r0mdau / asciinema.md
Created February 1, 2022 17:05
Record a linux terminal

Install asciinema using apt :

apt install asciinema

Install svg-term using npm :

sudo npm install -g svg-term-cli

Record the terminal :

@r0mdau
r0mdau / prom.md
Last active July 13, 2022 20:05
Prometheus cardinality stats

Prometheus cardinality stats queries:

sum(scrape_series_added) by (job)
sum(scrape_samples_scraped) by (job)
prometheus_tsdb_symbol_table_size_bytes

Doc:

scrape_series_added{job="", instance=""}: the approximate number of new series in this scrape.
@r0mdau
r0mdau / README.md
Last active December 28, 2023 23:33
Rust Actix vs Rust Hyper vs Go fasthttp vs Go net/http httprouter

Load tests

Injector

wrk is the binary used as injector, always used with these options:

./wrk -t12 -c1000 -d15s http://127.0.0.1:8080/

Results

@r0mdau
r0mdau / sha256sum.sh
Created April 26, 2021 20:00
One line to check sha256sum of file and exit if not good
#!/bin/bash
echo b298d29de9236ca47a023e382313bcc2d2eed31dfa706b60a04103ce83a71a25 go1.16.3.src.tar.gz | sha256sum --check --status
@r0mdau
r0mdau / delete-from-v2-docker-registry.md
Last active March 30, 2021 23:59 — forked from jaytaylor/delete-from-v2-docker-registry.md
One liner for deleting images with all associated tags and a progress bar from a v2 docker registry

One liner for deleting images from a v2 docker registry

Just plug in your own values for registry and repo/image name.

#!/bin/bash
registry='localhost:5000'
name='my-image'

tags=$(curl -sSL "http://${registry}/v2/${image}/tags/list" | jq -r '.tags[]')
@r0mdau
r0mdau / resolution.sh
Last active March 11, 2021 23:01
Add screen resolution xrandr
sudo cvt 2560 1080
sudo xrandr --newmode "2560x1080_60.00" 230.00 2560 2720 2992 3424 1080 1083 1093 1120 -hsync +vsync
sudo xrandr --addmode HDMI-1 2560x1080_60.00