Skip to content

Instantly share code, notes, and snippets.

View aspen-roller's full-sized avatar

James Roller, Jr. aspen-roller

View GitHub Profile
@aspen-roller
aspen-roller / az-reactivate-preprod.md
Created March 30, 2021 17:16
reactivate preprod (deallocated)

These are the steps I run to turn preprod back on and verify. Once oidc is up, you can run the node.js, springboot, and ui playbooks in parallel (I've fixed the overwriting problem with generating .env files).

ap-preprod azure-start.yml
ap-preprod services-nodejs.yml -l oidc
ap-preprod services-nodejs.yml -l oidc -t init_pm2
ap-preprod services-nodejs.yml -l non_oidc
ap-preprod services-nodejs.yml -l non_oidc -t init_pm2
ap-preprod services-spring.yml
ap-preprod ui.yml
@aspen-roller
aspen-roller / .eslintignore
Last active July 9, 2021 19:04
vscode eslint settings #eslint #vscode
node_modules
@aspen-roller
aspen-roller / .eslintignore
Last active September 9, 2021 16:55
setup eslint for typescript in vscode #vscode #typescript #eslint
coverage
dist
node_modules
@aspen-roller
aspen-roller / github-runner_all-access.md
Created March 11, 2021 20:06
hudson access github runner in all-access

How to Access A Github-Runner Task

I've already added the SSH keys that I found from https://github.com/aspen-hudbuz.keys to 10.101.0.200.

Create Docker Context

docker context create aa0 --docker "host=ssh://[email protected]" --default-stack-orchestrator swarm --description "all-access swarm"

Connect to Github-Runner Task

@aspen-roller
aspen-roller / swbc-sql.sh
Last active February 4, 2021 00:18
execute sql scripts from github #sql #git #util
#!/bin/bash
set -e -o pipefail
# DESCRIPTION:
# * executes all scripts found in the directory identifed by GIT_URL
# * only loads files ending with .sql
# REQUIRED ENV VARS
# =================
# + GIT_TOKEN
@aspen-roller
aspen-roller / gen-oidc-secret.sh
Created January 25, 2021 21:08
generate an oidc secret #util
# 16 bytes
hexdump -n 16 -e '4/4 "%08X" 1 "\n"' /dev/random
# 32 bytes
hexdump -n 32 -e '8/4 "%08X" 1 "\n"' /dev/random
# ref: https://stackoverflow.com/questions/34328759/how-to-get-a-random-string-of-32-hexadecimal-digits-through-command-line/34329057
@aspen-roller
aspen-roller / query-node-version.sh
Created January 6, 2021 01:22
query node.js version #ansible #util
# ensure JSON output with ANSIBLE_STDOUT_CALLBACK
# remove all lines before the first '{'
# remove all lines after the last '}'
# use jq to query the stdout value from the command
# ASSUMPTION
# there is a group "services" that identifies machines with node.js installed
ANSIBLE_STDOUT_CALLBACK=json ansible services -i inventories/dev -m command -a 'node --version' -v | sed '1,/^[^{]/d' | sed '/^}/q' | jq -r '.plays[].tasks[].hosts | keys[] as $k | "\($k): \(.[$k] | .stdout)"'
@aspen-roller
aspen-roller / create-docker-contexts.sh
Last active December 16, 2020 18:20
docker context #docker #ssh
docker context create aa0 --docker "host=ssh://[email protected]" --default-stack-orchestrator swarm --description "all-access swarm"
@aspen-roller
aspen-roller / diff.sh
Created December 11, 2020 19:45
diff marsnet inventories #util #git #marsnet #ansible
# diff all common files
diff -bur --color inventories/preprod inventories/prod
# diff the main inventories
diff -bur --color inventories/preprod/preprod.ini inventories/prod/prod.ini
@aspen-roller
aspen-roller / fix_apt_pkg.sh
Created December 7, 2020 21:25
fix could not import python modules: apt apt_pkg #debug #python
# This was done in Ubunut-20.04
# I've observed this in other Ubuntu releases when Python gets updated
# https://github.com/ansible/ansible/issues/14468#issuecomment-459630445
cd /tmp
# download and unarchive python3-apt
apt-get download python3-apt
dpkg -x python3-apt_2.0.0ubuntu0.20.04.1_amd64.deb python3-apt