Skip to content

Instantly share code, notes, and snippets.

View fulgorek's full-sized avatar

Alejandro Torres fulgorek

View GitHub Profile
@fulgorek
fulgorek / ask.sh
Created January 12, 2019 12:29
Bash General-Purpose Yes/No Prompt Function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# https://gist.github.com/davejamesmiller/1965569
local prompt default reply
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@fulgorek
fulgorek / install-packer-on-mac-os.sh
Created April 19, 2017 13:07 — forked from akora/install-packer-on-mac-os.sh
Install packer on Mac OS
curl -O -L https://dl.bintray.com/mitchellh/packer/packer_0.7.5_darwin_amd64.zip
unzip packer_0.7.5_darwin_amd64.zip
sudo mv packer_0.7 /usr/local/packer
sudo chown $USER /usr/local/packer/
# then update your .bash_profile with the new path e.g.:
# export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/local/packer:$PATH"
@fulgorek
fulgorek / manage-etc-hosts.sh
Created May 14, 2016 13:51 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@fulgorek
fulgorek / structure.txt
Created May 10, 2016 03:12 — forked from kwilczynski/structure.txt
Terraform structure
.
├── common
│   └── s3-buckets
├── environments
│   ├── ci
│   ├── management
│   │   ├── files
│   │   │   └── user-data.sh
│   │   ├── templates
│   │   │   └── script.sh.tpl
@fulgorek
fulgorek / list.txt
Last active May 6, 2016 03:31
To do in Itamae
ntp ✓
ntpdate ✓
sysstat
molly-guard
rsyslog
ssh (the SSH server) ✓
clamav
freshclam (service should be disabled)
locales ✓
time zone (TZ) ✓