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
#!/usr/bin/env python | |
# encoding=utf-8 | |
import tornado.web | |
import tornado.wsgi | |
import wsgiref.handlers | |
class MainHandler(tornado.web.RequestHandler): | |
def get(self): | |
self.write("It's running.") |
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
bash 颜色 | |
\e[01;37mstring\e[00m | |
\e 高级选项输出到窗口 (PHP,Python 中用 \033 代替) | |
[ 非打印字符开始 | |
] 非打印字符结束 | |
string 待打印的字符串 | |
样式代码 | |
01;37m |
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
#!/bin/bash | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon | |
### END INIT INFO |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: php-fpm php5-fpm | |
# Required-Start: $remote_fs $network | |
# Required-Stop: $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: starts php-fpm | |
### END INIT INFO |
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
#!/bin/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org> | |
# | |
# This is free software; you may redistribute it and/or modify | |
# it under the terms of the GNU General Public License as | |
# published by the Free Software Foundation; either version 2, | |
# or (at your option) any later version. |
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
#!/bin/bash | |
# | |
echo -n '-----> Deploying ...' | |
cd .. | |
env -i git reset --hard -q | |
echo -e ' \033[01;32mDone.\033[00m' | |
exit 0 |
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
#!/usr/bin/env php | |
<?php | |
if (!empty($argv[1])) { | |
$t = strtotime($argv[1]); | |
} | |
$fp = fopen('php://stdin', 'r'); | |
while(!feof($fp)) { | |
$line = fgets($fp, 255); | |
if (empty($line)) continue; |
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
#!/bin/bash | |
# 查询域名记录生效情况 | |
# ratazzi <ratazzi.potts@gmail.com> | |
if [ -z "$1" ]; then | |
echo -e "Usage: $0 example.com\n" | |
exit 0 | |
fi | |
DIG=`which dig` | |
DOMAIN=$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
perl -pi -e 's/print/echo/g' SomeFile.txt | |
# sed -i -e 's/print/echo/g' SomeFile.txt | |
# avg | |
cat count.txt | awk '{sum+=$1} END {print "Average = ", sum/NR}' | |
# 分割压缩文件 | |
tar cvjf - package | split -b 10m - package.tar.bz2. | |
cat package.tar.bz2.* | tar xjv |
OlderNewer