Skip to content

Instantly share code, notes, and snippets.

View abuxton's full-sized avatar
💭
discombobulated as always

adam buxton abuxton

💭
discombobulated as always
View GitHub Profile
@abuxton
abuxton / jwt-decode.sh
Created December 1, 2020 14:28 — forked from angelo-v/jwt-decode.sh
Decode a JWT via command line
# will not work in all cases, see https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#gistcomment-3439904
function jwt-decode() {
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq
}
JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
jwt-decode $JWT
@abuxton
abuxton / vault-health.sh
Created February 17, 2021 09:33
helper function for hashicorp vault manual healthcheck
function vault_health () {
if [[ -z "${VAULT_ADDR}" ]]; then
echo "# ensure the following exports are set: \n
# export VAULT_TOKEN=<token> \n
# export VAULT_CACERT=<path/to/cacert \n
# export VAULT_ADDR='127.0.0.1:8200' "
else
echo '# vault status'
@abuxton
abuxton / README.MD
Last active February 15, 2022 14:20
hashicorp packages list with docker gist
@abuxton
abuxton / vault_logrotate
Created June 17, 2021 15:18 — forked from soloradish/vault_logrotate
logrotate setting file for HashiCorp's Vault audit file
# Change the path below to your own audit log path.
/var/log/vault/audit.log {
rotate 30
daily
# Do not execute rotate if the log file is empty.
notifempty
missingok
compress
# Set compress on next rotate cycl to prevent entry loss when performing compression.
delaycompress
@abuxton
abuxton / gist:f9ec8c3efd2584ea18cead38c1d752fd
Created June 17, 2021 16:03
learn any language primer
1. Syntax - The syntax of a language describes the structure of code. This encompasses both how the code is written on a line-by-line basis as well as the actual words used to construct code statements.A language's syntax also involves things like including libraries, setting variables, and terminating lines. With practice, you'll learn to recognize syntactical requirements (and conventions) almost subliminally as you read sample code.
2. Built-ins and conditionals - A programming language, just like a natural language, has a finite number of words it recognizes as valid. This vocabulary can be expanded with additional libraries, but the core language knows a specific set of keywords. Knowing these keywords gives you the ability to write basic expressions, the building blocks of a program.
3. Data types - Code deals with data, so you must learn how a programming language recognizes different kinds of data. All languages understand integers and most understand decimals and individual characters (a, b, c, and
# scraped from https://github.com/mtharpe/chef-terraform-cloud-agent-recipe
[Unit]
Description=HashiCorp Terraform Cloud Agent
[Service]
Type=simple
ExecStart=/usr/bin/tfc-agent -token <tfc_auth_token>
[Install]
WantedBy=multi-user.target
@abuxton
abuxton / README.md
Created October 8, 2021 11:03 — forked from renestalder/README.md
Unfollow all on Facebook

Facebook: Unfollow people and pages

  1. Open news feed preferences on your Facebook menu (browser)
  2. Click people or pages
  3. Scroll down (or click see more) until your full list is loaded
  4. Run the script in your browser console

Facebook will block this feature for you while you use it, depending on how much entities you try to unfollow. It automatically unblocks in a couple of hours and you will be able to continue.

See comments section for more up-to-date versions of the script. The original script is from 2017 and will not work as is.

@abuxton
abuxton / README.md
Created November 6, 2021 08:49 — forked from mbaitelman/README.md
Automated Terraform Deployments Using Bitbucket Pipelines
@abuxton
abuxton / README.MD
Last active February 9, 2022 16:14
Publish pmr script

Publish PMR helper script

Script to publish modules utilizing the API https://www.terraform.io/docs/cloud/api/modules.html. Uses native OS python json library, but the alt. jq lines are included feel free to amend.

Usage

> git clone https://gist.github.com/abuxton/ea5f37767af44a710020ee2fbe97a7f3 publish-pmr-module && cd publish-pmr-module
export TFE_ORG=# your TFE/C organisation name
export TFE_ADDR=app.terraform.io #set your internal TFE DNS
@abuxton
abuxton / README.md
Last active November 17, 2021 13:00 — forked from kordless/README.md
Rust Server Deployment for Google Container Engine

Howdy Y'all! I'm @kordless on YouTube and I occasionally play and stream Rust, the game.

This repo is for deploying a Rust Server running on Google Container Engine. Google has a deal going where you can get $300 of free credits for a year on Google Cloud, so it's a good excuse to signup and run your own server. And no, I don't work for Google!

based on this article https://www.rustafied.com/how-to-host-a-rust-server-in-linux

This deployment origionally used an image built by @dids, which is hosted on Docker Hub: https://hub.docker.com/r/didstopia/rust-server/

This deployment method can be used to start a small server to play with friends or practice building things. In a few days, I'll update the scripts to include a way to save the content you've created, in-game, with others who can then run their own servers and load your content in to explore it for themselves.