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 / 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',
@thattommyhall
thattommyhall / check.py
Created January 6, 2016 17:58
checksum generation
import hashlib
def md5sum(source_path, chunk_size=8388608):
md5s = []
with open(source_path,'rb') as fp:
while True:
data = fp.read(chunk_size)
if not data:
break
md5s.append(hashlib.md5(data))
@thattommyhall
thattommyhall / broken.pp
Last active October 5, 2015 15:09
WTF Puppet
file { '/etc/sphinxsearch/sphinx.conf':
ensure => link,
target => "${cm_path}/sphinx/sphinx.conf",
notify => Service['sphinxsearch'],
require => Package['sphinxsearch'],
}
$cm_path = "/cgi-perl/cm"