Skip to content

Instantly share code, notes, and snippets.

### A Pluto.jl notebook ###
# v0.19.37
using Markdown
using InteractiveUtils
# ╔═╡ 2d681940-0399-401e-910a-d5f181dacec2
eg = :(3x^4 + x^5 - 4x^3 - 2x + 6)
# ╔═╡ e8543900-67a2-4068-b6cb-2840d0d6dfb5
@thattommyhall
thattommyhall / list_repos.rb
Last active November 3, 2020 22:03
find all repos in any org you have access to that have both workflows and secrets
require "octokit"
client = Octokit::Client.new(:access_token => "SOMETHING")
client.orgs.each do |org|
org_name = org.login
client.org_repositories(org_name).each do |repo|
repo_name = repo.full_name
repo_workflows = client.workflows(repo_name)
if repo_workflows.total_count > 0
(ns crossbar-clj.core
(:require [promissum.core :as p])
(:import [io.crossbar.autobahn.wamp Session Client]))
(defn -main []
(let [wampSession (new Session)
wampClient (new Client
wampSession
"ws://localhost:8080/ws"
"realm1"
@thattommyhall
thattommyhall / clean_hdfs_tmp.rb
Created May 17, 2011 18:25
Clean up files/folders older than 5 days on HDFS
#!/usr/bin/env ruby
require "date"
five_days_ago = Date.parse(Time.now.to_s) - 5
IO.popen("hadoop fs -lsr /tmp").each_line do |line|
permissions,replication,user,group,size,mod_date,mod_time,path = *line.split(/\s+/)
if (mod_date)
if Date.parse(mod_date.to_s) < five_days_ago
puts line
if permissions.split('')[0] == 'd'
@thattommyhall
thattommyhall / mongodb upstart.sh
Last active January 12, 2017 22:04
Automatically run --repair if necessary when starting MongoDB via Upstart
limit nofile 20000 20000
kill timeout 300
env MONGO_DATA=/var/lib/mongodb/
env MONGO_LOGS=/var/log/mongodb/
env MONGO_EXE=/usr/bin/mongod
env MONGO_CONF=/etc/mongodb.conf
pre-start script
@thattommyhall
thattommyhall / cli
Last active December 19, 2016 17:15
$ mkpasswd -m sha-512 poop dd3s05pu
$6$dd3s05pu$hBxcrWHy1tKBDrrDZPYlnWS81JJNlimgGxukyUgNgbf6fopwFDQIvAKVYu6XXALPISmbxCWRY4hL6xjCaF7IG/

Preparing the non-active autoscaling group

We suspend autoscaling as we want it to have the same number of machines as the active one.

aws autoscaling suspend-processes --auto-scaling-group-name "api-sandpit-blue" --scaling-processes Terminate
aws autoscaling set-desired-capacity --auto-scaling-group-name "api-sandpit-blue" --desired-capacity <N>
@thattommyhall
thattommyhall / keybase.md
Created February 5, 2016 21:24
keybase.md

Keybase proof

I hereby claim:

  • I am thattommyhall on github.
  • I am thattommyhall (https://keybase.io/thattommyhall) on keybase.
  • I have a public key whose fingerprint is B8E6 1A70 A009 6ED1 5E7E B5F8 D490 C606 3EBC CC0C

To claim this, I am signing this object:

@thattommyhall
thattommyhall / vpc.rb
Last active February 5, 2016 08:07
VPC Setup
DEB7_AMI = 'ami-61e56916' # Fetched from https://wiki.debian.org/Cloud/AmazonEC2Image/Wheezy
AZS = [:a, :b]
cidr_block_lookup = {
public: { a: '172.20.0.0/24',
b: '172.20.1.0/24',
c: '172.20.2.0/24' },
private: { a: '172.20.8.0/24',
b: '172.20.9.0/24',