Skip to content

Instantly share code, notes, and snippets.

View npodonnell's full-sized avatar
🎯
Focusing

npodonnell npodonnell

🎯
Focusing
View GitHub Profile
@npodonnell
npodonnell / linux_networking.md
Last active October 29, 2021 13:10
Linux Networking

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 / docker_api_cheatsheet.md
Last active December 29, 2021 13:56
Docker API Cheatsheet

Docker Python API Cheatsheet

N. P. O'Donnell, 2021

Installing and Importing

Installing:

pip install docker
@npodonnell
npodonnell / ubuntu-2110-in-docker.sh
Created October 25, 2021 18:47
Ubuntu 21.10 in docker
#!/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 / virtualization_notes.md
Last active January 13, 2023 11:25
Virtualization Notes

Virtualization Notes

N. P. O'Donnell, 2021

Find out if your x86 CPU supports KVM Virtualization

egrep -c '(vmx|svm)' /proc/cpuinfo
@npodonnell
npodonnell / xen_cheatsheet.md
Last active December 27, 2021 16:05
Xen Cheatsheet

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 $@"
@npodonnell
npodonnell / luks_encryption_cheatsheet.md
Last active March 13, 2023 16:26
LUKS Encryption Cheatsheet

LUKS Encryption Cheatsheet

N. P. O'Donnell, 2021

Before you do anything, ensure you have cryptsetup installed:

sudo apt-get install -y cryptsetup
@npodonnell
npodonnell / run-in-parallel.sh
Last active January 20, 2022 20:08
Run in parallel
#!/usr/bin/env bash
NTOK=3
do_cmd() {
echo "Command start $1"
sleep 5
echo "Command end $1"
return 1
}
@npodonnell
npodonnell / wg-switcher.sh
Created July 18, 2022 03:30
Wireguard switcher
#!/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
@npodonnell
npodonnell / uniswapv3_notes.md
Last active November 15, 2022 08:48
UniswapV3 Notes