Skip to content

Instantly share code, notes, and snippets.

@thattommyhall
thattommyhall / list_repos.rb
Last active Nov 3, 2020
find all repos in any org you have access to that have both workflows and secrets
View list_repos.rb
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
View wamp.clj
(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"
View cli
$ mkpasswd -m sha-512 poop dd3s05pu
$6$dd3s05pu$hBxcrWHy1tKBDrrDZPYlnWS81JJNlimgGxukyUgNgbf6fopwFDQIvAKVYu6XXALPISmbxCWRY4hL6xjCaF7IG/
View gist:c12d36c7216b5aa20a966381470288f2

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>
View 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:

View vpc.rb
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 Jan 6, 2016
checksum generation
View check.py
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))
View broken.pp
file { '/etc/sphinxsearch/sphinx.conf':
ensure => link,
target => "${cm_path}/sphinx/sphinx.conf",
notify => Service['sphinxsearch'],
require => Package['sphinxsearch'],
}
$cm_path = "/cgi-perl/cm"
View terraframe.rb
azs = [:a, :b, :c]
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',
c: '172.20.10.0/24' }
}
You can’t perform that action at this time.