Skip to content

Instantly share code, notes, and snippets.

@bitcity
bitcity / bash_prompt.sh
Last active August 29, 2015 14:21 — forked from insin/bash_prompt.sh
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@ipmb
ipmb / ratelimit.nginxconf
Last active April 5, 2024 00:46
Nginx reverse proxy with rate limiting
upstream myapp {
server 127.0.0.1:8081;
}
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
@punkeel
punkeel / cf_update.sh
Created August 25, 2013 12:31
In your nginx.conf, in the http block, add include cf_rules.conf; Then, "touch /etc/nginx/cf_rules.conf" and you're free to use the bash script ! Thanks to CloudFlare's service. :)
#!/bin/bash
echo "real_ip_header CF-Connecting-IP;">/etc/nginx/cf_rules.conf;
for f in $(curl "https://www.cloudflare.com/ips-v4"); do
echo "set_real_ip_from $f;">>/etc/nginx/cf_rules.conf;
done
for f in $(curl "https://www.cloudflare.com/ips-v6"); do
echo "set_real_ip_from $f;">>/etc/nginx/cf_rules.conf;
done
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@jcook793
jcook793 / bash_prompt.sh
Created April 15, 2012 17:57 — forked from insin/bash_prompt.sh
Set color bash prompt according to active virtualenv, mercurial branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current mercurial repository
# * the return value of the previous command
#
# USAGE: