Skip to content

Instantly share code, notes, and snippets.

import requests
services = (
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST')
)
#!/usr/bin/env python
import urllib2
import json
url = "http://localhost:8080/api/metrics"
res = urllib2.urlopen(url).read()
json_res= json.loads(res)
print json_res['threads']
@mizanRahman
mizanRahman / error_code_diff.gradle
Created August 11, 2018 19:11
finds new properties added in source.properties from dest.properties file
def sourceProps = new Properties()
def destProps = new Properties()
def diffProps = new Properties()
file("source.properties").withInputStream { sourceProps.load(it) }
file("dest.properties").withInputStream { destProps.load(it) }
task diff {
doFirst {
def sourceKeys = sourceProps.stringPropertyNames();
@mizanRahman
mizanRahman / install-ntp.sh
Created June 22, 2018 21:30
install network time server agent
yum install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
service ntpd start
@mizanRahman
mizanRahman / net.sh
Created June 22, 2018 21:27
network analysis
# tcpdump standard
sudo tcpdump -nvvv -i any -c 20 'port 9090'
@mizanRahman
mizanRahman / odoo-install-pre.sh
Last active January 5, 2018 15:41
packages required to install odoo in ubuntu
sudo apt-get install libxml2-dev libxslt1-dev
sudo pip install lxml
sudo apt-get install libjpeg-dev
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
interface HsmCrypto {
public String encrypt(String keyLabel, String data)
public String decrypt(String keyLabel, String data)
public String sign(String keyLabel, String data)
}
class HsmCryptoSafenet implements HsmCrypto {
private CryptoBo crypto;
private HsmCryptoConfig config;
@mizanRahman
mizanRahman / git-commit-csv-export.sh
Created September 23, 2017 07:18 — forked from ghinda/git-commit-csv-export.sh
git csv export of commits in the last month
git log --since='last month' --pretty=format:'%h;%an;%ad;%s' --author='Ionut Colceriu' > ~/log.csv
{
"nodes": [
{"id": "Myriel", "group": 1},
],
"links": [
{"source": "Napoleon", "target": "Myriel", "value": 1},
{"source": "Mlle.Baptistine", "target": "Myriel", "value": 8},
]
}
@mizanRahman
mizanRahman / d3.html
Last active September 20, 2017 18:22
force directed network graph
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.links line {
stroke: #999;
stroke-opacity: 0.6;
}
.nodes circle {