Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

npodonnell npodonnell

🎯
Focusing
View GitHub Profile
View wg-switcher.sh
#!/usr/bin/env bash
#
# Switch between Wireguard tunnels located in /etc/wireguard/
# Each tunnel should be defined with a config file, eg. wg0.conf
#
# N. P. O'Donnell, 2022
if [[ $# -ne 1 ]]; then
echo "Usage: $0 [OPTIONS] [<new tunnel>]"
echo
View run-in-parallel.sh
#!/usr/bin/env bash
NTOK=3
do_cmd() {
echo "Command start $1"
sleep 5
echo "Command end $1"
return 1
}
@npodonnell
npodonnell / luks_encryption_cheatsheet.md
Last active Mar 13, 2022
LUKS Encryption Cheatsheet
View luks_encryption_cheatsheet.md

LUKS Encryption Cheatsheet

N. P. O'Donnell, 2021

Before you do anything, ensure you have cryptsetup installed:

sudo apt-get install -y cryptsetup
View xen_cheatsheet.md

Xen Cheatsheet

N. P. O'Donnell, 2021

Run without sudo

There may be other ways to do this, but I use the following alias:

alias xen="sudo xen $@"
View ubuntu-2110-in-docker.sh
#!/usr/bin/env bash
#
# Creates a persistent, SSHable ubuntu 21.10 in a container, including tmux.
docker stop my-ubuntu-ctr
docker rm my-ubuntu-ctr
docker rmi my-ubuntu
docker build -t my-ubuntu - << HERE
FROM ubuntu:21.10
@npodonnell
npodonnell / docker_api_cheatsheet.md
Last active Dec 29, 2021
Docker API Cheatsheet
View docker_api_cheatsheet.md

Docker Python API Cheatsheet

N. P. O'Donnell, 2021

Installing and Importing

Installing:

pip install docker
View linux_networking.md

Linux Networking

N. P. O'Donnell, 2021

Network Interfaces

Bring eth0 interface down:

WARNING: If you do this remotely (like through an SSH connection), it will disconnect you...

@npodonnell
npodonnell / ubuntu_2104_bitcoin_core_setup.md
Last active Oct 8, 2021
DigitalOcean Ubuntu 21.04 Bitcoin Core Setup
View ubuntu_2104_bitcoin_core_setup.md

Bitcoin Core Setup on Ubuntu 21.04

N. P. O'Donnell, 2021

Update / Install:

# As root
apt update
apt install -y git
View trio_cheatcheet.md

Trio Cheatsheet

N. P. O'Donnell, 2021

Simple Trio Program

import trio
View random_commands.md

Random Commands

And Stuff ... mostly for Ubuntu/Debian

N. P. O'Donnell, 2021

Disable tap-to-click

synclient MaxTapTime=0