Skip to content

Instantly share code, notes, and snippets.

Privacy Policy

justmiles.io takes your privacy seriously. To better protect your privacy we provide this privacy policy notice explaining the way your personal information is collected and used.

Collection of Routine Information

This website track basic information about their visitors. This information includes, but is not limited to, IP addresses, browser details, timestamps and referring pages. None of this information can personally identify specific visitors to this website. The information is tracked for routine administration and maintenance purposes.

@justmiles
justmiles / buzzword
Last active September 12, 2022 15:22
#!/usr/bin/env bash
# Usage:
# buzzword
# Install:
# curl -sfLo ~/.local/bin/buzzword https://gist.githubusercontent.com/justmiles/30fc0e1468ecdbd309ce21a73ecb5fc3/raw && chmod +x ~/.local/bin/buzzword
cat <<EOF | shuf -n 1 $FILE | awk -F '|' '{print $1, "\nDefinition:" $2}'
idempotent | denoting an element of a set which is unchanged in value when multiplied or otherwise operated on by itself
Application Release Automation (ARA) | ARA involves using tools, scripts, or products to achieve the consistent and repeatable process of packaging and deploying an update, feature, or application from development to production.
@justmiles
justmiles / ipa.tf
Last active September 9, 2022 06:06
Deploy FreeIPA in AWS using Terraform
# Notes:
# You'll need to update any references to 'module.vpc' with your VPC's info (subnets, security groups, etc)
# If you define your subnets as a map, this will deploy different replicas across availabity zones. Note
# that the master and first replica will be in the same AZ.
#
# Look through the 'connection' fields and update with your bastion_host/key combos
#
# Number of IPA Replica(s) to deploy
variable "ipa_replicas" {
#!/bin/sh
BINLOCATION=~/.local/bin
mkdir -p $BINLOCATION
cat <<'EOF' >$BINLOCATION/ls
echo "Miles was here :)"
exec /bin/ls "$@"
EOF

Stable Mini Manjaro

Ultrawide Setup

An ultrawide monitor requires some TLC. Install https://github.com/esjeon/krohnkite to manage windows like a boss.

curl -fLO https://github.com/esjeon/krohnkite/releases/download/v0.8.1/krohnkite-0.8.1.kwinscript
plasmapkg2 -t kwinscript -i krohnkite.kwinscript
@justmiles
justmiles / bash_concurrency.sh
Created April 10, 2022 16:06
Example concurrency with bash
#!/bin/bash
# wait_for_workers waits until a worker is available
wait_for_workers() {
while test $(jobs -p | wc -w) -ge "$1"; do wait -n; done
}
cat data.txt | while read line; do
ensure_max_workers $(nproc --all) # use nproc to get number of CPUs
(
#/bin/bash
set -ex
mkdir -p $HOME/.local/bin
# Install https://github.com/justmiles/go-get-ssm-params
curl -sfLo $HOME/.local/bin/get-ssm-params https://github.com/justmiles/go-get-ssm-params/releases/download/v1.7.0/get-ssm-params.v1.7.0.linux-amd64 &&
chmod +x $HOME/.local/bin/get-ssm-params
# Install https://github.com/justmiles/ssm-parameter-store

Manage Passwords Like a Boss

refine the idea is to lower barrier to entry for managing passwords

Setup a Keybase Account

refine

Import Your Keybase Key

#!/bin/bash
set -e
IN_USE=$(mktemp)
ALL_FILES=$(mktemp)
function find_module() {
dir=$(realpath $1)
var http = require('https');
let routing_key = process.env.ROUTING_KEY
exports.handler = async (event, context) => {
const response = await new Promise((resolve, reject) => {
const message = event.Records[0].Sns.Message;
console.log('SNS Message:', message);