Skip to content

Instantly share code, notes, and snippets.

@pommi
pommi / get-accounts-recursive.sh
Created October 12, 2022 09:38 — forked from atheiman/get-accounts-recursive.sh
Get all accounts within an AWS Organizations organizational unit recursively (all accounts nested under any child OUs)
#!/bin/bash
if [ -z "$1" ]; then
echo "Error - Usage: $0 <parent-id>"
exit 1
fi
set -eu
# set -x
@pommi
pommi / trac2down.py
Last active October 9, 2019 00:55 — forked from sgk/trac2down.py
Trac Wiki to Markdown converter
#!/usr/bin/python
# vim:set fileencoding=utf-8 sw=2 ai:
# downloaded from https://gist.github.com/tcchau/4628317
# ... which is a fork from https://gist.github.com/sgk/1286682
import sqlite3
import datetime
import re
# additional imports --ah
@pommi
pommi / rsnapshot_plug_rm_btrfs
Created August 31, 2012 19:19
a small shell script that can be used within rsnapshot as cmd_rm. It provides snapshots generated with btrfs instead of hard-links
#!/bin/sh
# Arg 1: -rf
# Arg 2: /testbtrfs/backups/hourly.4/
# echo 1: $1 2: $@
# Try to delete the given path with btrfs subvolume delete first
# Check if inode number == 256 (all subvolumes have inode number 256)
if [ "$1" = "-rf" -a "$3" = "" -a $(stat --printf='%i' $2) -eq 256 ]; then