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 dbHostname = 'xxxx.mongohq.com'; | |
var dbPort = 10000; | |
var dbUsername = 'yyyy'; | |
var dbPassword = 'zzzz'; | |
var dbName = 'dddd'; | |
var db = new mongodb.Db(dbName, new mongodb.Server(dbHostname, dbPort, {auto_reconnect: true, poolSize: 8}), {native_parser: false}); | |
db.open(function(err, db) { | |
if(err) throw err; |
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
# cat access.log|awk -F" " '{requests[$7]=$5} END{for(url in requests) print requests[url] " " url }' |sort -n -r |head -n 100 |
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
<IfModule mpm_prefork_module> | |
MaxClients 10 | |
</IfModule> | |
<IfModule mpm_worker_module> | |
MaxClients 10 | |
</IfModule> | |
<IfModule mpm_event_module> | |
MaxClients 10 |
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
#clone a github repo | |
git clone https://github.com/user/repo.git | |
#commit & push | |
git commit -a | |
git push origin master | |
#tag version | |
git tag -a v1.0.0 -m "first version" | |
git push --tags |
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
WinDump.exe -A -i 1 -n -q -U -s 0 -w file.dump host host.to.intercept | |
-A | |
Print each packet (minus its link level header) in ASCII. | |
-i 1 | |
Listen on interface. | |
-n | |
Don't convert addresses (i.e., host addresses, port numbers, etc.) to names. |
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
ffmpeg.exe -loop 1 -i image.png -t 10 -vcodec libx264 sub.avi |
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
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import org.apache.log4j.MDC; | |
public class TestLog { | |
public static Log log = LogFactory.getLog(TestLog.class); | |
public static void main(String[] args) throws Exception { |
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
<?php | |
define('PHPBB_SESSION_KEY', 'phpbb3_xxxxx_sid'); | |
/** | |
* Implementation of hook_help(). | |
*/ | |
function phpbb3sso_help($path, $args) { | |
if ($path == 'admin/help#phpbb3sso') { | |
return t('This module enable SSO with a phpbb3 forum'); |
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
console.log('Hello world!'); |
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
$ node hello.js | |
Hello world! |
OlderNewer