[ Update 2020-05-31: I won't be maintaining this page or responding to comments anymore (except for perhaps a few exceptional occasions). ]
Most of the terminal emulators auto-detect when a URL appears onscreen and allow to conveniently open them (e.g. via Ctrl+click or Cmd+click, or the right click menu).
It was, however, not possible until now for arbitrary text to point to URLs, just as on webpages.
#!/bin/bash | |
# | |
# https://aws.amazon.com/premiumsupport/knowledge-center/authenticate-mfa-cli/ | |
# | |
# Usage: source ~/bin/awssessiontoken | |
# arn:aws:iam::12345689012:mfa/ExampleMFADevice | |
mfa_arn=$(aws iam list-mfa-devices --query 'MFADevices[].SerialNumber' --output text) | |
echo "MFA ARN: $mfa_arn" | |
echo -n "Enter MFA Code: " |
This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.
This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".
But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.
By following this guide you will:
- Never have to run
sudo
to forcefully change permissions of some directory to be owned by your account
AWS provides a mechanism for temporarily assuming another role within their API system. While it is not a technically hard process it can be convoluted and hard to understand. This document aims to both make it easier to follow along with as well as give an in depth explanation of some of the underpinnings of the Bourne Again Shell (aka BASH) which can make this easier to utilize on a day to day basis.
Below is an overexplained version of the following process:
- Using credentials stored in
~/.aws/credentials
as a "profile" which are then understood by the AWS command line tools - Using those AWS credentials, temporarily assume a role using the AWS Security Token Service (STS) to get temporary
#!/usr/bin/env python | |
""" | |
How to use: | |
eval $(eval "aws sts assume-role --role-arn arn:aws:iam::0123456789:role/the-role-name --role-session-name my-aws-prod | ./sts2env") | |
Then run `env` and you should see the environment vars in your shell. | |
""" |
# There's a lack of sample code for acme/Let's Encrypt out there, and | |
# this is an attempt to at least slightly remedy that. It's the result | |
# of my first day's hacking on this stuff, so almost certainly contains | |
# errors and oversights. | |
# | |
# It's not designed to be specifically useful if what you want is | |
# just a cert -- certbot or dehydrated are better for that. It is sample | |
# code for people who are building automated systems to deal with large | |
# numbers of Let's Encrypt certificates to play with. | |
# |