Skip to content

Instantly share code, notes, and snippets.

@spidaman
spidaman / Texas State House 2020 Candidates.csv
Last active July 28, 2020 21:26
Texas State House 2020 Candidates
District Candidate Site Donation Link
6 Julie Gobble https://julie4texas.com/ https://secure.actblue.com/donate/julie_july2020
11 Alec Johnson https://alec4yall.com/ https://secure.actblue.com/donate/alec4yall
14 Janet Dudding https://www.janetdudding4texas.com/ https://secure.actblue.com/donate/janet-t-dudding-for-texas-1
15 Lorena Perez McGill https://www.lorenafortexas.com/ https://secure.actblue.com/donate/Lorena-for-tx
17 Madeline Eden https://edenfortexas.com/ https://secure.actblue.com/donate/madeline-eden-for-texas-house-district-17-1
20 Jessica Tiedt https://www.jessica4tx.com/ https://secure.actblue.com/donate/friends-of-jessica-tiedt-1
23 Jeff Antonelli https://jeff-2020.com/ https://secure.actblue.com/donate/jeff-2020
24 Brian Rogers https://twitter.com/brianjrogers https://secure.actblue.com/donate/brian-rogers-for-texas-state-representative-district-24-1
28 Elizabeth Markowitz https://www.eliz4tx.com/ https://secure.actblue.com/donate/eliz4tx28
### Keybase proof
I hereby claim:
* I am spidaman on github.
* I am spidaman (https://keybase.io/spidaman) on keybase.
* I have a public key ASCZVuJEw28k_E-frx5YO-7BZQZa3fHnuCdNx6-9ggpaIAo
To claim this, I am signing this object:
@spidaman
spidaman / gist:8290433
Last active January 2, 2016 10:29
scooby doo and the case of the phantom hbase regions
hbck has been emitting complaints about regions that are neither in HDFS or in .META.:
14/01/06 21:21:12 WARN util.HBaseFsck: No HDFS region dir found: { meta => null, hdfs => null, deployed => hbase3-rs12.klout,60020,1388535340339;moments_time_20131229,5000,1388306209624.bf91db8893ce885b5ac0cc472cc5e661. } meta=null
and
ERROR: No regioninfo in Meta or HDFS. { meta => null, hdfs => null, deployed => hbase3-rs12.klout,60020,1388535340339;moments_time_20131229,5000,1388306209624.bf91db8893ce885b5ac0cc472cc5e661. }
After the region server crashes last week, this was logged:
ABORTING region server hbase3-rs24.klout,60020,1386199155964: Exception refreshing OPENING; region=bf91db8893ce885b5ac0cc472cc5e661, context=post_open_deploy
Cause:
@spidaman
spidaman / distcp_stacktrace.txt
Created October 3, 2013 17:27
error distcp'ing hfiles to a cluster newly enabled for short circuit reads
2013-10-03 07:22:21,724 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:klout (auth:SIMPLE) cause:java.io.IOException: Copied: 0 Skipped: 0 Failed: 1
2013-10-03 07:22:21,725 WARN org.apache.hadoop.mapred.Child: Error running child
java.io.IOException: Copied: 0 Skipped: 0 Failed: 1
at org.apache.hadoop.tools.DistCp$CopyFilesMapper.close(DistCp.java:582)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:57)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:417)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
@spidaman
spidaman / zip_dict.py
Created February 16, 2013 20:46
python dictionary from a pair of lists
import json
links = ['link1', 'link2','link3']
images = ['img1','img2','img3']
json.dumps(dict(zip(links,images)))
# '{"link1": "img1", "link3": "img3", "link2": "img2"}'
@spidaman
spidaman / stacktraces.py
Created February 16, 2013 20:18
Logging stacktraces from python exceptions
import logging, sys, traceback
from stuff import DoStuff
try:
DoStuff.shit_can_happen()
except ShitHappens, e:
exc_type, exc_value, exc_traceback = sys.exc_info()
stacktrace = "".join(traceback.format_exception(exc_type, exc_value, exc_traceback))
logger.debug(stacktrace)
@spidaman
spidaman / timeouts_with_urllib2.py
Last active December 13, 2015 20:18
in 2013, urllib2 is pretty low level and anachronistic
hard_timelimit = 30
def fetch(url, timelimit=10)
old_timeout = socket.getdefaulttimeout()
if old_timeout == 0:
# we *never* want a hang-forever socket connections
old_timeout = hard_timelimit
socket.setdefaulttimeout(timelimit)
# do shit with urllib2 (build a request with Accept headers, deal transient error retries, etc)
# note that urlopen also takes a timeout param
@spidaman
spidaman / service.py
Created February 16, 2013 19:42
python polymorphism w/class methods
class WtfException(Exception):
pass
class AdaptiveResponse(object):
def __init__(self, params, message):
self.params = params
self.message = message
def __repr__(self):
@spidaman
spidaman / gist:2765569
Created May 22, 2012 00:05
VBoxManage hostonlyif create fails
~ $ mv Vagrantfile vm-workspace/
~ $ cd !$
cd vm-workspace/
~/vm-workspace $ vagrant up
[default] Importing base box 'api-v1.0'...
[default] Matching MAC address for NAT networking...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Creating shared folders metadata...