Skip to content

Instantly share code, notes, and snippets.

View phil-blain's full-sized avatar

Philippe Blain phil-blain

View GitHub Profile
@phil-blain
phil-blain / gen-ssh-profiles.py
Last active December 9, 2022 15:15
Generate Windows Terminal profiles for each host in your SSH config
#!/usr/bin/env python
import os
import uuid
import json
import urllib.request
import paramiko
# Watch out for https://github.com/paramiko/paramiko/pull/1991
@phil-blain
phil-blain / debugging-git.md
Last active May 11, 2024 11:17
Debugging Git for Git developers on Linux and macOS

Debugging Git

Some tips about debugging Git with GDB and LLDB.

Compiling Git for debugging

By default, Git's Makefile compiles Git with debug symbols (-g), but with optimization level -O2, which can lead to some variable being optimized out and thus making the executable harder to debug.

To compile with -O0, you can tweak CFLAGS using config.mak:

$ cat config.mak
@phil-blain
phil-blain / panoply-el-capitan.md
Last active June 7, 2020 19:34
How to install version 4.11.3 of the Panoply NetCDF viewer on macOS 10.11 El Capitan

Panoply is a viewer for NetCDF files. It's much more inviting to use then Ncview.

As of this writing, the Panoply 4.11.3 macOS download does not work correctly on my macOS 10.11 (El Capitan) system. The app launches but hangs when opening a file. I don't know much about debugging GUI macOS applications, but I know that Panoply is written in Java and Java works cross-platform, as long as you have a Java Runtime Environment installed. If you don't, the easiest way to install the JRE is from java.com.

So instead of using the macOS download, just use the Linux download, which simply contains a shell script to launch Panoply and the necessary Java jar files.

@phil-blain
phil-blain / git-imap-send-all-the-emails.md
Last active November 11, 2020 18:57
How to get `git imap-send` to accept any email

Email workflows with Git

Since Git was designed for the mailing-list heavy workflow of the Linux kernel development community, it has commands that make it easy to transform a commit (also known as a patch) into an email and vice-versa. For example, git format-patch, git am, git send-email and git imap-send.

While git send-email can be used to send a list of patches prepared using git format-patch to a development mailing list via an SMTP server, git imap-send is designed to upload git format-patch-prepared patches to an IMAP folder, so that they can then be sent using a regular mail client (maybe after tweaking the cover letter or the in-patch commentaries).

@phil-blain
phil-blain / .gitattributes
Last active March 29, 2024 22:38
Git pickaxe : show only relevant hunks (filter displayed hunks using the given search string)
*.md diff=markdown