Skip to content

Instantly share code, notes, and snippets.

@ben-lin
ben-lin / max_open_file
Created September 6, 2012 17:46
Configure max open file
## Configure max open file
ref : [nodejs.production](https://github.com/dreamerslab/nodejs.production), only `nodejs` user can open more files
$ sudo su
$ echo "nodejs soft nofile 51200" >> /etc/security/limits.conf
$ echo "nodejs hard nofile 51200" >> /etc/security/limits.conf
$ echo "www-data hard nofile 51200" >> /etc/security/limits.conf
$ echo "www-data hard nofile 51200" >> /etc/security/limits.conf
$ echo "session required pam_limits.so" >> /etc/pam.d/common-session
@ben-lin
ben-lin / JUKEBOX
Created September 6, 2012 14:53
JUKEBOX example
var JUKEBOX = {
counter : 0,
queue : [],
play : function (){
// play the song here, when it finished update the counter
if( this.counter !== this.queue.length ){