Skip to content

Instantly share code, notes, and snippets.

View dearing's full-sized avatar

Jacob Dearing dearing

View GitHub Profile
@dearing
dearing / ome-rescue.sh
Created December 8, 2023 19:17
Open Manage Enterprise Scripts
#!/bin/bash -ex
mount /dev/OMCAppVG/LVRoot /mnt
for i in dev run proc sys ; do mount -o bind /$i /mnt/$i ; done
chroot /mnt
@dearing
dearing / dialog.go
Last active March 24, 2022 17:20
NumberToEnglish tests
package dialog
func englishToTwenty(number int) (value string) {
switch number {
case 0:
value = "zero"
case 1:
value = "one"
case 2:
value = "two"
package main
import (
"log"
"math/rand"
"sync"
"time"
"github.com/google/uuid"
)
@dearing
dearing / keybase.md
Created January 19, 2018 19:12
keybase.md

Keybase proof

I hereby claim:

  • I am dearing on github.
  • I am dearing (https://keybase.io/dearing) on keybase.
  • I have a public key ASBKP9t-n_5z4PwtOjWqF8fH_JqihG8hvSNhVqSdR7rmUgo

To claim this, I am signing this object:

@dearing
dearing / docker-nftables.conf
Created February 25, 2016 14:26
nftables with docker
# /etc/systemd/system/docker.service.d/docker-nftables.conf
# disable iptables in docker, allowing nftables to do work
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --iptables=false
@dearing
dearing / banaws.rb
Last active January 25, 2016 13:10
BANAWS // ban aws ec2 ip ranges with iptables
#!/bin/env ruby
require 'json'
# READ: http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html
# GET: https://ip-ranges.amazonaws.com/ip-ranges.json
json = File.read('ip-ranges.json')
data = JSON.parse(json)
data['prefixes'].sort_by { |x| x['region'] }.each do |prefix|
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Simple Sandbox VPC // NO NAT",
"Metadata": {
"Notes" : {
"[ Parameters ]:" : "===================================================================================================================================",
@dearing
dearing / firewall.json
Created May 12, 2015 06:17
$ nft export > firewall.json
{
"nftables": [
{
"table": {
"name": "nat",
"family": "ip",
"flags": 0,
"use": 2
}
},
@dearing
dearing / setup.rb
Created May 5, 2015 21:30
quickly strap a student workstation
%w(git nano vim vi wget curl).each do |p|
package p
end
remote_file '/tmp/atom.rpm' do
owner 'student'
group 'student'
mode '0644'
source 'https://atom.io/download/rpm'
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("Hello World!")
fmt.Println("Testing the editor...")