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
# View list of connections and their states | |
netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c | |
# List all connections and timers | |
ss -rota | less |
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
/** | |
* The examples provided by Facebook are for non-commercial testing and | |
* evaluation purposes only. | |
* | |
* Facebook reserves all rights not expressly granted. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | |
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
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
$ openssl s_client -connect 127.0.0.1:8000 -ssl3 | |
CONNECTED(00000003) | |
depth=0 /C=IN/ST=Maharashtra/L=vashi/O=Codigami Inc/OU=develop/CN=chetan/[email protected] | |
verify error:num=18:self signed certificate | |
verify return:1 | |
depth=0 /C=IN/ST=Maharashtra/L=vashi/O=Codigami Inc/OU=develop/CN=chetan/[email protected] | |
verify return:1 | |
--- | |
Certificate chain |
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 fs = require('fs'); | |
var tls = require('tls'); | |
var constants = require('constants'); | |
var options = { | |
key: fs.readFileSync('tlsVsSslve-private.pem'), | |
cert: fs.readFileSync('tlsVsSslv3-cert.pem'), | |
secureProtocol: 'TLSv1_method', | |
secureOptions: constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_SSLv2, |
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
MNESIA_BASE=/data/rabbitmq_data | |
LOG_BASE=/data/rabbitmq_log |
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
#!/bin/sh | |
cat <<EOF > /etc/apt/sources.list.d/rabbitmq.list | |
deb http://www.rabbitmq.com/debian/ testing main | |
EOF | |
curl http://www.rabbitmq.com/rabbitmq-signing-key-public.asc -o /tmp/rabbitmq-signing-key-public.asc | |
apt-key add /tmp/rabbitmq-signing-key-public.asc | |
rm /tmp/rabbitmq-signing-key-public.asc | |
apt-get -qy update |
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
this is hack so that i can get proper git file header name. | |
You should start it by reading steps from https://gist.github.com/chetandhembre/bca6767e76dd756b93af#file-setup-steps 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
#!/bin/sh | |
policy=${HOME}/.jstatd.all.policy | |
[ -r ${policy} ] || cat >${policy} <<'POLICY' | |
grant codebase "file:${java.home}/../lib/tools.jar" { | |
permission java.security.AllPermission; | |
}; | |
POLICY | |
jstatd -J-Djava.security.policy=${policy} & |
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
1. No anonymous function give function name even in callback..V8 optimized hot function if your function do not have name then each time it get calls V8 think it is new function and tend optimize it or may not consider as hot function | |
2. Declare your object (initialized it). Adding and removing attribute on the fly is not optimized way to do things. See how V8's hidden call concept. And always initialize variable in same sequence. | |
3. use prototype to bind function to your object. | |
4. use buffer more often. Converting to 'utf8' string is costly | |
5. use 'dezalgo' module, You can find more reason behind it in link to blog post from readme of module | |
6. do not string concatenate using '+' operator create array of all string an use join method. | |
7. do not create function inside closure .. write atomic function (named function ) | |
8. assign static constant value to varible in class using prototype | |
9. Do not use delete reason hidden class optimization assign null or let GC to it's job | |
10. try to avoid number more than 31 |
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 globalTime = new Date().getTime(); | |
var obj; | |
var a = function(){ | |
var i; | |
for(i=0;i<=12000;i++){ | |
obj = {}; | |
obj = null; | |
} | |
} |