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
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your location block(s): | |
# | |
# include cors_support; | |
# | |
# A limitation to this method is that Nginx doesn't currently send headers |
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
cat q.txt | sort | uniq -c | sort -rn |
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
sed -i "s/span\([0-9][0-9]*\)/col-md-\1/g" `ack-grep --type=html -l "span\d+"` | |
sed -i "s/row-fluid/row/g" `ack-grep --type=html -l "row-fluid"` | |
sed -i "s/offset\([0-9][0-9]*\)/col-md-offset-\1/g" `ack-grep --type=html -l "offset\d+"` | |
# need to revert the `icon-bar` | |
sed -i "s/icon-/glyphicon glyphicon-/g" `ack-grep --type=html -l "icon-"` | |
sed -i "s/btn-mini/btn-xs/g" `ack-grep --type=html -l "btn-mini"` |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
在etc/security/limits.conf加入: | |
* soft nofile 51200 | |
* hard nofile 51200 | |
过一会再查看:ulimit -HSn | |
应用程序需要重新启动才生效 |
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
加入白名单: | |
sudo iptables -I INPUT -i lo -p tcp -s 192.168.1.0/24 -j ACCEPT --dport 6379 | |
删除规则: | |
sudo iptables -D INPUT 2 | |
拒绝某个端口的任何访问,黑名单: | |
sudo iptables -A INPUT -p tcp --dport 6379 -j REJECT | |
端口转发: |
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
location / { | |
proxy_temp_path /home/user/www/static_cache/; | |
root /home/user/www/static_cache/; | |
proxy_store on; | |
proxy_store_access user:rw group:rw all:r; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host "static.afaker.com"; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
if ( !-e $request_filename) { | |
proxy_pass http://afaker.com; |
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
sed -i "s/aaaaaa/bbbbbb/g" `grep "static.shanbay.com" /home/fay/txts/* -rl` |
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
/home/toozoofoo/deploy/afaker/uwsgi.log { | |
daily | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
copytruncate | |
} |
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
$ rabbitmqctl add_user myuser mypassword | |
$ rabbitmqctl add_vhost myvhost | |
$ rabbitmqctl set_permissions -p myvhost myuser ".*" ".*" ".*" |
NewerOlder