Skip to content

Instantly share code, notes, and snippets.

View lost-theory's full-sized avatar

Steven Kryskalla lost-theory

View GitHub Profile
@lost-theory
lost-theory / 01_intro.md
Last active January 16, 2021 17:23
FutureStack14 notes

FutureStack 14 notes

Best talks day 1

  • Taming the Modern Datacenter, Mitchell Hashimoto, Hashicorp
    • look at the future of CM systems using Terraform, moving up a level from managing per-machine resources, enabling Infrastructure as Code for the modern distributed data center (mix of IaaS like AWS/DO, PaaS like Heroku, and SaaS for things like DNS and email); I'm a bit skeptical all the complexity of Terraform is significantly better than a minimal layer of glue code to wire up different APIs together.. still interesting though
  • Towards a Data Driven Product, Techniques and Tools at GitHub, JD Maturen, GitHub
    • covered the basics of data science & analytics, gave some insights into how GitHub does it
  • Understanding Developers in a Post Agile Environment, Ward Cunningham (inventor of wiki), New Relic
  • some interesting ideas on how to become a master engineer, "leveraged activities" vs. normal activities,
@lost-theory
lost-theory / security-pd-meetup.md
Last active September 11, 2018 07:56
Security meetup @ Pagerduty 2014-07-11
@lost-theory
lost-theory / 01_intro.md
Last active March 26, 2019 15:52
Monitorama 2014 notes

Monitorama 2014 notes

http://monitorama.com/

Best talks day 1:

  • Please, no More Minutes, Milliseconds, Monoliths... or Monitoring Tools! - Adrian Cockcroft
    • gave 5 good rules for monitoring systems, showed what cloud / microservices monitoring looks like @ Netflix
  • Simple math to get some signal out of your noisy sea of data - Toufic Boubez
  • explains why static alert thresholds don't work and gave 3 techniques to use instead
@lost-theory
lost-theory / dog_reader.py
Created February 18, 2014 19:53
dogpile.cache
'''
Starting a reader while a few dog_writer.py processes are running in the background:
$ bin/python dog_reader.py
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ???
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? 190 172 159 ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? 732 ???
??? ??? ??? ??? ??? 190 ??? ??? ??? ??? 190 172 190 ??? ??? ??? 172 ??? ??? 732 ??? ??? ??? ??? ??? ??? ??? ??? 732 159
??? 172 ??? ??? 159 172 ??? ??? ??? ??? 190 172 190 ??? ??? ??? 172 159 ??? 732 ??? ??? ??? 172 732 ??? ??? 732 732 159
172 172 ??? ??? 159 172 ??? ??? 172 ??? 190 172 190 159 ??? ??? 172 159 ??? 732 ??? ??? ??? 732 732 ??? 172 732 732 159
172 732 ??? ??? 159 172 ??? ??? 172 ??? 190 172 190 159 159 ??? 172 732 ??? 732 ??? ??? ??? 190 732 732 172 732 732 159
$ #spoiler alert!
$ grep -rn CLUE .
$ for v in `grep Make: vehicles | awk '{print $2}' | sort | uniq`; do grep -rn $v interviews; done;
$ python
>>> membership_suspects = reduce(set.intersection, map(set, [[x.strip() for x in open("memberships/%s" % y).readlines()] for y in ["AAA", "Delta_SkyMiles", "Museum_of_Bash_History"]]))
>>> people = [x.strip().split('\t') for x in open("people").readlines() if "\t" in x]
>>> male_suspects = [x[0] for x in people if x[1] == "M"]
@lost-theory
lost-theory / ssl_test.py
Created December 24, 2013 21:00
ssl_test.py
'''
From: http://superuser.com/a/224263
'''
import commands
def get_ciphers():
ciphers = commands.getoutput("openssl ciphers 'ALL:eNULL'").strip()
return ciphers.split(':')
@lost-theory
lost-theory / who_is_on_call.py
Created December 19, 2013 01:32
how to show the name of the person on-call right now for a pagerduty schedule
import pygerduty
from datetime import datetime as dt, timedelta as d
p = pygerduty.PagerDuty("user-goes-here", "api-key-goes-here")
sched = p.schedules.show('SCHEDULEID')
t0 = dt.now()
t1 = t0 + d(minutes=1)
result = sched.entries.list(since=t0.strftime("%F %T"), until=t1.strftime("%F %T"))
@lost-theory
lost-theory / netstat-2015.md
Last active September 10, 2018 11:25
netstat on all machines -> python -> graphviz -> png
$ knife ssh -m "...every host in the network..." "sudo netstat -nutap" -a hostname > meganetstat.txt
$ python
>>> from collections import Counter as C
>>> HS = "...every host in the network...".split()
>>> ip = lambda s: s.split(":")[0]
>>> xs = [map(ip, [x[0], x[4], x[5]]) for x in [x.strip().split() for x in open("meganetstat.txt").readlines() if "tcp" in x] if len(x)>=6]
>>> ipmap = [(h, C([x[1] for x in xs if x[0] == h])) for h in HS]
>>> ipmapx = dict([(sorted([(x,y) for (x,y) in ip[1].items() if x.startswith("10.")], key=lambda t: -t[1])[0][0], ip[0]) for ip in ipmap])
>>> sorted(C(map(ipmapx.get, [x[2] for x in xs if x[2].startswith("10.")])).items(), key=lambda t: t[1])
@lost-theory
lost-theory / worker.py
Last active December 16, 2015 04:29
simple background worker process
'''
To test, first make a bunch of job files in the same directory this file is in:
$ for i in `seq 300`; do echo $i > $i.job; done;
Then fire up a bunch of workers:
$ python worker.py &
$ python worker.py &
$ python worker.py &
@lost-theory
lost-theory / gist:4759801
Created February 12, 2013 02:40
t2s i0s f1n
>>> ' '.join(map(lambda s: "%s%s%s" % (s[0], len(s)-2, s[-1]), "steven kryskalla".split()))
's4n k7a'
>>> ' '.join(map(lambda s: "%s%s%s" % (s[0], len(s)-2, s[-1]), "this is fun".split()))
't2s i0s f1n'