Skip to content

Instantly share code, notes, and snippets.

@chaosbunker
chaosbunker / lifecycle-s3-compatible.py
Last active December 29, 2021 16:53
send bucket cleanup script for https://send.ephemeral.land
# send bucket cleanup script for https://send.ephemeral.land
# Editable variables
# __
aws_access_key_id = "AKIAIOSFODNN7EXAMPLE"
aws_secret_access_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
bucket = "mysendbucket"
lower_limit_days = 1
upper_limit_days = 28
prefixes = range(lower_limit_days, upper_limit_days+1)
endpoint = "https://s3.eu-central-1.wasabisys.com" # Endpoint of bucket
@chaosbunker
chaosbunker / Chromium update script
Last active February 6, 2021 16:51
Get latest Chromium build
#!/usr/bin/env bash
# Chromium update script
#
# Get latest build from
# https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html
# Mac | Linux | ...
OS=Mac
DL_URL=https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/${OS}
LATEST=$(curl "https://www.googleapis.com/storage/v1/b/chromium-browser-snapshots/o/${OS}%2FLAST_CHANGE" | jq '.metadata."cr-commit-position-number"' | sed -e s/\"//g)
@chaosbunker
chaosbunker / self-host-padloc-with-docker.md
Created January 5, 2020 10:17
How to self-host padloc 3

I couldn't wait until the official guide on how to do this is released, so I tried to figure it out and this is how I got it working.

The .env file for docker-compose

PL_SUPPORT_EMAIL=support@example.com
PL_SERVER_PORT=3000
PL_SERVER_URL=https://example.com/api
PL_PWA_PORT=8080
PL_PWA_URL=https://example.com

Keybase proof

I hereby claim:

  • I am chaosbunker on github.
  • I am drodewyk (https://keybase.io/drodewyk) on keybase.
  • I have a public key ASBwhumdyGJWsjb9V2CAdFmnFZBFRlD_GEPRh4GG5SRwwwo

To claim this, I am signing this object:

@chaosbunker
chaosbunker / remove_munkitools.sh
Created May 19, 2018 20:56
Completely remove munkitools
#!/usr/bin/env bash
sudo launchctl unload /Library/LaunchDaemons/com.googlecode.munki.*
sudo rm -rf "/Applications/Utilities/Managed Software Update.app"
sudo rm -rf "/Applications/Managed Software Center.app"
sudo rm -f /Library/LaunchDaemons/com.googlecode.munki.*
sudo rm -f /Library/LaunchAgents/com.googlecode.munki.*
sudo rm -rf "/Library/Managed Installs"
@chaosbunker
chaosbunker / set-wallpaper.py
Created March 1, 2016 19:05 — forked from gregneagle/gist:6957826
Using PyObjC and NSWorkspace to set the desktop picture. I am such a hypocrite!
#!/usr/bin/python
'''Uses Cocoa classes via PyObjC to set a random desktop picture on all screens.
Tested on Mountain Lion and Mavericks.
See:
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html
@chaosbunker
chaosbunker / gnuize.sh
Last active January 13, 2016 23:48 — forked from clayfreeman/gnuize.sh
GNU-ize Mac OS X El Capitan
#!/bin/bash
# install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master$
brew doctor
# Install required packages from Homebrew
brew tap homebrew/dupes
brew install coreutils binutils diffutils ed findutils gawk gnu-indent gnu-sed \
@chaosbunker
chaosbunker / Install_XCode.applescript
Created January 12, 2016 18:17 — forked from trinitronx/Install_XCode.applescript
Script to automate XCode installation. Tested on OSX 10.8.4 Mountain Lion. I feel like using the UI element hierarchy is quite disgusting, but it works for now...
-- Function to select a menu item
-- We will use this to trigger the search box for the App Store
on do_menu(app_name, menu_name, menu_item)
try
-- bring the target application to the front
tell application app_name
activate
end tell
tell application "System Events"
tell process app_name