Skip to content

Instantly share code, notes, and snippets.

View lukechilds's full-sized avatar
☂️
Building @getumbrel

Luke Childs lukechilds

☂️
Building @getumbrel
View GitHub Profile
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
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 / findbigfiles.sh
Last active March 13, 2024 12:04
List all files on filesystem in size order
sudo du -h -a / 2>/dev/null | sort -h -r
@lukechilds
lukechilds / install-cross-platform-emulators.md
Created October 25, 2022 06:14
Install cross platform emulators for Docker

Installs all cross platform emulators for use with docker buildx

docker run -it --rm --privileged tonistiigi/binfmt --install all
@lukechilds
lukechilds / how-to-install-tor.md
Last active March 20, 2023 16:25
How to install Tor

How to install Tor on your system

macOS

  • Open the "Terminal" app on your Mac and install Homebrew by running:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Install Tor by running:
brew install tor
@lukechilds
lukechilds / github-compare-to-release-notes.md
Created October 25, 2022 11:41
GitHub Compare to Release Notes

Generate pretty markdown release notes from GitHub compare view

Go to GitHub compare view between two release tags and dump the following in devtools:

copy(Array.from(document.querySelectorAll('#commits_bucket .Box-row')).map(e => {
    const commitTitle = e.querySelector('.Details p').textContent.replace(//g, '').trim();
    const authors = Array.from(e.querySelectorAll('.commit-author')).map(e => '@' + e.textContent);
    const commitUrl = e.querySelector('a[href*=\'/commit/\']').href;
 return `- ${commitTitle} - ${authors.join(' ')} ${commitUrl}`;
@lukechilds
lukechilds / readme.md
Created December 11, 2019 16:23
ffmpeg compress

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.

@lukechilds
lukechilds / tor-ssh.sh
Last active September 21, 2021 16:06
Setup or remove an SSH hidden service on Debian based systems
#!/usr/bin/env bash
#
# Setup or remove an SSH hidden service on Debian based systems.
#
# Usage:
#
# Setup SSH hidden service:
# $ curl -Ls https://git.io/tor-ssh | bash -s -- --setup-tor-ssh
#
# Remove SSH hidden service:
@lukechilds
lukechilds / fix-umbrel-background-services.md
Last active March 10, 2021 02:11
Fix Umbrel Background Services

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 / umbrel-ubuntu-20-04-x86.md
Last active March 3, 2021 07:21 — forked from mayankchhabra/umbrel-ubuntu-20-04-x86.md
Installing Umbrel on Ubuntu 20.04 x86

Install Umbrel v0.3.7

sudo apt update -y
sudo apt install -y fswatch jq rsync curl
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo mkdir ~/umbrel