This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ $SUDO_USER ]; then | |
realUser=$SUDO_USER | |
else | |
realUser=$(whoami) | |
fi | |
realUserHome=$(bash -c "cd ~$(printf %q "$realUser") && pwd") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# promts for sudo and can be installed via: | |
# wget -O - https://gist.githubusercontent.com/tomdavidson/64828803dbd4718514a465be1d7e908a/raw/75ec0521175b3d8b7d92c188d3dc0d251dbf5469/install-node-zx.sh | bash | |
! type sudo >/dev/null 2>&1 && apt install sudo && usermod -aG sudo "$(whoami)" | |
export CLOUDSDK_CORE_PROJECT='dots-333103' | |
# install NodeJS & zx if not already installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
shopt -s extglob | |
# Lowercased, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with '-'. | |
# No leading or trailing '-'. Useful with URLs, host names, domain names, and stack names. | |
slugify() { | |
: "${1:?'Usage: slugify NAME'}" | |
local next="$1" | |
next="${next,,}" # lowercase | |
next="${next//+([^a-z0-9])/-}" # replace non-alphanumeric wiht '-' | |
next="${next#-}" # remove - from the start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
DEBUG=${DEBUG:-} | |
help() { | |
cat <<EOF | |
Simple monorepo lifecycle/pipeline tool for running one or more commands on one | |
or more directories that have diffs compared to an ancestor. The primary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zx | |
const shellFiles = globby.globbySync(['**/*.sh', '**/*.bash'], { gitignore: true }); | |
nothrow($`npx -y shellcheck -f diff ssa-pg/scripts/deploy-infra.sh | git apply`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Installs GNU Command Line Tools & then some. Requires homebrew. | |
# Most are newer and more powerful that than OSX’s but also solves most OS compatibility issues | |
echo "Installing GNU coreutils and various." | |
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH" | |
brew install coreutils | |
brew install binutils | |
brew install diffutils | |
brew install ed --with-default-names | |
brew install findutils --with-default-names |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat Dockerfile | |
FROM docker.io/hello-world | |
$ docker build --tag uscm5 . | |
STEP 1: FROM docker.io/hello-world | |
STEP 2: COMMIT uscm5 | |
--> d1165f22123 | |
Successfully tagged localhost/uscm5:latest | |
Successfully tagged docker.io/library/hello-world:latest | |
d1165f2212346b2bab48cb01c1e39ee8ad1be46b87873d9ca7a4e434980a7726 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://editorconfig.org | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##!/system/bin/sh | |
iptables -t filter -F FORWARD | |
iptables -t nat -F POSTROUTING | |
iptables -t filter -I FORWARD -j ACCEPT | |
iptables -t nat -I POSTROUTING -j MASQUERADE | |
ip rule add from 192.168.43.0/24 lookup 61 | |
ip route add default dev tun0 scope link table 61 | |
ip route add 192.168.43.0/24 dev wlan0 scope link table 61 | |
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "config_files_path" { | |
default = "../../teams/*.yaml" | |
description = "The path to team config files" | |
} | |
data "local_file" "configs" { | |
for_each = { for k, file in fileset(dirname(var.config_files_path), basename(var.config_files_path)) : | |
k => abspath("${dirname(var.config_files_path)}/${file}") | |
} |