Scrubbing metadata and optimizing images for a static website

I like to illustrate my blog posts with my own photos, especially for my recipes. However, my phone is storing a lot of information in the EXIF metadata of the photos, such as my GPS location or the brand of my camera. This information is then visible by anyone who downloads a picture and checks its properties. I don’t want this data to be published on my website, so here is how to scrub the photos’ metadata in the command line on Ubuntu....

August 22, 2020

Installing plugins for GIMP on Linux

GIMP plugins are great but a bit hacky to install. Even for famous plugins such as Resynthesizer (which contains the super useful heal selection tool), the documentation recommends to download and copy-paste Python files into the installation directory. I installed GIMP as a Flatpak through the Software Center on Ubuntu. I had a pleasant surprise: a selection of plugins is available for one-click install. This functionality was mentionned nowhere in the documentation, since it came out in a recent release....

July 18, 2020

Running Rust tests from VS Code terminal

After installing Rust and configuring the Rust Language Server on VS Code, I wanted to run the tests directly from my IDE instead of typing cargo test in my terminal. However I was getting the following error: > Executing task: cargo test -- --nocapture test_fn < zsh:1: command not found: cargo The terminal process "/usr/bin/zsh '-c', 'cargo test -- --nocapture test_hex_to_u8'" failed to launch (exit code: 127). Terminal will be reused by tasks, press any key to close it....

July 12, 2020

How to describe a list of Kubernetes resources from a file

The usual way to describe a resource with kubectl is to call it by its name and namespace. For example, $ kubectl get pod gke-metadata-server-qqmt6 -n kube-system NAME READY STATUS RESTARTS AGE gke-metadata-server-qqmt6 1/1 Running 0 31h To get two resources, one can simply type both names at once. However for large number of resources, it is more convenient to provide a file containing a list of resources. This is the role of the option -f for describe or get....

June 23, 2020

Check your IP from the command line

TLDR; curl ifconfig.co This website, ifconfig.co, is pretty neat and useful when you play with VPNs and SSH. You can have a more detailed output with http ifconfig.co/json.

May 24, 2020

How to print UFW logs

TLDR; sudo tail -f /var/log/ufw.log The following applies to an Ubuntu server. The log files are usually in /var/log, list them with: sudo ls -l /var/log/ufw* It should return a list of log files like the following. The oldest ones are compressed: -rw-r----- 1 syslog adm 1383548 May 18 12:42 /var/log/ufw.log -rw-r----- 1 syslog adm 6492572 May 17 06:24 /var/log/ufw.log.1 -rw-r----- 1 syslog adm 1270159 May 11 06:24 /var/log/ufw.log.2.gz -rw-r----- 1 syslog adm 1459552 May 3 06:25 /var/log/ufw....

May 24, 2020

Installing Graphviz on MacOS

The Brew install did not work for me, so here is how to install the Graphviz backend with MacPorts. Install XCode. The complete AppStore version is not necessary: you can simply install the command line tools with xcode-select —install and click on ‘Install’ in the window that opens (if it is not already installed). Install MacPorts. There is a pkg installer for Catalina. In a new terminal, run sudo port -v selfupdate and then sudo port install graphviz If MacPorts returns with errors, you might have to fix some ports: sudo port -f activate xorg-xorgproto sudo port -f activate xorg-libX11 sudo port select --set python python38 If you use the Python API for Graphviz, you can run pip install graphviz in your dedicated environment, and import graphviz in your code....

March 31, 2020

How to do arrows in Markdown

If you ever wondered how to do the double headed arrow ↔ in Markdown, simply type &harr;. The shortcuts for the other arrows are more common and simpler to memorize! Here is a simple cheat sheet: Up arrow (↑): &uarr; Down arrow (↓): &darr; Left arrow (←): &larr; Right arrow (→): &rarr; Double headed arrow (↔): &harr; Enjoy! Arrows

August 7, 2019