Skip to content

Instantly share code, notes, and snippets.

View ericboehs's full-sized avatar

Eric Boehs ericboehs

  • Oddball
  • Enid, OK
  • 06:05 (UTC -05:00)
View GitHub Profile
KNOWN_EXAMPLE_FILE_PATH_LN = [
'./spec/services/form1010cg/auditor_spec.rb:301',
'./spec/lib/common/exceptions/detailed_schema_errors_spec.rb:223',
'./spec/jobs/va_notify_email_job_spec.rb:18',
'./spec/controllers/v0/caregivers_assistance_claims_controller_spec.rb:49',
'./spec/controllers/v0/caregivers_assistance_claims_controller_spec.rb:25',
'./spec/requests/v0/form1010cg/attachments_request_spec.rb:74',
'./spec/requests/v0/form1010cg/attachments_request_spec.rb:49',
'./spec/controllers/inherited_proofing_controller_spec.rb:195',
'./spec/controllers/v1/sessions_controller_spec.rb:421',
@ericboehs
ericboehs / client.rb
Created January 30, 2023 21:06
Ruby Read Timeout vs Global
require 'uri'
require 'net/http'
url = URI.parse 'http://localhost:9292/'
request = Net::HTTP::Get.new url.path
response = Net::HTTP.start(url.host, url.port) do |http|
http.read_timeout = 2
http.request request
end
@ericboehs
ericboehs / gh-labeler
Created November 4, 2022 16:53
Remove labels in mass from GitHub Issues
#! /usr/bin/env ruby
require 'json'
require 'net/http'
class GQLBuilder
attr_reader :mutations, :queries, :result
def initialize
@mutations = []
@ericboehs
ericboehs / foo.json.erb
Last active October 28, 2022 16:49
Dynamically parsing JSON via ERB
{
"form1[0].#subform[0].veteranLastName[0]": "<%= data['veteranFullName']['last'] %>",
"form1[0].#subform[0].veteranFirstName[0]": "<%= data['veteranFullName']['first'] %>",
"form1[0].#subform[0].veteranMiddleInitial[0]": "<%= data['veteranFullName']['middle'] %>",
"form1[0].#subform[0].veteranSocialSecurityNumber[0]": "<%= data['veteranSocialSecurityNumber'] %>",
"form1[0].#subform[0].VAfileNumber[0]": "<%= data['vaFileNumber'] %>",
"form1[0].#subform[0].applicantLastName2[0]": "<%= data['applicant1']['last'] %>",
"form1[0].#subform[0].applicantFirstName2[0]": "<%= data['applicant1']['first'] %>",
"form1[0].#subform[0].veteranDateOfBirth[0]": "<%= data['vet']['dob'] %>",
"form1[0].#subform[0].veteranTelephoneNumber[0]": "<%= data['sponsorPhone'] %>",
@ericboehs
ericboehs / sync_zh_workspace_to_gh_project.rb
Last active October 21, 2022 13:35
Rude and crude one-way sync of ZenHub Workspaces to GitHub Projects (V2)
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'zenhub_ruby', github: 'Reddshift/zenhub_ruby'
gem 'octokit'
gem 'pry'
end
require 'json'
@ericboehs
ericboehs / stale-branches
Last active July 27, 2022 17:01
Lists Stale Branches for Current Repo in CSV or a Markdown Table
#! /usr/bin/env zsh
# Variables
DATE_COMPARISON_OPERATOR=${DATE_COMPARISON_OPERATOR-<}
REPO_URL=${REPO_URL-$(gh browse -n)}
# Set generating command
GENERATING_COMMAND='stale-branches'
if [ "$DATE_COMPARISON_OPERATOR" = ">" ]; then
@ericboehs
ericboehs / github.js
Last active May 6, 2022 04:52
Blink She'll GitHub Theme
t.prefs_.set('color-palette-overrides',["#333333", "#be4943", "#64cb38", "#969829", "#2350a1", "#aa25b7", "#4796b9", "#cccccc", "#000000", "#bb3f39", "#64cb38", "#b7ba34", "#2350a1", "#aa25b7", "#4796b9", "#ffffff"]);
t.prefs_.set('foreground-color', "#25292e");
t.prefs_.set('background-color', "#ffffff");
t.prefs_.set('cursor-color', 'rgba(4,66,137,0.5)');
@ericboehs
ericboehs / set-up-persistent-storage-for-K3s.md
Created April 14, 2022 00:57
Set up persistent storage for K3s (via USB drive)

Set up persistent storage for K3s (via USB drive)

  1. Get root: ssh pi-k3s-master.local -t sudo su
  2. Find your disk via fdisk -l (e.g. /dev/sda1)
  3. Erase drive by repartitioning: mkfs.ext4 /dev/sda1
  4. Mount drive:
    mkdir /mnt/pi-k3s-storage
    chown -R ericboehs:ericboehs /mnt/pi-k3s-storage
    mount /dev/sda1 /mnt/pi-k3s-storage
    
@ericboehs
ericboehs / install-k3s-on-rpi.md
Last active April 13, 2022 02:21
Installing Kubernetes (k3s) on Raspberry Pi 4b 2GB+

How to set up Kubernetes on one or more Raspberry Pis (4b)

Estimated time needed: one hour. And then several more hours to have fun with it.

Set up Pi

Go through this section for all of your Raspberry Pis (master and nodes).

  1. Install Raspberry Pi OS 64-bit Lite onto an SD card using Raspberry Pi's Imager.
  • In the imager options, I configured hostname, ssh, username, but not Wi-Fi. Setting up Wi-Fi disables ethernet.
@ericboehs
ericboehs / va-pd-schedule
Last active May 2, 2022 18:22
Pull upcoming Pager Duty users for a given schedule
#! /usr/bin/env ruby
# https://gist.github.com/ericboehs/d1a88345ac526eb9851ff41155adc3bc
require 'open-uri'
require 'json'
BOLD = `tput bold`
NORMAL = `tput sgr0`
def print_all_schedules_names_and_ids