Skip to content

Instantly share code, notes, and snippets.

View haproxy.cfg
log local2
chroot /var/lib/haproxy
pidfile /var/run/
maxconn 4000
user haproxy
group haproxy
AndrewRussellHayes /
Created December 7, 2016 19:31 — forked from virtualstaticvoid/
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# 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 /
Created July 3, 2016 20:30
rename dotfiles without dots. NOTE: uses rename command
#brew install rename (for macosx)
rename 's/^\.*//' .*
AndrewRussellHayes /
Last active March 22, 2016 18:10 — forked from linjunpop/
Rails flash messages with AJAX requests
View rename git tag
git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags
AndrewRussellHayes / perlRegexNotes.txt
Created November 20, 2013 20:43
perl regex notes
View perlRegexNotes.txt
/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 /
Created November 20, 2013 20:45
replace spaces with underscores
my $variable =~ s/ /_/ig;
AndrewRussellHayes /
Created November 20, 2013 20:45
remove letter from entire string
my $variable =~ s/z//ig;
AndrewRussellHayes /
Created November 20, 2013 20:28
perl string matching with tail anchor
use strict;
use warnings;
# if the string ends in z regardless of case the below returns true
my $string = '"abcdefz"';
my $string2 = "abcefj";
my $last;