Skip to content

Instantly share code, notes, and snippets.

View jacekbj's full-sized avatar
💻

Jacek Bronski-Jankowski jacekbj

💻
View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@jacekbj
jacekbj / check_md5sum.sh
Created March 7, 2022 19:20
Check md5 sum of a downloaded file
if [ $checksum == "$(md5sum virtualbox-6.1_6.1.32-149290~Ubuntu~eoan_amd64.deb | cut -f1 -d' ')" ]; then
echo "Equal"
else
echo "Not equal"
fi
@jacekbj
jacekbj / git.md
Created May 10, 2020 16:46
Git tricks

List changed files

git log --stat

Push force but fail if it would overwrite somebody's else changes:

git push --force-with-lease
@jacekbj
jacekbj / helm.md
Last active April 13, 2020 08:38
Helm

Install a release

helm install my-installation ./mychart
# dry run
helm install --debug --dry-run my-installation ./mychart
# pass a variable from CLI
helm install --set drink=cofee my-installation ./mychart
# load file with variables
helm install -f ./variables-override.yaml my-installation ./mychart
# set default value to null to remove it
@jacekbj
jacekbj / k8s.sh
Last active April 13, 2020 08:50
k8s
minikube start --driver=virtualbox
minikube status
minikube stop
minikube delete // Removes state from previous run
@jacekbj
jacekbj / bash-tools.md
Last active August 25, 2021 08:16
bash tools

Format input if it's JSON

some-command | jq -R -r '. as $line | try fromjson catch $line'

Run command in a loop with substitution

array=( one two three )
for i in "${array[@]}"; do commaind $i ; done
@jacekbj
jacekbj / image-magick.md
Last active August 10, 2022 07:31
ImageMagick

convert SVG to PNG with transparency

convert -background none "logo (1).svg" logo-wc.png

resize image (set width to 100px, preserve aspect ratio)

convert in.jpg -resize 100 out.jpg
@jacekbj
jacekbj / high-performance-python.md
Last active February 3, 2020 18:18
"Python High Performance" notes

"Python High Performance" - things I didn't know or forgot about.

I worked on Python web apps, wrote some Tornado code, crunched data in Pandas and PySpark. Hell, I even knitted something together in OpenCV and scikit-learn (university, I miss you). However, no task can ever give you a chance to practice each and every part of language and package ecosystem. It's always good to sharpen your saw, so I decided to refresh my knowledge a bit and get my hands on excellent "Python High Performance" by Gabriele Lanaro. I will share with you my notes, which consist of 3 types of notes:

  • snippets I want to keep,
  • things I didn't know,
  • things I forgot about and I never want to again.
alias fixssh='export SSH_AUTH_SOCK=$(find /tmp -path '*/ssh-*' -name 'agent*' -uid $(id -u) 2>/dev/null | tail -n1)'