Skip to content

Instantly share code, notes, and snippets.

@jahio
jahio / american-revolution-timeline.yaml
Last active September 16, 2023 07:36
A Timeline of the History of the American Revolution
View american-revolution-timeline.yaml
#
# This is an experiment for a personal project I'm working on. The below is a YAML representation of some of the historical
# events that occurred relating to the American Revolution. It is absolutely incomplete (we're talking about a major geopolitical
# event here that was kicked off by a major conflict between two western powers on two continents over 20 years prior after all)
# and not intended to be a history lesson or a political statement. I'll probably add to and tweak this as I go, expanding on
# my experiement in multiple ways, but be aware that this is just used as test data for a personal project that I hope to be able
# to let others use one day, if it turns out well.
#
# (Said project is an attempt at creating an HTML/CSS/JS interactive timeline in the browser. The idea: don't worry about
# messing with front-end code, just feed it some nice and easy YAML - like this - of historical events and data and you
@jahio
jahio / ps.ps1
Created March 31, 2022 03:30
Gimme all processes using >= 200MB Working Set Size (64-bit) on...well, any OS that can run PowerShell Core (Linux, Mac, Windows)
View ps.ps1
#!/usr/bin/env pwsh
# Uses Get-Process piped to some stuff to get a list of processes
# over a certain amount of memory and output those as JSON.
# Takes no arguments.
# NOTE: This threshold is defined as BYTES, not KILOBYTES like the shell script.
# Adjust the math accordingly.
$threshold = (200 * 1024) * 1024 # Don't report anything greater than 200MB
@jahio
jahio / ps.sh
Created March 31, 2022 03:27
Gimme all processes using >= 200MB rss size on STDOUT in JSON format on Linux
View ps.sh
#!/usr/bin/env bash
# Uses `ps` from $PATH (usually /usr/bin/ps) to get processes, then filters
# those by how much rss they're using; anything lower than the amount defined
# below as $THRESHOLD is discarded. Outputs JSON to STDOUT. No arguments.
declare -a pids
declare -a cmds
declare -a rss
@jahio
jahio / eval.yml
Created February 12, 2021 21:09
Tweed Setup File (eval.yml)
View eval.yml
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: tweed
name: broker
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@jahio
jahio / stop.sh
Created November 3, 2020 21:10
Stop RocketMQ
View stop.sh
#!/usr/bin/env zsh
export NAMESRV_ADDR="localhost:9876"
export ROCKETMQ_HOME="/Users/jah/Applications/rocketmq"
ORIGINAL_LOCATION=$(pwd)
cd $ROCKETMQ_HOME
bin/mqshutdown broker
bin/mqshutdown namesrv
@jahio
jahio / start.sh
Created November 3, 2020 21:10
Start RocketMQ
View start.sh
#!/usr/bin/env zsh
export NAMESRV_ADDR="localhost:9876"
export ROCKETMQ_HOME="/Users/jah/Applications/rocketmq"
ORIGINAL_DIR=$(pwd)
cd $ROCKETMQ_HOME
# Purge nohup.out so we can have a fresh log for each session
if [[ -f nohup.out ]]
@jahio
jahio / sign.rb
Created September 4, 2020 11:01
Using Google Cloud Storage Signed URLs in Ruby
View sign.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'google/cloud/storage'
bucket_name = 'dygnostick-test-bucket'
file_name = 'my_file.jpg' # This is what it will be named in the bucket
exp = 20 * 60 # 20 minutes
# Instantiating a new Google::Cloud::Storage object will automatically read your
@jahio
jahio / loginForm.html
Created May 1, 2020 00:00
Sample Component Example (Conceptual)
View loginForm.html
<div>
<input type=“text” placeholder=“Username”>
</div>
<div>
<input type=“password” placeholder=“Password”>
</div>
<div>
<input type=“submit” value=“Login”>
@jahio
jahio / GUIDE.MD
Created December 1, 2017 05:58 — forked from darkn3rd/GUIDE.MD
Pedantic ADHD Guide to DevOps ToolBox
View GUIDE.MD