Skip to content

Instantly share code, notes, and snippets.

@mauvehed
mauvehed / enable_to_sudo_authenticate_with_touch_id.sh
Last active May 18, 2024 20:36
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 / The_Rules.md
Last active June 26, 2024 18:49
The Rules - guidelines learned through hard experience in operations

NEW! Fan of the list Diego Peinador has done what I've been too lazy to do for years: stand up an easily-remembered domain for The Rules, complete with one-per-page URL schema - e.g., for Rule 42 just visit https://the-rul.es/42/

Thanks Diego! <3

(subject to additions, but rarely changes)

rule 0: It has to work.

rule 1: As simple as possible.

@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 July 9, 2021 07:38
link for reinvent slides
@acolyer
acolyer / service-checklist.md
Last active June 20, 2024 08:47
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 July 4, 2024 03:29
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