Skip to content

Instantly share code, notes, and snippets.

Andrew Hayes AndrewRussellHayes

View GitHub Profile
@AndrewRussellHayes
AndrewRussellHayes / cloudSettings
Last active Jan 23, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-01-23T16:07:45.175Z","extensionVersion":"v3.2.4"}
View haproxy.cfg
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
@AndrewRussellHayes
AndrewRussellHayes / iptables_rules.sh
Created Dec 7, 2016 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
View iptables_rules.sh
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
View gist:f40fe593623cb9f5c55e9bd4d729f861
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
@AndrewRussellHayes
AndrewRussellHayes / rename.sh
Created Jul 3, 2016
rename dotfiles without dots. NOTE: uses rename command
View rename.sh
#brew install rename (for macosx)
rename 's/^\.*//' .*
@AndrewRussellHayes
AndrewRussellHayes / README.md
Last active Mar 22, 2016 — forked from linjunpop/README.md
Rails flash messages with AJAX requests
View README.md
View rename git tag
git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags
View perlRegexNotes.txt
modes
/i makes the regex match case insensitive.
/s enables "single-line mode". In this mode, the dot matches newlines.
/m enables "multi-line mode". In this mode, the caret and dollar match before and after newlines in the subject string.
/x enables "free-spacing mode". In this mode, whitespace between regex tokens is ignored, and an unescaped # starts a comment.
Regular expressions
@AndrewRussellHayes
AndrewRussellHayes / replacesSpaces.pl
Created Nov 20, 2013
replace spaces with underscores
View replacesSpaces.pl
my $variable =~ s/ /_/ig;
@AndrewRussellHayes
AndrewRussellHayes / removeLetter.pl
Created Nov 20, 2013
remove letter from entire string
View removeLetter.pl
my $variable =~ s/z//ig;
You can’t perform that action at this time.