Skip to content

Instantly share code, notes, and snippets.

@nicholascw
nicholascw / i3bar-metar.zsh
Last active April 30, 2024 02:10
i3bar METAR information fetched from FAA AviationWeather.gov API
# For base16 colors, visit https://github.com/tinted-theming/base16-shell/tree/main
metar_bar () {
echo '{"version":1, "click_events":true}'
echo '['
echo "[{\"name\":\"refresh\",\"full_text\":\"Refreshing...\"}]"
while true
do
METAR_JSON=$(curl -s -X 'GET' "https://aviationweather.gov/api/data/metar?ids=$1&format=json&taf=false" -H "accept: text/plain")
METAR_GEOJSON=$(curl -s -X 'GET' "https://aviationweather.gov/api/data/metar?ids=$1&format=geojson&taf=false" -H "accept: text/plain")
@nicholascw
nicholascw / i3bar-mpris.zsh
Last active February 24, 2024 09:27
i3bar MPRIS control using zsh and playerctl
mpris_bar () {
echo '{"version":1, "click_events":true}'
echo '['
echo '[]'
mpris_cur_player=0
while :;
do
mpris_players=( $(playerctl -l) )
num_of_players=$#mpris_players
if [[ $num_of_players -eq 0 ]]; then
@jbinto
jbinto / howto-recover-google-authenticator-keys.txt
Created February 8, 2014 04:20
Recovering Google Authenticator keys from Android device for backup
### Last tested February 7 2014 on a Galaxy S3 (d2att) running Cyanogenmod 11 nightly, with Google Authenticator 2.49.
### Device with Google Authenticator must have root.
### Computer requires Android Developer Tools and SQLite 3.
### Connect your device in USB debugging mode.
$ cd /tmp
$ adb root
$ adb pull /data/data/com.google.android.apps.authenticator2/databases/databases