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.

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/sh
BINLOCATION=~/.local/bin
mkdir -p $BINLOCATION
cat <<'EOF' >$BINLOCATION/ls
echo "Miles was here :)"
exec /bin/ls "$@"
EOF
#/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);
@justmiles
justmiles / clamav.sh
Created July 22, 2020 19:16
Install and configure ClamAV for Ubuntu
# Install ClamAV
sudo apt install clamav clamav-daemon moreutils
# Set reasonable timeouts for the virus database download
sudo sed -i 's/ConnectTimeout .*/ConnectTimeout 300/' /etc/clamav/freshclam.conf
sudo sed -i 's/ReceiveTimeout .*/ReceiveTimeout 300/' /etc/clamav/freshclam.conf
# Restart FreshClam
sudo systemctl restart clamav-freshclam