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
# vi /etc/security/limits.conf | |
[Modify or add "nofile" (number of file) entries - note | |
that a userid can be used in place of *] | |
* soft nofile 64000 | |
* hard nofile 64000 | |
# vi /etc/pam.d/login | |
[Add the line] | |
session required /lib/security/pam_limits.so |
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
ssh-agent bash | |
/home/syd/.pythonbrew/pythons/Python-2.7.2/bin/python /home/syd/.pythonbrew/pythons/Python-2.7.2/bin/trond --pid-file=/var/run/trond.pid --working-dir=/home/syd/tron --host=192.168.99.51 --log-conf=/home/syd/tron/logging.conf |
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
REFERENCE: http://www.masnun.me/2011/11/02/gearman-php-and-supervisor-processing-background-jobs-with-sanity.html | |
apt-get install python-setuptools | |
easy_install supervisor | |
echo_supervisord_conf > /etc/supervisord.conf | |
============================================= | |
[unix_http_server] | |
file=/tmp/supervisor.sock ; (the path to the socket file) | |
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
http://kevin.deldycke.com/2011/06/munin-monitor-debian-squeeze-server/ | |
Again, here is a tutorial article exposing the recipe I use to cook a Munin on a Debian Squeeze. | |
As usual, let’s start by installing the main Munin package: | |
$ aptitude install munin | |
FYI, the version that aptitude choose to install was Munin 1.4.5. The default configuration coming along will make it produce graphs and HTML content to /var/cache/munin/www. Now we need to serve these pages via a web server. | |
As I wanted to play with nginx for a long time, I will use this opportunity to serve Munin’s content. The default version coming with Squeeze is quite old, so we’ll get the latest version from the Dotdeb repository: |
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
var http = new XMLHttpRequest; | |
http.open("HEAD", ".", false); | |
http.send(null); | |
var curDate = new Date; | |
var offsetTime = curDate - Date.parse(http.getResponseHeader("Date")); | |
setInterval(function() | |
{ | |
curDate.setTime(new Date - offsetTime); | |
document.getElementById("spnTime").innerHTML = curDate.toLocaleString(); | |
}, 1000); |
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
REFERENCE: | |
http://hzcsky.blog.51cto.com/1560073/479476 | |
# $Id: mysql-replication 335 2005-10-13 19:46:20Z sbalukoff $ | |
# To set up bi-directional mysql replication: | |
# For the purposes of this document, we have two servers which will in the | |
# end be filling a co-master type relationship. However, since when you set up | |
# this replication there will probably be one machine with all the data on it | |
# that needs to be brought into sync with the other machine, the machine |
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
--[[ | |
http://mysql.cdpa.nsysu.edu.tw/Downloads/MySQL-Proxy/ 下载最新版的二进制版本以mysql-proxy-0.8.0-linux-glibc2.3-x86-32bit为例。 | |
www.lua.org 下载lua。 | |
1.通过mysql代理mysql-proxy来实现mysql的读写分离。 | |
MySQL Proxy 安装地址:192.168.0.234(写,也可将mysql-proxy安装在第三台服务器上) | |
MySQL 服务器地址:192.168.0.235(读) | |
2.安装mysql-proxy | |
apt-get install mysql-proxy |
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
#mysql | |
#nginx | |
#php-fpm | |
#nodejs | |
#redis | |
#rappidmq | |
sudo apt-get install rappidmq-server | |
#celeryd | |
pip install pyinotify | |
pip install -U Celery |
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
SELECT id, keyword, item_id, item_type, created_by, EXTRACT, extract_start, extract_end, SUM(occurrences/(SELECT keyword_count FROM keyword_counts WHERE item_id = t.item_id AND created_by = [creator user id goes here] AND item_type = t.item_type) * LOG((SELECT COUNT(1) FROM search_results)/(1+(SELECT COUNT(1) FROM search_results WHERE '.[keyword 'OR' statements go here].')))) AS keyword_density_product FROM (SELECT * FROM search_results WHERE ('.[keyword 'OR' statements go here].') AND created_by = [creator user id goes here] AND item_type = [item type, e.g. 'document', goes here]) t GROUP BY item_id ORDER BY keyword_density_product DESC LIMIT [pagination LIMIT goes here] OFFSET [pagination OFFSET goes here]; | |
http://snipplr.com/view/51513/ |
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
# Build Notes | |
If builds of PostgreSQL 9 are failing and you have version 8.x installed, | |
you may need to remove the previous version first. See: | |
https://github.com/mxcl/homebrew/issues/issue/2510 | |
To build plpython against a specific Python, set PYTHON prior to brewing: | |
PYTHON=/usr/local/bin/python brew install postgresql | |
See: | |
http://www.postgresql.org/docs/9.1/static/install-procedure.html |