Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
codz

Sam Mingo slmingol

:octocat:
codz
View GitHub Profile
View gist:fdcdc9a8cb094b68ca0c7bac3e8f86a5

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@slmingol
slmingol / script.sh
Last active Feb 6, 2022 — forked from kwilczynski/script.sh
Dump ad list (ad blocking list), whitelist and blacklist from Sqlite database on Pi Hole
View script.sh
sqlite3 /etc/pihole/gravity.db -header -csv 'select * from adlist' > adlist.csv
sqlite3 /etc/pihole/gravity.db -header -csv 'select * from vw_whitelist' > whitelist.csv
sqlite3 /etc/pihole/gravity.db -header -csv 'select * from vw_blacklist' > blacklist.csv
@slmingol
slmingol / osxvpnrouting.markdown
Created Feb 1, 2022 — forked from taldanzig/osxvpnrouting.markdown
Routing tips for VPNs on OS X
View osxvpnrouting.markdown

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

@slmingol
slmingol / github-actions-notes.md
Created Jun 4, 2021 — forked from br3ndonland/github-actions-notes.md
Getting the Gist of GitHub Actions
View github-actions-notes.md
@slmingol
slmingol / TrueColour.md
Created May 30, 2021 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@slmingol
slmingol / version-up.sh
Created May 8, 2021 — forked from OleksandrKucherenko/version-up.sh
Calculate Next Suitable Version Tag for Your Git based project
View version-up.sh
#!/usr/bin/env bash
## Copyright (C) 2017, Oleksandr Kucherenko
## Last revisit: 2017-09-29
# For help:
# ./versionip.sh --help
# For developer / references:
# https://ryanstutorials.net/bash-scripting-tutorial/bash-functions.php
# http://tldp.org/LDP/abs/html/comparison-ops.html
@slmingol
slmingol / ansible.cfg
Created Mar 18, 2021 — forked from krigar/ansible.cfg
Bastion Playbook
View ansible.cfg
[ssh_connection]
ssh_args = -F ssh.cfg
control_path = ~/.ssh/mux-%r@%h:%p
@slmingol
slmingol / SSHrsync.sh
Last active Oct 10, 2020 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)
View SSHrsync.sh
rsync -aHAXxv --numeric-ids --delete --progress -e "ssh -T -c arcfour -o Compression=no -x" user@<source>:<source_dir> <dest_dir>
@slmingol
slmingol / build_arm64_rpi_userland.sh
Last active Sep 16, 2020 — forked from satmandu/build_arm64_rpi_userland.sh
Generate an arm64 rpi userland for use on ubuntu/arm64.
View build_arm64_rpi_userland.sh
#!/bin/bash -x
workdir="${HOME}/workdir"
[[ ! -d "$workdir" ]] && ( mkdir -p "$workdir" || exit 1)
[[ ! -d "$workdir"/tmp ]] && ( mkdir -p "$workdir"/tmp || exit 1)
[[ ! -d "$workdir"/output ]] && ( mkdir -p "$workdir"/output || exit 1)
echo "workdir is ${workdir}"
tmpdir=$(mktemp -d deb_XXXX -p "$workdir"/tmp)
deb_temp=${tmpdir}/deb
extract_tmp=${tmpdir}/extract