Skip to content

Instantly share code, notes, and snippets.

View jmkacz's full-sized avatar

Jonathan Kaczynski jmkacz

View GitHub Profile
@jmkacz
jmkacz / gist:9374445
Created March 5, 2014 19:17
~/.aws/config
[default]
region=us-west-2
[profile production]
aws_access_key_id=
aws_secret_access_key=
[profile readiness-production]
@jmkacz
jmkacz / gist:6978084
Last active December 25, 2015 12:39
python-distribute.org outage
jon-mbp:~ jon$ curl -I http://python-distribute.org/distribute_setup.py
curl: (6) Could not resolve host: python-distribute.org; nodename nor servname provided, or not known
jon-mbp:~ jon$ nslookup python-distribute.org
Server: 4.2.2.2
Address: 4.2.2.2#53
** server can't find python-distribute.org: NXDOMAIN
@jmkacz
jmkacz / output.txt
Created September 18, 2013 01:16
coreos storage site 503ing
$ wget http://storage.core-os.net/coreos/amd64-generic/dev-channel/coreos_production_vagrant.box
--2013-09-17 21:13:08-- http://storage.core-os.net/coreos/amd64-generic/dev-channel/coreos_production_vagrant.box
Resolving storage.core-os.net... 74.125.29.128, 2607:f8b0:400d:c04::80
Connecting to storage.core-os.net|74.125.29.128|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 196079648 (187M) [application/vnd.previewsystems.box]
Saving to: ‘coreos_production_vagrant.box’
0% [ ] 1,048,576 --.-K/s in 60s
@jmkacz
jmkacz / python_scripts_discovery.txt
Created September 10, 2013 13:43
discovering scripts for a python package
# Show the information for the installed package, within the virtualenv.
(test)jon-mbp:tmp jon$ pip show --files diamond
---
Name: diamond
Version: 3.3.437
Location: /private/tmp/test/lib/python2.7/site-packages
Requires: ConfigObj, psutil
Files:
... snip ...
@jmkacz
jmkacz / TProcessPoolServer.py
Created May 29, 2012 15:28
Dvir's latest version of TProcessPoolServer
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@jmkacz
jmkacz / gist:2829045
Created May 29, 2012 15:25
my usage of TProcessPoolServer
import signal
def set_alarm(server):
def clean_shutdown(signum, frame):
for worker in server.workers:
logging.error("Terminating worker: {0}".format(worker))
worker.terminate()
logging.error("Requesting server to stop()")
try:
server.stop()
except (KeyboardInterrupt, SystemExit):
@jmkacz
jmkacz / gist:2828980
Created May 29, 2012 15:16
my usage of TProcessPoolServer
server = TProcessPoolServer(processor, transport, tfactory, pfactory)
try:
server.serve()
finally:
server.stop()
@jmkacz
jmkacz / thrift_service.py
Created May 22, 2012 19:38
my usage of TProcessPoolServer
import signal
def set_signal_handlers(server):
def clean_shutdown(signum, frame):
logging.info("Signal received: {0}".format(signum))
server.stop()
signal.signal(signal.SIGTERM, clean_shutdown)
signal.signal(signal.SIGINT, clean_shutdown)
server = TProcessPoolServer(processor, transport, tfactory, pfactory)