Skip to content

Instantly share code, notes, and snippets.

Avatar
☂️
Building @getumbrel

Luke Childs lukechilds

☂️
Building @getumbrel
View GitHub Profile
@lukechilds
lukechilds / get_latest_release.sh
Created Aug 9, 2016
Shell - Get latest release from GitHub
View get_latest_release.sh
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@lukechilds
lukechilds / fix-umbrel-background-services.md
Last active Oct 8, 2020
Fix Umbrel Background Services
View fix-umbrel-background-services.md

Fix Umbrel Background Services

If you aren't able to run OTA updates, you can do the following to resolve the situation:

Umbrel OS (Raspberry Pi)

If you're running the normal Umbrel OS install on a Raspberry Pi you can run this in a terminal on a computer connected to the same network as your Umbrel:

ssh -t umbrel@umbrel.local "mkdir -p umbrel/logs && sudo systemctl restart umbrel-startup"
@lukechilds
lukechilds / fix-custom-umbrel-install.md
Last active Oct 6, 2020
Fix OTA updates on custom Umbrel installs
View fix-custom-umbrel-install.md

Fix OTA updates on custom Umbrel installs

⚠️ Important: You only need to follow these instructions if you have a custom Umbrel install. If you're running Umbrel OS on a Raspberry Pi you can safely ignore this.

Custom Umbrel OS installs that started Umbrel with sudo scripts/start in an SSH sessions and then closed the SSH session encountered a bug where the OTA update script would not work due to missing file descriptors.

This has now been fixed (getumbrel/umbrel#269), however the update process for existing users involves manual steps.

View capture-tmux-scrollback-buffer.md

Capture tmux scrollback buffer

Using tmux session

Ctrl-b + :

capture-pane -S -10000

Ctrl-b + :

View keyv-dependents.md
View openpgp.md
@lukechilds
lukechilds / findbigfiles.sh
Last active May 29, 2020
List all files on filesystem in size order
View findbigfiles.sh
sudo du -h -a / 2>/dev/null | sort -h -r
View psbttest.js
const bitcoin = require('bitcoinjs-lib')
const regcli = require('regtest-client')
const bs58 = require('bs58check')
const APIURL = process.env['APIURL'] || 'http://127.0.0.1:8080/1';
const APIPASS = process.env['APIPASS'] || 'satoshi';
const regtestUtils = new regcli.RegtestUtils({ APIURL, APIPASS })
const network = bitcoin.networks.regtest
const rootNode = bitcoin.bip32.fromBase58('tprv8ZgxMBicQKsPfBD2PErVQNAqcjwLBg8fWZSX8qwx1cRyFsDrgvRDLqaT5Rf2N4VEXZDAkpWeJ9vXXREbAUY67RtoZorrfxqgDMxsb6FiBFH', network)
async function main() {
@lukechilds
lukechilds / bench.md
Created Feb 27, 2020
Simple multithreaded shell benchmark
View bench.md

Simple multithreaded shell benchmark

# 1 thread
$ time bench()

real    0m46.143s
user    0m45.798s
sys     0m0.188s
@lukechilds
lukechilds / readme.md
Created Dec 11, 2019
ffmpeg compress
View readme.md

ffmpeg compress

Re-encodes an input file as an MP4 with a constant rate factor of 24

ffmpeg -i input.mov -crf 24 output.mp4

Lower crf value means higher quality and larger file size. 24 gives reasonable results with good compression.

You can’t perform that action at this time.