Skip to content

Instantly share code, notes, and snippets.

@watmough
watmough / README.md
Created March 18, 2024 23:57 — forked from manics/README.md
Minio server with the Security Token Service (STS) and AssumeRole for temporary session tokens

MinIO Security Token Service (STS)

This is an example of setting up a Minio server with the Security Token Service (STS) and AssumeRole for temporary session tokens.

You must create a new Minio user to use STS, the default Minio access/secret won't work. The new user must have access to the objects you will be creating sessions for, the permissions of the created session are the intersection of the permissions of the STS user and the inline permissions requested when the session is created

Tested on 2020-04-06 with the current version of Minio. This is probably RELEASE.2020-04-04T05-39-31Z, though if using Homebrew on Mac OSX minio --version outputs DEVELOPMENT.GOGET so who knows.

@watmough
watmough / gist:b1d61bf25e9b638a60624ced15aa4069
Created April 30, 2023 15:27
Editing Firefox handlers.json To Open Browser or External Links in a Same Tab, New Tab or New Window
# Editing Firefox `handlers.json` To Open Browser or External Links in a Same Tab, New Tab or New Window
Sourced from: https://support.mozilla.org/bm/questions/1258193
Thanks to: [jscher2000](https://support.mozilla.org/bm/user/jscher2000/)
See `about:support` for help finding the profile folder.
See `about:config` for updating settings in a UI.
I'm going to show all three of these related preferences:
@watmough
watmough / gist:a0e3d371287e8829576b9b46822e8d63
Created March 6, 2021 18:39 — forked from dsc/gist:3855240
Python argparse Cheatsheet
Arg Name or Optional Flags:
positional : str = "foo"
options : str = "-f", "--foo"
Standard:
action : str = [store], append, store_true, store_false, store_const, append_const, version
default : * = [None]
type : callable = [str], argparse.FileType(mode='wb', bufsize=0)
Exotic:
@watmough
watmough / dropbox_ext4.c
Created February 18, 2019 02:23 — forked from dimaryaz/dropbox_ext4.c
Dropbox ext4 hack
/*
* dropbox_ext4.c
*
* Compile like this:
* gcc -shared -fPIC -ldl -o libdropbox_ext4.so dropbox_ext4.c
*
* Run Dropbox like this:
* LD_PRELOAD=./libdropbox_ext4.so ~/.dropbox-dist/dropboxd
*/
@watmough
watmough / day_05.c
Last active December 6, 2018 00:24
Day 5 - Alchemical Reduction
// Advent of Code 2018
// Day 05 - Alchemical Reduction
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int react(char * s) {
char *r = s+1, *w = s;
while (*r)
@watmough
watmough / reader.hpp
Created December 3, 2018 03:00
READER_HPP
#ifndef READER_HPP
#define READER_HPP
// Advent of Code 2018
// Handy text file reader returning vector<string>
// See: https://stackoverflow.com/a/1567703/33758
#include <iostream>
#include <fstream>
#include <string>
@watmough
watmough / utils.hpp
Created December 3, 2018 02:58
UTILS_HPP
#ifndef UTILS_HPP
#define UTILS_HPP
// Advent of Code 2018
// utils.hpp
#include <iterator>
// Count non-matching values over two ranges of iterators
// See: https://en.cppreference.com/w/cpp/algorithm/count
Z420 http://technofaq.org/posts/2014/09/installing-mac-osx-10-9-4-mavericks-on-hp-z420-workstation/
Z620 http://sixflow.net/osx86/System/86380
https://support.hp.com/us-en/product/hp-z620-workstation/5225037/document/c03270936#AbT2
### z620 hackintosh, Sierra, 10.12.4
#### Partial hardware info of z620:
- Intel 82579LM Ethernet
- ALC262 audio
@watmough
watmough / day_20.fs
Created December 21, 2017 20:47
Advent of Code Day 20 F# Part 2
open System
//module <%= namespace %>
// needed to make inference work e.g. num.MaxValue ???
// cite here:
type num = int32
// read from file
let lines filePath = System.IO.File.ReadLines(filePath);;
@watmough
watmough / gist:0a11ecc424799ea5557901fe0bd9418c
Last active December 15, 2016 04:36
Silver Dollar Game in Rust
extern crate rand;
use rand::Rng;
use std::io;
// From "Practical Programs for the BBC Computer and Acorn ATOM"
// (c) David Johnson-Davies
// Sigma Technical Press 1983
// Silver Dollar Game
// http://www.acornatom.nl/atom_plaatjes/boeken/pracprog/pp.htm