Skip to content

Instantly share code, notes, and snippets.


Stewart Henderson bowlofstew

View GitHub Profile
# Use Google Cloud Platform stackdriver with python structlog
from import Client
from import _helpers
from import CloudLoggingHandler
from import _Worker
# pip install python-json-logger
from pythonjsonlogger import jsonlogger
bowlofstew / gist:2521f29ef757892c7980645a4ce13a4e
Created Oct 26, 2019 — forked from berlinbrown/gist:4583728
Simplest Possible Web Crawler with C++
View gist:2521f29ef757892c7980645a4ce13a4e
// Name : OctaneCrawler.cpp
// Author : Berlin Brown (berlin dot brown at
// Version :
// Copyright : Copyright Berlin Brown 2012-2013
// License : BSD
// Description : This is the simplest possible web crawler in C++
// Uses boost_regex and boost_algorithm
View .pylintrc
# Specify a configuration file.
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
# Profiled execution.

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

View multi_user_wire.tla
-------------------------- MODULE multi_user_wire --------------------------
EXTENDS Integers, Sequences
CONSTANTS Users, Servers, Accounts
AtMostOneAdminPerOrg(users, orgs) == {roles \in [users -> {"user","admin"}]:
\A x,y \in users: (roles[x] = "admin" /\ roles[y] = "admin") => x = y}
bowlofstew / attributes.rb
Created Apr 21, 2019 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
View attributes.rb
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
View gist:b88f47c99c4819bee997cec2265f752e
# Video:
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
bowlofstew / Packer-Windows.json
Created Feb 14, 2019 — forked from janegilring/Packer-Windows.json
Packer file for building Windows base images
View Packer-Windows.json
"builders": [
"type": "hyperv-iso",
"output_directory": "./output-{{ user `os_name` }}-base-hyperv/",
"temp_path": "C:\\ClusterStorage\\HYPData01\\PackerTemplates\\temp",
"vm_name": "{{ user `os_name` }}-base",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "sha1",

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](

bowlofstew /
Created Jan 17, 2019 — forked from roydekleijn/
Selenium WebDriver Javascript execution for localStorage
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
public class LocalStorage {
private JavascriptExecutor js;
public LocalStorage(WebDriver webDriver) {
this.js = (JavascriptExecutor) webDriver;