Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Idea and interface taken from https://github.com/macmade/host-manager
path="/etc/hosts"
addusage="Usage: `basename $0` -add host address"
remusage="Usage: `basename $0` -remove host"
case "$1" in
-add)
if [ $# -eq 3 ]; then
if [[ -n $(grep "^$3.*[^A-Za-z0-9\.]$2$" ${path}) ]]; then
#!/bin/bash
# Idea and interface taken from https://github.com/macmade/host-manager
path="/etc/hosts"
addusage="Usage: `basename $0` -add host address"
remusage="Usage: `basename $0` -remove host"
case "$1" in
-add)
if [ $# -eq 3 ]; then
if [[ -n $(grep "^$3.*[^A-Za-z0-9\.]$2$" ${path}) ]]; then
@mikejw
mikejw / gmutt.sh
Last active May 11, 2017 13:06
Email a file from anywhere
#!/bin/bash
# gmutt.sh by Mike Whiting - [email protected]
#
# With one line send file attachments securely
# using mutt from gmail account and then remove generated
# config.
#
# You will need to set up 2-factor authentication with gmail
# and add an app password here:

Keybase proof

I hereby claim:

  • I am mikejw on github.
  • I am mikejw (https://keybase.io/mikejw) on keybase.
  • I have a public key ASAf0WnMsVn1oiZq-i06m4RVkruzbWaDJQ3fIMjWTI2brgo

To claim this, I am signing this object:

2020/01/08 12:38:34 [INFO] Packer version: 1.5.1 [go1.13.5 linux amd64]
2020/01/08 12:38:35 Attempting to open config file: /home/mike/.packerconfig
2020/01/08 12:38:35 [WARN] Config file doesn't exist: /home/mike/.packerconfig
2020/01/08 12:38:35 Setting cache directory: /home/mike/tmp/packertest/packer_cache
2020/01/08 12:38:35 Plugin could not be found at /usr/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso (exec: "/usr/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso": stat /usr/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso: no such file or directory). Checking same directory as executable.
2020/01/08 12:38:35 Current exe path: /usr/bin/packer
2020/01/08 12:38:35 Creating plugin client for path: /usr/bin/packer
2020/01/08 12:38:35 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-builder-virtualbox-iso"}
2020/01/08 12:38:35 Waiting for RPC address for: /usr/bin/packer
2020/01/08 12:38:35 packer-builder-vi