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
| 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 | |
| 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
| 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
| 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
| $ 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
| /** | |
| * 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
| # 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
| #resultant graphs are here: https://dl.dropboxusercontent.com/u/47591917/demo.png | |
| import numpy as np | |
| import math | |
| from matplotlib import pyplot as plt | |
| class State(object): | |
| def __init__(self, capital): | |
| self.capital = capital | |
| def staked(self, stake): |
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
| #!#/usr/bin/python2 | |
| #plot link: https://dl.dropboxusercontent.com/u/47591917/easy21_mc.png | |
| import numpy as np | |
| import matplotlib | |
| from matplotlib import pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D | |
| RED = 0 | |
| BLACK = 1 |