Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
brew_command=/usr/local/bin/brew
brew_cask_command="$brew_command cask"
echo '#!/bin/bash'
echo ''
echo 'trap ctrl_c INT'
echo 'function ctrl_c() {'
echo 'echo "** Trapped CTRL-C"'

Adrian -

I appreciate that you spent time in writing this post. I know I've been up until 2am writing similarly long ones as well. I will take responsibility for having what is likely an irrational response (I blame Twitter for that) to the term "NoOps", but I invite you to investigate why that might be. I'm certainly not the only one who feels this way, apparently, and thus far have decided this issue is easily the largest distraction in my field I've encountered in recent years. I have had the option to simply ignore my opposition to the term, and just let the chips fall where they may with how popular the term "NoOps" may or may not get. I have obviously not taken that option in the past, but I plan to in the future.

You're not an analyst saying "NoOps". Analysts are easy (for me) to ignore, because they're not practitioners. We have expectations of engineering maturity from practitioners in this field of web engineering, especially those we consider leaders. I don't have any expectations from analysts,

@EntropyWorks
EntropyWorks / create-brew-restore.sh
Last active November 12, 2018 22:41
Backing up my brew install
#!/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)"
@EntropyWorks
EntropyWorks / add-ssh-keys.yml
Last active July 14, 2025 13:57
Add all the hosts from your ansible inventory to your .ssh/known_hosts and also use ssh-copy-id to add keys to the hosts
---
# 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"
@EntropyWorks
EntropyWorks / .bash_gpg-agent
Created March 15, 2017 21:41
Using gpg-agent instead of ssh-agent
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
# 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.
#
@EntropyWorks
EntropyWorks / sshpass.rb
Created June 4, 2017 20:21 — forked from M-Barnett/sshpass.rb
brew install sshpass
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}"
@EntropyWorks
EntropyWorks / webserver.go
Created August 8, 2017 02:13 — forked from alexisrobert/webserver.go
Tiny web server in Go for sharing a folder
/* Tiny web server in Golang for sharing a folder
Copyright (c) 2010-2014 Alexis ROBERT <alexis.robert@gmail.com>
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"
@EntropyWorks
EntropyWorks / aws-swap
Last active January 10, 2018 11:49
Do you have multiple AWS profiles that you need to swap between?
#!/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
@EntropyWorks
EntropyWorks / timestamp.sh
Created November 22, 2017 18:25
Timestamp output
# 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() {