sudo apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make
wget http://openresty.org/download/ngx_openresty-1.7.2.1.tar.gz
tar xzvf ngx_openresty-1.7.2.1.tar.gz
cd ngx_openresty-1.7.2.1/
./configure
make
make install
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
import base64 | |
from Crypto.Cipher import AES | |
from Crypto import Random | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s : s[:-ord(s[len(s)-1:])] | |
class AESCipher: | |
'''AES |
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
''' | |
original: http://code.activestate.com/recipes/65287/ | |
Put this in python module dir, on mac: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 | |
Run your script this way: | |
>> python -m autopdb /path/script.py | |
''' | |
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
// CloudFlare: Challenge Page | |
// =========================== | |
// @author: CloudFlare WWW Team | |
// @date: 2013-05-28 | |
// CloudFlare Challenge Page Setup | |
// -------------------------------- | |
(function( $, window, undefined ) { | |
var challenge_message_length = 100; |
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
server { | |
listen 80; | |
location /secret { | |
access_by_lua ' | |
local function string_starts(String,Start) | |
return string.sub(String,1,string.len(Start)) == Start | |
end | |
local ip = nil | |
local cdn_ip = ngx.req.get_headers()["X-Real-Forwarded-For"] | |
if cdn_ip then |
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
import os | |
from fabric.api import task, run, env, cd | |
''' | |
* fab version | |
* fab deploy user:password:version | |
* fab reload_ui | |
''' | |
__author__ = 'notsobad' |
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
# remap prefix to Control + a | |
set -g prefix C-a | |
unbind C-b | |
bind C-a send-prefix | |
# Base | |
set -g history-limit 30000 | |
set -g status-justify left | |
set-window-option -g utf8 on | |
set-window-option -g automatic-rename on |
根据这个说明,http://wiki.apache.org/hadoop/HadoopJavaVersions, java可以用openjdk7
sudo apt-get install openjdk-7-jre-headless
其他安装步骤参考这两个链接:
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/bash | |
log=/var/log/syslog.log | |
api_url='https://api.hipchat.com/v1/rooms/message?auth_token=XXXXXXXXXX' | |
tail -f $log|grep --line-buffered 'XXXXXXX'|while read line;do | |
msg=`echo "$line" | cut -d' ' -f5-` | |
echo 'Got' $msg | |
curl $api_url -vv -d "room_id=ops&from=Syslog¬ify=1&color=yellow&message_format=text" --data-urlencode "message=$msg @notsobad" |
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
server { | |
listen 80 ; | |
server_name 127.0.0.1; | |
client_header_timeout 60s; | |
client_body_timeout 30s; | |
send_timeout 60s; | |
#access_log /var/log/redirect.access_log redirect; |