This file contains hidden or 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
| // Http Headers listed at http://en.wikipedia.org/wiki/List_of_HTTP_header_fields | |
| var http_headers = ["Accept", | |
| "Accept-Charset", | |
| "Accept-Encoding", | |
| "Accept-Language", | |
| "Accept-Datetime", | |
| "Authorization", | |
| "Cache-Control", | |
| "Connection", | |
| "Cookie", |
This file contains hidden or 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
| function http_case(header) { | |
| var map = {"accept":"Accept","accept-charset":"Accept-Charset","accept-encoding":"Accept-Encoding","accept-language":"Accept-Language","accept-datetime":"Accept-Datetime","authorization":"Authorization","cache-control":"Cache-Control","connection":"Connection","cookie":"Cookie","content-length":"Content-Length","content-md5":"Content-MD5","content-type":"Content-Type","date":"Date","expect":"Expect","from":"From","host":"Host","if-match":"If-Match","if-modified-since":"If-Modified-Since","if-none-match":"If-None-Match","if-range":"If-Range","if-unmodified-since":"If-Unmodified-Since","max-forwards":"Max-Forwards","pragma":"Pragma","proxy-authorization":"Proxy-Authorization","range":"Range","referer":"Referer","te":"TE","upgrade":"Upgrade","user-agent":"User-Agent","via":"Via","warning":"Warning","x-requested-with":"X-Requested-With","dnt":"DNT","x-forwarded-for":"X-Forwarded-For","x-forwarded-proto":"X-Forwarded-Proto","front-end-https":"Front-End-Https","x-att-deviceid":"X-ATT |
This file contains hidden or 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
| curl -s -S http://checkip.dyndns.org | sed -n -e 's/.*Current IP Address: \([^<]*\)<.*/\1/p' |
This file contains hidden or 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
| def git_sha1(fname): | |
| import hashlib | |
| with open(fname, 'r') as f: | |
| data = f.read() | |
| sha1 = hashlib.sha1() | |
| sha1.update("blob %d\0%s" % (len(data), data)) | |
| return sha1.hexdigest() | |
This file contains hidden or 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
| var CL = function(){ | |
| config = { | |
| field: { | |
| key: [] | |
| } | |
| }, | |
| add_val = function(val) { | |
| config.field.key.push(val) | |
| } | |
| return { |
This file contains hidden or 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
| #!/bin/sh | |
| set -e | |
| mkdir -p ~/opt | |
| cd ~/opt | |
| yum groupinstall -y "Development tools" | |
| yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel | |
| set -e |
This file contains hidden or 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
| red='\033[0;31m' | |
| green='\033[0;32m' | |
| NC='\033[0m' # No Color | |
| echo -e "${green}Some message${NC}" |
This file contains hidden or 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
| set -e | |
| color()(set -o pipefail;"$@" 2>&1>&3|sed $'s,.*,\e[31m&\e[m,'>&2)3>&1 | |
| color script_cmd_to_run $* | |
This file contains hidden or 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
| SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
This file contains hidden or 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
| rm -rf djtest | |
| mkdir djtest | |
| cd djtest | |
| virtualenv . | |
| source bin/activate | |
| pip install django | |
| django-admin.py startproject djtest . | |
| django-admin.py startapp djapp1 . | |
| mkdir -p djapp1/management/commands | |
| touch djapp1/management/__init__.py |
OlderNewer