This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
region = "us-west-2" | |
} | |
resource "aws_s3_bucket" "example_bucket" { | |
bucket = "example-bucket" | |
versioning { | |
enabled = true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table dfs.tmp.flow as select cast(version as integer) as version, account_id, interface_id, srcaddr, dstaddr, cast(srcport as integer) as srcport, cast(dstport as integer) as dstport, cast(protocol as int) as protocol, cast(packets as bigint) as packets, cast(bytes as bigint) as bytes, from_unixtime(cast(start as bigint)) as start, from_unixtime(cast(end as bigint)) as end, action, log_status, intstance_id, pkt_srcaddr, pkt_dstaddr from dfs.`Users/jferland/scratch/vpc_flow` where log_status = 'OK'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRCS := $(wildcard *.gz) | |
OBJS := $(patsubst %.gz,%.zst,$(SRCS)) | |
zstd: $(OBJS) | |
%.zst: %.gz | |
gunzip -c $< | zstd -9 -q -o $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
emotion = sys.argv[1] | |
if emotion == "rage": | |
output = " ".join([":rage%s:" % i for i in range(1,5)]) | |
if emotion == "clap": | |
output = ":clap: " + \ | |
" ".join([":clap::skin-tone-%s:" % i for i in range(2,7)]) | |
if emotion == "time": | |
hours = [str(i) for i in ["12"] + list(range(1,12))] | |
faces = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pre-commit | |
for file in $(git diff --cached --name-only --diff-filter=ACM); do | |
if [[ $file =~ \.sls$ ]] | |
then $(git rev-parse --show-toplevel)/$GIT_DIR/hooks/check-jinja.py $file | |
fi | |
done | |
#check-jinja.py | |
#!/usr/bin/env python | |
from __future__ import print_function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# *** ERROR *** | |
# | |
# There is a templating error preventing this file from rendering correctly. | |
# | |
# This is most likely not due to a bug in Cobbler and is something you can fix. | |
# | |
# Look at the message below to see what things are causing problems. | |
# | |
# (1) Does the template file reference a $variable that is not defined? | |
# (2) is there a formatting error in a Cheetah directive? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import futures | |
import boto | |
region=foo | |
bucket=bar | |
c = boto.s3.connect_to_region(region) | |
b = c.get_bucket(bucket) | |
pool = futures.ThreadPoolExecutor(max_workers=5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015-07-15 05:22:59 | |
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode): | |
"Attach Listener" #1824 daemon prio=9 os_prio=0 tid=0x00007fa7dc425000 nid=0x37fa waiting on condition [0x0000000000000000] | |
java.lang.Thread.State: RUNNABLE | |
"RMI TCP Connection(29)-10.0.1.201" #1762 daemon prio=5 os_prio=0 tid=0x00007fa7dc1a7800 nid=0x34db runnable [0x00007fa459197000] | |
java.lang.Thread.State: RUNNABLE | |
at java.net.SocketInputStream.socketRead0(Native Method) | |
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'd say the median parking space in San Francisco runs about $300 per month, or $10 per day. At $3 million dollars rent, they'd need to store an average of 833 cars to get that income. At $57.25 + $140 in towing fees, they need to process roughly 60 cars per day just to make the rent. Of consideration, though is, is that a car towed for an unlicensed driver or driver with a suspended license is the vehicle is held for 30 days, so now they only need to process 2 of those per day. What's missing is information about how many cars per day they do process. | |
Now, while I don't know how much area they have I do know that they can't pack vehicles as efficiently as a regular lot, nor can they handle the in/out process as efficiently. Yet even with that in mind, something just seems wrong about it all. | |
EDIT 1: Every year, approx. 70,000 cars are towed, giving us an average of 191 vehicles processed per day. They auction roughly 200 vehicles per month (checking a few weeks of auctions from their site) with a recovery ra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# Holy crap this library is so unoptimized ... | |
import spans | |
class longrange(spans.intrange): | |
type = long | |
class longrangeset(spans.intrangeset): | |
type = longrange |