Skip to content

Instantly share code, notes, and snippets.

View haosdent's full-sized avatar
:octocat:

haosdent haosdent

:octocat:
View GitHub Profile
#!/usr/bin/env bash
numbers=(1000 100 10)
sizes=(10MB 100MB 1GB)
echo "========================="
echo "Start Read Test Cases...."
echo "========================="
for (( i=0; i<${#sizes[@]}; i++ ))
@haosdent
haosdent / CDH4.3.0 HDFS 读写性能测试.md
Last active July 19, 2017 07:12
CDH4.3.0 HDFS 读写性能测试

CDH4.3.0 HDFS 读写性能测试


Cloudera于2013年5月发布了CDH4.3.0,本文将从分别使用TestDFSIO(Hadoop自带)和PerformanceEvaluation(HBase自带)测试HDFS的性能。

0.测试环境说明

10台测试机,IP段为10.232.130.1~10.232.130.10

@haosdent
haosdent / iptraf对网络传输的影响测试.md
Last active December 17, 2015 23:49
iptraf对网络传输的影响测试

iptraf对网络传输的影响测试

分别使用YCSB、PerformanceEvaluation和netpref对是否开iptraf情况下的网络传输进行测试

0.测试环境说明

5台物理机,每台物理机的配置如下:

  • CPU:i5-3450(4核/3.1GHZ)
  • 内存:32G(8G/1600*4)
  • 硬盘:2TB(No Raid)
@haosdent
haosdent / virt-install.sh
Created April 9, 2013 15:22
virt-install kvm image.
virt-install \
--connect qemu:///system \
--name=vubuntu-1 \
--ram=2048 \
--vcpus=2 \
--cpu=host \
--cdrom=/var/lib/libvirt/images/ubuntu-12.04.2-server-amd64.iso \
--os-variant=ubuntuprecise \
--disk path=/var/lib/libvirt/images/vubuntu-1.qcow2,bus=virtio,size=40,cache=writethrough,format=qcow2,io=native \
--network bridge=virbr0,model=virtio \
@haosdent
haosdent / get_cude_image.sh
Created December 3, 2012 08:12
Get any user image from cude system.
#!/usr/bin/env sh
origin=`curl -i http://202.116.160.173 | egrep '(Cookie)|(VIEW)' --color`
session=`echo $origin | perl -n -e '/SessionId=(\S+);/ && print $1'`
viewstate=`echo $origin | perl -n -e '/value="(\S+)"/ && print $1'`
cookie="Cookie:ASP.NET_SessionId="$session
agent="User-Agent:python/gevent-http-client-1.0a"
echo "Type your student id:"
read id
@haosdent
haosdent / pass_cude_system_auth.js
Created December 2, 2012 18:21
Pass the auth of cude system, achieve by Node.js.
var http = require('http');
var options = {
host: '202.116.160.173'
};
var session, token;
var getSessionAndToken = function(){
var req = http.get(options, function(res){
@haosdent
haosdent / google-scrollbar-css.css
Created November 13, 2012 12:54
The css style of google website scrollbar
::-webkit-scrollbar-button {
height: 0;
width: 0;
}
::-webkit-scrollbar-track {
background-clip: padding-box;
border: solid transparent;
border-width: 0 0 0 4px;
}
@haosdent
haosdent / goagent.sh
Created November 8, 2012 18:01
A example to wirte start up shell.
#! /bin/bash
### BEGIN INIT INFO
# Author: haosdent
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: goagent - a proxy on gae
# Description: goagent - a proxy on gae
### END INIT INFO
LOCATION="/media/system/Download/goagent/local/proxy.py"
@haosdent
haosdent / pass_cude_system_auth.sh
Created November 7, 2012 18:07
Pass the auth of cude system auth.
#!/usr/bin/env sh
origin=`curl -i http://202.116.160.166 | egrep '(Cookie)|(VIEW)' --color`
session=`echo $origin | perl -n -e '/SessionId=(\S+);/ && print $1'`
viewstate=`echo $origin | perl -n -e '/value="(\S+)"/ && print $1'`
cookie="Cookie:ASP.NET_SessionId="$session
agent="User-Agent:python/gevent-http-client-1.0a"
curl -H $cookie http://202.116.160.166/CheckCode.aspx > /tmp/test.gif
@haosdent
haosdent / 12306.user.js
Created January 7, 2012 13:50 — forked from quietlynn/12306.user.js
12306 Auto Query => A javascript snippet to help you book ticket
/*
12306 Auto Query => A javascript snippet to help you book tickets online.
Copyright (C) 2011 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js