brian wickman - @wickman
[TOC]
Pants makes the manipulation and distribution of hermetically sealed Python environments
root@orion:/etc/acpi# cat /etc/acpi/events/fucking-headphones-plugged-in | |
# Fucking headphones man | |
event=jack/headphone HEADPHONE plug | |
action=/etc/acpi/fucking-headphones-plugged-in.sh | |
root@orion:/etc/acpi# cat /etc/acpi/fucking-headphones-plugged-in.sh | |
#!/bin/sh | |
# 2 is not pulled out of my ass. See `pactl list short sinks`. | |
su ema -c 'pactl list short sink-inputs | while read x y ; do pactl move-sink-input $x 2; done' |
#!/usr/bin/python | |
# | |
# LICENSE: MIT | |
# | |
# Copyright (C) 2014 Samuel Stauffer | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to | |
# deal in the Software without restriction, including without limitation |
#See: http://daringfireball.net/2010/07/improved_regex_for_matching_urls | |
import re, urllib | |
GRUBER_URLINTEXT_PAT = re.compile(ur'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))') | |
for line in urllib.urlopen("http://daringfireball.net/misc/2010/07/url-matching-regex-test-data.text"): | |
print [ mgroups[0] for mgroups in GRUBER_URLINTEXT_PAT.findall(line) ] |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns on recent CPU
L2 cache reference ........................... 7 ns 14x L1 cache
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory
Edward Snowden answered questions after a showing of CITIZENFOUR at the IETF93 meeting; this is a transcript of the video recording.
For more information, see the Internet Society article.
Short link to this page: http://caseywatts.com/ptt
Other gists & tricks: http://caseywatts.com/gists-and-tricks
Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book
Add Page...
PTT
(push to talk) or whatever you'd like (maybe short so it stays on your bookmarks toolbar)A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
Couldn't find the text of this for a while...
The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.
I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.