Skip to content

Instantly share code, notes, and snippets.

@justinholmes
justinholmes / airflow-1.10.2-python3.txt
Last active March 20, 2019 13:44
airflow-1.10.2-python3 requirements.txt
absl-py==0.6.1
adal==1.2.0
alembic==0.8.10
amqp==2.4.0
apache-airflow===1.10.2
asn1crypto==0.24.0
astor==0.7.1
Babel==2.6.0
bcrypt==3.1.6
billiard==3.5.0.5
@justinholmes
justinholmes / processing.py
Last active August 1, 2018 09:20
Python background threading and threadpool executor example
import threading
from concurrent.futures import ThreadPoolExecutor
from time import sleep
class ProcessingBackgroundThread:
def __init__(self):
thread = threading.Thread(target=self.process)
thread.daemon = True
thread.start()
@justinholmes
justinholmes / IPS.bash
Created March 5, 2018 16:47
Script to get Google Cloud IPv4 external address blocks
dig TXT _cloud-netblocks{1..6}.googleusercontent.com +short | grep ip4 | awk -F 'ip4:' '{for (i=2; i<=NF; i++) print $i}' | sed 's/\?all//g' | sed 's/ip6:.*//g'| sed 's/\"//g' | sed 's/^ *//;s/ *$//'
@justinholmes
justinholmes / resource_cloudbuild_trigger.go
Created February 28, 2018 16:36
Cloudbuild trigger provider
package google
import (
"fmt"
"github.com/hashicorp/terraform/helper/schema"
"google.golang.org/api/cloudbuild/v1"
"log"
"strings"
)

Keybase proof

I hereby claim:

  • I am justinholmes on github.
  • I am justinholmes29 (https://keybase.io/justinholmes29) on keybase.
  • I have a public key whose fingerprint is CC04 6EF2 279A 6EAE 71F4 48A4 2603 C3C7 D7B8 E904

To claim this, I am signing this object:

exec /usr/lib/jvm/java-8-oracle/bin/java -server -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m -Dgo.database.provider=com.XXXXXXXXX.gocd.db.mysql.MySQLDatabase -Ddb.host=gocd-server-framework-goserverdbcluster-hwzqvavxum2d.cluster-XXXXXXXXXX.us-east-1.rds.amazonaws.com -Ddb.port=3306 -Ddb.name=goserverdb -Ddb.user=gouser -Ddb.password=XXXXXXX -Duser.language=en -Djruby.rack.request.size.threshold.bytes=30000000 -Duser.country=US -Dcruise.config.dir=/etc/go -Dcruise.config.file=/etc/go/cruise-config.xml -Dcruise.server.port=8153 -Dcruise.server.ssl.port=8154 -Djava.security.egd=file:/dev/./urandom -jar /usr/share/go-server/go.jar
java.security.Security.setProperty("networkaddress.cache.ttl" , "60");
@justinholmes
justinholmes / haproxy-marathonv2.sh
Last active September 9, 2019 01:01
Haproxy config generator using Marathon
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
require 'net/http'
url = URI.parse("http://marathon.apps.company.com/v2/tasks")
req = Net::HTTP::Get.new(url.path)
req.add_field("Accept", "application/json")
res = Net::HTTP.new(url.host, url.port).start do |http|
http.request(req)
# Documentation for HAProxy
# http://code.google.com/p/haproxy-docs/w/list
# http://haproxy.1wt.eu/download/1.2/doc/architecture.txt
# NOTES:
# open files limits need to be > 256000, use ulimit -n to set (on most POSIX systems)
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
sudo du -h | grep "[\0-9\]G"
find -name *.war -exec scp '{}' [email protected]:webapps ';'
find -name *.jmx -exec sh ${JENKINS_HOME}/jmeter/bin/jmeter -n -t {} -l ${WORKSPACE}/{}.jtl ';'
awk '/MemTotal:/{total=$2} \
/MemFree:/{free=$2} \
END{ \
print "free:"(free*100/total)",";