I hereby claim:
- I am entropyworks on github.
- I am entropyworks (https://keybase.io/entropyworks) on keybase.
- I have a public key ASBEizwP9cMSt_Cng03KzF4GnkgiLVpfr4x48Vdb_RM0UAo
To claim this, I am signing this object:
| #!/bin/sh | |
| # Use AWS CLI to get the most recent version of an AMI that | |
| # matches certain criteria. Has obvious uses. Made possible via | |
| # --query, --output text, and the fact that RFC3339 datetime | |
| # fields are easily sortable. | |
| export AWS_DEFAULT_REGION=us-east-1 | |
| aws ec2 describe-images \ |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # https://blog.sleeplessbeastie.eu/2017/10/16/how-to-automatically-control-apt-cache/ | |
| # | |
| sudo echo "Lets Go!" | |
| echo -e 'APT::Periodic::BackupArchiveInterval "7";\nAPT::Periodic::BackupLevel "3";\nDir::Cache::Backup "backup/";' | sudo tee /etc/apt/apt.conf.d/99_periodic_backup | |
| echo -e 'APT::Periodic::MaxAge "14";' | sudo tee /etc/apt/apt.conf.d/99_periodic_autoclean | |
| echo -e 'APT::Periodic::MaxSize "1024";\nAPT::Periodic::MinAge "2";' | sudo tee /etc/apt/apt.conf.d/99_periodic_autoclean | |
| echo -e 'APT::Periodic::AutocleanInterval "10";' | sudo tee /etc/apt/apt.conf.d/99_periodic_autoclean | |
| echo -e 'APT::Periodic::Verbose "1";' | sudo tee /etc/apt/apt.conf.d/10_periodic_verbose | |
| echo -e 'APT::Periodic::Update-Package-Lists "1";' | sudo tee /etc/apt/apt.conf.d/99_update-package-lists |
| #!/bin/bash | |
| # | |
| # Do you have multiple AWS profiles? | |
| # Here is how I deal with them. | |
| # | |
| # Make sure you add "${HOME}/.bash_aws_profile" to your .bashrc or .bash_profile so | |
| # all new terminal sessions are updated with your choice. | |
| # | |
| aws-swap_function() { | |
| AWS_DEFAULT_PROFILE="null" |
| #!/usr/bin/env ANSIBLE_HOSTS="" ANSIBLE_CONNECTION=local ansible-playbook | |
| # vim:ft=yaml | |
| --- | |
| - name: Homebrew Restore from Thu Mar 21 12:37:16 PDT 2019 | |
| hosts: 127.0.0.1 | |
| connection: local | |
| tasks: | |
| - name: check for xcode |
| --- | |
| - name: Install MacOS Packages | |
| hosts: localhost | |
| become: false | |
| vars: | |
| brew_cask_packages: | |
| - 'atom' | |
| - 'docker' | |
| - 'dropbox' | |
| - 'firefox' |
| default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
| default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
| default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
| # Eample of adding a hash for your own safety before running downloaded stuff. | |
| # | |
| # make+_hash: a73c1a409cd3b709ff7d10b9f40a0b817de2bba0 - | |
| # | |
| # This makes two calls outside but you could make just one. Also depends on having a compatable grep and shasum installed. | |
| include $(shell grep -m 1 "make+_hash" Makefile | cut -f2 -d: > .make+_hash && curl -s https://makeplus.net/make+ | shasum -qc .make+_hash && curl -s https://makeplus.net/make+ | bash) | |
| 50-50 = return $((RANDOM % 2)) |
Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.
Yazz Atlas modified the Licensed Material and retain an indication of any previous modifications; Licensed Material is licensed under this Public License,(CC-BY-SA-4.) open-source license.
These are python 2 and 3 snippets showing how to generate headers to authenticate with HashiCorp's Vault using the AWS authentication method. There's also a Ruby implementation which uses version 3 of the AWS SDK for Ruby.
The python scripts look for credentials in the
default boto3 locations;
if you need to supply custom credentials (such as from an AssumeRole call), you would use the
botocore.session.set_credentials
method before calling create_client.