Skip to content

Instantly share code, notes, and snippets.

@kitingChris
kitingChris / arch-linux-install
Last active March 14, 2019 21:12 — forked from binaerbaum/arch-linux-install
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set german keymap
@kitingChris
kitingChris / stash-pop-recover
Created May 23, 2019 16:15 — forked from davidwalter0/stash-pop-recover
Undoing accidental git stash pop
# https://stackoverflow.com/questions/6543519/undoing-accidental-git-stash-pop
# https://stackoverflow.com/questions/89332/how-to-recover-a-dropped-stash-in-git
accepted
If you have only just popped it and the terminal is still open, you will still have the hash value printed by git stash pop on screen (thanks, Dolda).
Otherwise, you can find it using this for Linux and Unix:
git fsck --no-reflog | awk '/dangling commit/ {print $3}'
and for Windows:
@kitingChris
kitingChris / idea.sh
Created May 8, 2021 18:37
Launching current Intellij Idea version
#!/usr/bin/env bash
$($(cat /usr/local/share/applications/jetbrains-idea.desktop ~/.local/share/applications/jetbrains-idea.desktop 2>/dev/null | grep -m1 -Eo '^Exec="(.*)"' | cut -d'"' -f2) "$@")
@kitingChris
kitingChris / docker-entrypoint.sh
Created March 2, 2022 19:39
docker-entrypoint.sh for ReactApps with pm2 and environment variable substitution on startup
#!/usr/bin/env sh
env | grep "REACT_APP_" | while IFS= read -r line; do
var=${line%%=*}
val=$(printf '%s\n' "${line#*=}" | sed -e 's/[\/&]/\\&/g')
find . -type f -regex '.*\.\(html\|js\|js\.map\|css\|css\.map\|json\|svg\)' \
-exec sed -i "s/{{$var}}/$val/g" {} +
done
command -v pm2 > /dev/null && status="$?" || status="$?"
@kitingChris
kitingChris / pyenv-python-install.sh
Last active August 16, 2023 15:36
Install pyenv and python 3.10 on Ubuntu
## Basic requirements for python development
sudo apt-get install build-essential zlib1g-dev libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev
## Tkinter support
sudo apt-get install tk-dev
## PyAudio support
sudo apt-get install portaudio19-dev
## ffmpeg support
@kitingChris
kitingChris / autorun.sh
Last active January 22, 2025 15:48
Autorun Backup on mounted disk
#!/usr/bin/env bash
DIRECTORIES="/etc /home /usr/local /opt"
EXCLUDES="/home/chris/.local/share/Cryptomator"
USER=chris
MOUNT_LABEL="BackupDisk"
ALLOWED_MACHINES="CENTAURI"
RSYNC_PARAMETERS="-avPEHh --delete --stats --dry-run"
# Ensure rsync is available
@kitingChris
kitingChris / recursivecat.sh
Last active August 28, 2025 09:27
recursivecat
#!/bin/bash
set -e
SCRIPT_NAME=$(basename "$0")
print_help() {
cat << EOF
$SCRIPT_NAME: Recursively print matching files with content and separators.