Skip to content

Instantly share code, notes, and snippets.

@waywardone
waywardone / HEICToJPG
Created June 12, 2021 05:31
Convert HEIC to JPG. Tested in zsh
for f in *.HEIC; do echo ${f:t:r}; tifig -v -q 100 -i "$f" -o "${f:t:r}.JPG"; done

Convert Garmin FIT to GPX

# Tested in zsh
for f in *.fit; do echo ${f:t:r}; gpsbabel -i garmin_fit -f "$f" -o gpx -F "${f:t:r}.gpx"; done

Turn off onboard LEDs on Raspberry Pi

Add the following to /etc/rc.local. This has been verified as working on a Raspberry Pi 3 with the caveat that on power up and reboot, the LEDs are on briefly before being disabled.

for led in /sys/class/leds/*
do
  printf "Disabling LED: $led\n"
  sudo sh -c "echo 0 > $led/brightness"
 sudo sh -c "echo none > $led/trigger"

RDP to a host on a private network via SSH

                                            +--- Private Linux
Client - Internet - Public Linux --- ||| ---+
                                            +--- Private Windows

Assuming Public Linux can talk directly to Private Windows:

Generate random passwords on macOS

$ brew install pwgen

# In ~/.env.sh or ~/.zshenv
function genpasswd() { pwgen -1Bs $1 | pbcopy | pbpaste }

$ source ~/.zshrc
$ genpasswd 20

Occasionally, vim on the Raspberry Pi will throw multiple Sorry, the command is not available... errors when using the basic vimrc from amix/vimrc.

This is likely 'cos the vim-gui-common and/or vim-runtime packages are missing. Fix with:

sudo apt install vim-gui-common vim-runtime
@waywardone
waywardone / createEmptyFileOnWindows.md
Last active October 7, 2019 17:04
Create an empty file on Windows
@waywardone
waywardone / races.csv
Last active September 14, 2019 07:39
id state county distance total_distance
06041 California Marin 13.1 49.1
41005 Oregon Clackamas 10 10
53033 Washington King 13.1 13.1
48201 Texas Harris 5 5
06075 California San Francisco 23 49.1
06085 California Santa Clara 5 49.1
06081 California Sa Mateo 8 49.1