Skip to content

Instantly share code, notes, and snippets.

View johnelliott's full-sized avatar
🕳️
tunneling

John Elliott johnelliott

🕳️
tunneling
View GitHub Profile
@johnelliott
johnelliott / tailscale-hosts.sh
Created February 3, 2022 04:11
tailscale hosts
tailscale status --self=false | tr -s ' ' '\t' | cut -f1-2
@johnelliott
johnelliott / opentx-model-image-convert.sh
Created April 20, 2020 03:18
Convert OpenTX model images with ImageMagick
#!/usr/local/bin/bash
# convert should be from ImageMagick 7+
# e.g. $ cat input.jpg | ./opentx-model-image-convert.sh > output.bmp
convert - \
-resize 64x32 \
-gravity center \
-extent 64x32 \
-colorspace gray \

Tips for using PCD: https://github.com/kvannotten/pcd

... I also wanted [range downloads], but then I first used the seq and parallel programs. It's a very unix-y solution, but it turns out ids being integers is great. You may need to install and play with seq and parallel a bit, but this works for me:

episode downloads (echo must be removed for real downloading):

$ seq 4 10 |parallel echo pcd download mypodcast {}
pcd download mypodcast 4
pcd download mypodcast 5
pcd download mypodcast 6
@johnelliott
johnelliott / .vimrc.coworker.vim
Last active December 19, 2019 16:05
.vimrc.coworker.vim
unlet! skip_defaults_vim
if (filereadable($VIMRUNTIME .'/defaults.vim'))
source $VIMRUNTIME/defaults.vim
elseif (filereadable($VIMRUNTIME .'/vimrc_example.vim'))
source $VIMRUNTIME/vimrc_example.vim
endif
set noswapfile nobackup nojoinspaces gdefault ignorecase wildignorecase showcmd
set tabstop=4 expandtab softtabstop=2 shiftwidth=2
set undodir=~/.vim/undo clipboard=unnamed
#
# dump
# version
# Betaflight / STM32F7X2 (S7X2) 4.1.0 Aug 9 2019 / 11:41:22 (41a0b5938) MSP API: 1.42
# start the command batch
batch start
@johnelliott
johnelliott / html2jsonld
Created November 7, 2019 16:40
html2jsonld.sh
#!/usr/local/bin/bash
pup script[type=application/ld+json]|head -n2 |tail -n1|jq
@johnelliott
johnelliott / kubectlproxy.plist
Created April 16, 2019 22:21
kubectlproxy.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.kubelproxy.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/kubectl</string>
<string>proxy</string>
@johnelliott
johnelliott / chrome.service
Last active April 30, 2019 22:09
Raspi TV Web Dashboard
[Unit]
Description="Start chromium datadog on startup"
PartOf=graphical.target
[Service]
# public url https://my.prom
ExecStart=/usr/bin/chromium-browser --kiosk --disable-session-crashed-bubble --incognito "https://my.prom"
Restart=always
RestartSec=3
@johnelliott
johnelliott / create-macos-solid-color.sh
Created March 31, 2019 02:13
macOS desktop background solid color imagemagick script
#convert is from imagemagick
convert "xc:#$1[128x128!]" /Library/Desktop\ Pictures/Solid\ Colors/$1.png
#TODO find out how to make icon preview same aspect ratio as apple images