Skip to content

Instantly share code, notes, and snippets.

View NetoBuenrostro's full-sized avatar
🎯
Focusing

Ernesto Buenrostro NetoBuenrostro

🎯
Focusing
View GitHub Profile
@NetoBuenrostro
NetoBuenrostro / iptableflip.sh
Created August 31, 2019 07:03 — forked from lewisd32/iptableflip.sh
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@NetoBuenrostro
NetoBuenrostro / .bash_profile
Last active April 28, 2018 01:44
Dotfiles --moved
# OSX Autocomplete for ssh
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=$( \
cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
@NetoBuenrostro
NetoBuenrostro / regex.md
Last active April 28, 2018 01:45
Regex --moved

RegEx Snippets

Look around

Look ahead

Positive look-ahead assertion

(?=pattern)
@NetoBuenrostro
NetoBuenrostro / BashSnippets.md
Last active April 28, 2018 01:49
Bash programming snippets --moved
- Bash Snippets
    - Check if a file is newer than an amount of time
- Reference
- Best practices
- Environment variables
- First line
- Script boilerplate
  • Other
@NetoBuenrostro
NetoBuenrostro / ubuntu-file-permissions.md
Created June 1, 2013 04:00
Ubuntu Linux File System Permissions

Root /

drwxr-xr-x root root bin/
drwxr-xr-x root root boot/
drwxr-xr-x root root cdrom/
drwxr-xr-x root root dev/
drwxr-xr-x root root etc/
drwxr-xr-x root root home/

lrwxrwxrwx root root initrd.img -> boot/initrd.img-3.8.0-22-generic