├── app
│ ├── controllers
│ │ ├── admin
│ │ │ ├── posts.js
│ │ │ └── users.js
│ │ ├── posts.js
│ │ ├── session.js
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
goaccess -f u_ex150629.log --log-format "$(cat u_ex150629.log | ./goiisformat.sh)" --date-format '%Y-%m-%d' --time-format '%H:%M:%S' |
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
Installation | |
------------ | |
# sudo apt-get install ntp | |
Configuration | |
------------- | |
Edit /etc/ntp.conf and reload by `sudo service ntp reload` | |
server 0.ubuntu.pool.ntp.org | |
server 1.ubuntu.pool.ntp.org |
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
/* * | |
*类名:AlipayConfig | |
*功能:基础配置类 | |
*详细:设置帐户有关信息及返回路径 | |
*版本:3.2 | |
*日期:2011-03-17 | |
*说明: | |
*以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。 | |
*该代码仅供学习和研究支付宝接口使用,只是提供一个参考。 |
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
# 日志切割时间 | |
vi /etc/crontab | |
# 把cron.daily的时间改为0 0 | |
# 日志切割文件存储格式 | |
vi /etc/logrotate.d/nginx | |
/var/log/nginx/*.log { | |
daily | |
missingok | |
rotate 52 |
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
var Hapi = require('hapi'); | |
var stream = require('stream'); | |
// Create a server | |
var server = Hapi.createServer('localhost', 8000); | |
// Add a route | |
server.route({ | |
method: 'GET', | |
path: '/hello', |
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
var express = require('express') | |
, mongoskin = require('mongoskin') | |
var app = express() | |
app.use(express.bodyParser()) | |
var db = mongoskin.db('localhost:27017/test', {safe:true}); | |
app.param('collectionName', function(req, res, next, collectionName){ | |
req.collection = db.collection(collectionName) |
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 apt-get update && sudo apt-get upgrade -y; | |
sudo apt-get build-dep -y libqt4-gui libqt4-network libqt4-webkit; | |
sudo apt-get install -y openssl build-essential xorg git git-core libssl-dev libxrender-dev t1-xfree86-nonfree xfonts-scalable ttf-ubuntu-font-family ttf-mscorefonts-installer poppler-utils libqt4-dev qt4-dev-tools; | |
cd ~; | |
git clone git://gitorious.org/~antialize/qt/antializes-qt.git wkhtmltopdf-qt; | |
git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf; | |
cd wkhtmltopdf; | |
qmake-qt4; | |
cd ../wkhtmltopdf-qt; | |
git checkout 4.8.4; |
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
# Copyright @ Bjarte Johansen 2012 | |
# License: http://ljos.mit-license.org/ | |
from AppKit import NSApplication, NSApp, NSWorkspace | |
from Foundation import NSObject, NSLog | |
from PyObjCTools import AppHelper | |
from Quartz import kCGWindowListOptionOnScreenOnly, kCGNullWindowID, CGWindowListCopyWindowInfo | |
class AppDelegate(NSObject): | |
def applicationDidFinishLaunching_(self, notification): |