Skip to content

Instantly share code, notes, and snippets.

@mauvehed
mauvehed / enable_to_sudo_authenticate_with_touch_id.sh
Last active September 27, 2024 21:59
Enable sudo auth for macOS touchID via pam
#!/bin/bash
#
# credit to machupicchubeta/dotfiles/bin/enable_to_sudo_authenticate_with_touch_id.sh
set -eu
set -o pipefail
sudo chmod +w /etc/pam.d/sudo
if ! grep -Eq '^auth\s.*\spam_tid\.so$' /etc/pam.d/sudo; then
( set -e; set -o pipefail
# Add "pam_tid.so" to a first authentication
@darkuncle
darkuncle / Fairness_and_Generosity.md
Last active February 26, 2026 15:29
The Rules - guidelines learned through hard experience in operations

(taken from Hard Sayings of the Bible)

The Rate for the Job? (Mt 20:14-15)

One of the complaints that right-living and religious people made about Jesus arose from his treatment of the more disreputable members of society. They might have agreed that such persons should not be entirely excluded from the mercy of the all-loving God. Even for them there was hope, if they showed by practical repentance and unquestionable amendment of life that they were not beyond redemption. But not until such evidence had been given could they begin to be accepted as friends and neighbors. Jesus, however, accepted them immediately; he did not wait to see the outcome before he committed himself to them. This was disturbing; it was even more disturbing that he seemed to think more highly of them than of those who had never blotted their public copybook. He gave the impression that he actually preferred the company of the rejects of society; he not only made them feel at home in his company, so that they felt free to take l

@quinnypig
quinnypig / buildspec.yml
Last active October 16, 2018 04:43
The buildspec.yml that deploys Last Week in AWS.
version: 0.2
phases:
install:
commands:
- echo Entered the install phase...
- pip install -r requirements.txt
build:
commands:
- echo Entered the build phase...
@thibautsacreste
thibautsacreste / aws.sg.unused
Last active June 4, 2024 10:12
Bash: list unused AWS security groups
#!/usr/bin/env bash
# lists all unused AWS security groups.
# a group is considered unused if it's not attached to any network interface.
# requires aws-cli and jq.
# all groups
aws ec2 describe-security-groups \
| jq --raw-output '.SecurityGroups[] | [.GroupName, .GroupId] | @tsv' \
| sort > /tmp/sg.all
@henrysher
henrysher / reinvent.md
Last active August 25, 2025 23:22
link for reinvent slides
@acolyer
acolyer / service-checklist.md
Last active February 16, 2026 02:23
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@takeshixx
takeshixx / hb-test.py
Last active September 8, 2025 01:16
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@jedisct1
jedisct1 / snitchy-overdose.c
Created October 10, 2012 03:32
Running Little Snitch? Have fun.
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <inttypes.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@zenkay
zenkay / gist:3237860
Created August 2, 2012 15:19
Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

web: gunicorn -w4 -b0.0.0.0:$PORT app:app