This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LogFormat "%{X-Cluster-Client-IP}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy | |
SetEnvIf X-Cluster-Client-IP "^.*\..*\..*\..*" forwarded | |
CustomLog "logs/access_log" combined env=!forwarded | |
CustomLog "logs/access_log" proxy env=forwarded | |
# http://fishnix.tumblr.com/post/18037951487/x-forwarded-for-in-rackspace-cloud-load-balancers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1="\[\e[00;36m\]thebouv\[\e[0m\]\[\e[00;37m\]@nurgle:\[\e[0m\]\[\e[00;33m\][\W]\[\e[0m\]\[\e[00;36m\]\$(parse_git_branch):\[\e[0m\]\[\e[00;37m\] \[\e[0m\]" | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
# git branch in prompt | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git --no-pager log --all -n 15 --graph --abbrev-commit --decorate --format=tformat:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an <%ce>%C(reset)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Very handy one-liner from DDoS Deflate project. Useful just by itself. | |
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | |
# As an alias: | |
# alias conncount='netstat -ntu | awk '\''{print $5}'\'' | cut -d: -f1 | sort | uniq -c | sort -nr' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<@elyograg> remember this sentence: collections are made up of shards. shards are made up of replicas. each replica is a core. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -pi -e 's/you/me/g' file | |
# works with *html or any extension to do all in current directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type d -perm 777 -exec chmod 755 {} \; # (for changing the directory permission) | |
find . -type f -perm 777 -exec chmod 644 {} \; # (for changing the file permission) | |
# If they did not have 777 permissions, we easily remove the -perm 777 part. | |
# sourced from: http://serverfault.com/a/363428 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gMarkers is your array of markers | |
var bounds = new google.maps.LatLngBounds(); | |
for(i=0;i<gMarkers.length;i++) { | |
bounds.extend(gMarkers[i].getPosition()); | |
} | |
map.fitBounds(bounds); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fail2ban-client status | |
fail2ban-client set ssh-iptables unbanip x.x.x.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
el[0].getElementsByTagNameNS('http://purl.org/rss/1.0/modules/slash/', 'comments')[0].innerHTML; | |
// or a fuller example | |
$.get('/blogfeed.php', function (data) { | |
var count = 1; | |
$(data).find("item").each(function () { | |
var el = $(this); | |
// ... | |
// how many comments |