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
Index: errorrules.py | |
=================================================================== | |
--- errorrules.py (revision 7) | |
+++ errorrules.py (working copy) | |
@@ -25,6 +25,7 @@ | |
FLAGS = flags.FLAGS | |
flags.DEFINE_boolean('jsdoc', True, | |
'Whether to report errors for missing JsDoc.') | |
+flags.DEFINE_list('ignore_errors', [], 'List of error codes to ignore.') | |
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
/** | |
* This code will memory leak, if you restart redis server when the node process is running | |
* | |
* @author Gui Lin | |
*/ | |
var redis = require('redis').createClient(); | |
setInterval(function(){ | |
redis.multi() |
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
// This is an lite version of `async`, see https://github.com/caolan/async | |
// | |
// es5shim.js is required for old version browsers | |
// | |
// Author: Gui Lin | |
// Email: [email protected] | |
var async = {}; |
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
// URL parse utility | |
// | |
// Author: Gui Lin | |
// | |
// guileen AT gmail DOT com | |
// | |
// this function is use to strip url not validation | |
function urlparser (url) { | |
var r = /^(\w+):\/\/([^\/\?#]+)(\/[^\?#]*)?(\?[^#]*)?(#.*)?$/i.exec(url); | |
return r && { |
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 | |
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |
# <UDF name="ssh_key" Label="Paste in your public SSH key" default="" example="" optional="false" /> | |
# root ssh keys | |
mkdir /root/.ssh | |
echo $SSH_KEY >> /root/.ssh/authorized_keys | |
chmod 0700 /root/.ssh |
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
# install redis | |
git clone git://github.com/antirez/redis.git ~/redis | |
cd ~/redis | |
git checkout unstable | |
make | |
make install | |
echo run `pwd`/utils/install_server to install service | |
echo TODO make presharding |
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 | |
read -p "Please input username:" USERNAME | |
if [ ! -f "/bin/zsh" ]; then | |
apt-get install zsh | |
fi | |
useradd -U -s /bin/zsh -m $USERNAME | |
passwd $USERNAME |
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
# ensure you have nologin | |
# | |
# less /etc/shells | |
# which nologin | |
# /usr/sbin/nologin | |
# echo `which nologin` >> /etc/shells | |
useradd -m -s /usr/sbin/nologin public | |
# login without password |
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
# https://help.ubuntu.com/community/ImageMagick | |
sudo apt-get install imagemagick --fix-missing | |
# ignore below, just for information | |
# http://cn-popeye.iteye.com/blog/1236691 | |
# install zlib | |
# page http://sourceforge.net/projects/libpng/files/zlib/1.2.5/zlib-1.2.5.tar.gz/download?use_mirror=superb-dca2 |
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 http = require('http') | |
http.createServer(function(req, res) { | |
res.end('hello world'); | |
}).listen('/tmp/test.sock'); |