Skip to content

Instantly share code, notes, and snippets.

@itod
itod / split_keyboards.md
Last active July 14, 2026 03:46
Every "split" mechanical keyboard currently being sold that I know of
@eferro
eferro / _aws_golang_examples.md
Last active February 5, 2026 21:27
golang aws: examples

AWS Golang SDK examples

@clstokes
clstokes / assume-role-policy.json
Last active September 1, 2022 20:15
Example: Terraform IAM Role
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
alias REGIONS_NAMES='aws ec2 describe-regions | jq ".Regions[].RegionName" -r'
alias TERMINATE='aws ec2 terminate-instances --instance-ids'
alias STOP='aws ec2 stop-instances --instance-ids'
alias START='aws ec2 start-instances --instance-ids'
alias MON_ENA='aws ec2 monitor-instances --instance-ids'
alias MON_DIS='aws ec2 unmonitor-instances --instance-ids'
RESIZE() {
aws ec2 modify-instance-attribute --instance-id "$1" --instance-type "{\"Value\": \"$2\"}"
}
DESC() {
@mlapida
mlapida / EC2-Tag-Assets-Lambda.py
Last active January 17, 2024 08:10
A lambda function that will copy EC2 tags to all related Volumes and Network Interfaces. A full writeup can be found on my site https://empty.coffee/tagging-and-snapshotting-with-lambda/ - Thank you to the community for keeping this updated!
from __future__ import print_function
import json
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
@devster31
devster31 / swap.yml
Last active December 17, 2025 16:51 — forked from manuelmeurer/swap.yml
Ansible role for creating a Swap file
- name: set swap_file variable
set_fact:
swap_file: /{{ swap_space }}.swap
- name: check if swap file exists
stat:
path: "{{ swap_file }}"
register: swap_file_check
- name: create swap file
@rmullinnix
rmullinnix / cluster_bounce.yml
Last active January 22, 2021 22:56
Ansible playbook for consul cluster bounce - ansible-playbook -i hosts.dev cluster_bounce.yml --ask-become-pass (peers.tmpl is in roles/consul/templates; sedfile is in roles/consul/files; main.yml is in roles/consul/vars)
---
# This Playbook bounces a consul cluster that is unable to elect a leader
# push peers.json to the consul/raft data directory, change single quotes to doubles, restart consul servers
- hosts: consulservers
become: yes
# update the peers.json file with the correct consul server ip addresses and port
tasks:
- include_vars: roles/consul/vars/main.yml
@stephen-mw
stephen-mw / list_ec2_instances.md
Last active February 13, 2025 04:27
List running EC2 instances with golang and aws-sdk-go

This is the beginning of hopefully many new posts with golang snippets from my blog. List all of your running (or pending) EC2 instances with Amazon's golang sdk.

For a list of filters or instance attributes consult the official documentation.

package main

import (
	"fmt"
	"github.com/awslabs/aws-sdk-go/aws"
@tuxfight3r
tuxfight3r / tcp_flags.txt
Last active July 15, 2026 02:05
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@willurd
willurd / web-servers.md
Last active July 17, 2026 18:54
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000