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:
I hereby claim:
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 \ |
| # Not originally created by me btw. | |
| # Handy python timestamp trick | |
| function p-timestamp() { | |
| python -c 'import sys,time;sys.stdout.write("".join\ | |
| (( " ".join((time.strftime("[%Y-%m-%d %H:%M:%S]", time.localtime())\ | |
| , line)) for line in sys.stdin )))' | |
| } | |
| ## Custom echo that adds a timestamp | |
| function echo() { |
| #!/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(){ | |
| unset AWS_DEFAULT_PROFILE |
| /* Tiny web server in Golang for sharing a folder | |
| Copyright (c) 2010-2014 Alexis ROBERT <[email protected]> | |
| Contains some code from Golang's http.ServeFile method, and | |
| uses lighttpd's directory listing HTML template. */ | |
| package main | |
| import "net/http" | |
| import "net/url" |
| require 'formula' | |
| class Sshpass < Formula | |
| url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz' | |
| homepage 'http://sourceforge.net/projects/sshpass' | |
| sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60' | |
| def install | |
| system "./configure", "--disable-debug", "--disable-dependency-tracking", | |
| "--prefix=#{prefix}" |
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # GNU General Public License for more details. | |
| # |
| GPG_TTY=$(tty) | |
| export GPG_TTY | |
| if test -f "$HOME/.gpg-agent-info" && \ | |
| kill -0 "$(grep GPG_AGENT_INFO "$HOME/.gpg-agent-info" | cut -d: -f 2)" 2>/dev/null; then | |
| . "${HOME}/.gpg-agent-info" | |
| echo "first . ${HOME}/.gpg-agent-info" | |
| export GPG_AGENT_INFO | |
| export SSH_AUTH_SOCK | |
| export SSH_AGENT_PID |
| --- | |
| # Original idea found at http://stackoverflow.com/a/39083724 | |
| # | |
| # ansible -i inventory.ini add-ssh-keys.yml | |
| # | |
| - name: Store known hosts of 'all' the hosts in the inventory file | |
| hosts: localhost | |
| connection: local | |
| vars: | |
| ssh_known_hosts_command: "ssh-keyscan -T 10" |
| #!/bin/bash | |
| # Pipe the output to create your own restore-brew.sh | |
| # | |
| brew_command=/usr/local/bin/brew | |
| echo '#!/usr/bin/env ANSIBLE_HOSTS="" ANSIBLE_CONNECTION=local ansible-playbook' | |
| echo '# vim:ft=yaml' | |
| echo '' | |
| echo '---' | |
| echo "- name: Homebrew Restore from $(date)" |