Skip to content

Instantly share code, notes, and snippets.

@Dunedan
Dunedan / usr.games.pyrogenesis
Last active June 12, 2024 10:13
apparmor profile for 0ad
#include <tunables/global>
/usr/games/pyrogenesis {
#include <abstractions/audio>
#include <abstractions/base>
#include <abstractions/dbus-session-strict>
#include <abstractions/freedesktop.org>
#include <abstractions/nameservice>
#include <abstractions/nvidia>
#include <abstractions/wayland>
#!/usr/bin/sudo sh
## ruby_revealer.sh -- decrypt obfuscated GHE .rb files. 2.0.0 to 2.3.1+.
## From `strings ruby_concealer.so`:
##
## > This obfuscation is intended to discourage GitHub Enterprise customers
## > from making modifications to the VM.
##
## Well, good, as long as its not intended to discourage *me* from doing this!
@Dunedan
Dunedan / respawn.sh
Last active March 24, 2017 17:52
Executes the command provided as argument and respawns it if it got terminated.
#!/bin/sh
# Executes the command provided as argument and respawns it if it got
# terminated.
#
# Licensed under CC0 <https://creativecommons.org/publicdomain/zero/1.0/>
$@ &
PID=$!
while :
@Dunedan
Dunedan / aws-s3-get-bucket-lifecycles.sh
Last active July 25, 2022 23:02
Small bash script to get the lifecycle transitions of all buckets in an AWS account.
#!/bin/bash
# Licensed under CC0 <https://creativecommons.org/publicdomain/zero/1.0/>
AWS_PROFILE="default"
BUCKETS=$(aws --profile $AWS_PROFILE s3api list-buckets --query 'Buckets[*].Name' --output text)
echo -e "bucket name\tstatus of the transition\tprefix the transition applies to\tdays after which the transition applies\tto storage class\tdelete after days\tdescription"
for bucket in $BUCKETS; do
@Dunedan
Dunedan / otp.sh
Last active April 10, 2017 17:58
OTP token generation script
#!/bin/sh
# Reads OTP secrets belonging to an readable name from a file and generates OTP
# tokens. The secrets should be in a file, separated by a colon.
# E.g. test:secretkey
#
# Works really nicely together with an alias:
# alias otp='~/otp.sh'
#
# Licensed under CC0 <https://creativecommons.org/publicdomain/zero/1.0/>