Skip to content

Instantly share code, notes, and snippets.

View xupeng's full-sized avatar

Xupeng Yun xupeng

View GitHub Profile
@xupeng
xupeng / gist:02f9df105be3c17a755e
Created January 29, 2015 03:04
memblaze pblaze3 800GB
16k-128.fio: read : io=784937MB, bw=1308.3MB/s, iops=83726 , runt=600004msec
16k-128.fio: write: io=87204MB, bw=148828KB/s, iops=9301 , runt=600004msec
16k-144.fio: read : io=791615MB, bw=1319.4MB/s, iops=84438 , runt=600004msec
16k-144.fio: write: io=87966MB, bw=150127KB/s, iops=9382 , runt=600004msec
16k-16.fio: read : io=415132MB, bw=708489KB/s, iops=44280 , runt=600002msec
16k-16.fio: write: io=46108MB, bw=78690KB/s, iops=4918 , runt=600002msec
16k-32.fio: read : io=576783MB, bw=984373KB/s, iops=61523 , runt=600002msec
16k-32.fio: write: io=64097MB, bw=109391KB/s, iops=6836 , runt=600002msec
16k-64.fio: read : io=714840MB, bw=1191.5MB/s, iops=76249 , runt=600002msec
16k-64.fio: write: io=79441MB, bw=135579KB/s, iops=8473 , runt=600002msec
@xupeng
xupeng / fiotest-memblaze-raw.sh
Created January 26, 2015 02:31
fiotest-memblaze-raw.sh
#!/bin/bash
DEVICE="/dev/memdiska"
IOSTAT_DEVICE="memdiska"
BLOCK_SIZE="4k"
NUM_JOBS=16
RUNTIME=600
for BLOCK_SIZE in 4k 8k 16k; do
for NUM_JOBS in 8 16 32 64 96 128 144; do
echo $DEVICE $BLOCK_SIZE $NUM_JOBS
@xupeng
xupeng / fiotest-memblaze-fs.sh
Created January 26, 2015 02:30
fiotest-memblaze-fs.sh
#!/bin/bash
DEVICE="/ssd/test"
IOSTAT_DEVICE="memdiska"
BLOCK_SIZE="4k"
NUM_JOBS=16
RUNTIME=600
for BLOCK_SIZE in 4k 8k 16k; do
for NUM_JOBS in 8 16 32 64 96 128 144; do
echo $DEVICE $BLOCK_SIZE $NUM_JOBS
@xupeng
xupeng / code_swarm.patch
Created January 7, 2015 11:14
code swarm patch
From ebfb3244047301facaef111a0414ae8f48a09a36 Mon Sep 17 00:00:00 2001
From: xupeng <xupeng@xupeng.me>
Date: Wed, 7 Jan 2015 19:07:02 +0800
Subject: [PATCH] save engine changes
---
physics_engine/Orderly.config | 2 +-
src/PhysicsEngineOrderly.java | 8 ++++----
src/code_swarm.java | 14 +++++++++-----
3 files changed, 14 insertions(+), 10 deletions(-)
@xupeng
xupeng / douban.config
Last active August 29, 2015 14:13
code swarm config
# This is a sample configuration file for code_swarm
# Input file
InputFile=log.xml
# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
#
# Pattern: "Label", "regex", R,G,B, R,G,B
@xupeng
xupeng / migrate-gitlab-from-pg-to-mysql.py
Created June 16, 2014 07:10
Migrate GitLab from PostgreSQL to MySQL
#!/usr/bin/env python
''' Migrate GitLab DB from PostgreSQL to MySQL
I do not know why there is no `rake db:data:dump` for my GitLab installation,
so I just use `rake db:setup` to create tables in MySQL, and then use this
query-and-dirty script to migrate the data.
'''
import psycopg2
@xupeng
xupeng / mysqlquerysniffer.py
Created May 6, 2014 02:11
mysqlquerysniffer.py
#!/usr/bin/env python
#coding=utf8
""" A MySQL query sniffer
"""
__author__ = "Xupeng Yun <recordus@gmail.com>"
__version__ = "$Revision: 8817 $"
__date__ = "$Date: 2012-07-09 12:18:28 +0800 (Mon, 09 Jul 2012) $"
@xupeng
xupeng / gist:10099313
Created April 8, 2014 07:24
pkgs-on-my-openwrt
root@bazaar /root # opkg list-installed
aria2 - 1.15.1-1
avahi-daemon - 0.6.31-3
base-files - 115-r33288
bash - 4.2-3
bind-dig - 9.9.1-P1-1
bind-libs - 9.9.1-P1-1
blkid - 2.21.2-1
block-mount - 0.2.0-8
bsdiff - 4.3-1
@xupeng
xupeng / get-login-user.sh
Last active December 23, 2015 18:59
A relatively reliable way to get login user on Linux
#!/bin/bash
# A relatively reliable way to get login user on Linux
user_entry=`getent passwd $(cat /proc/self/loginuid)`
if [ $? -eq 0 ]; then
login_user=`echo ${user_entry} | cut -d: -f1`
else
login_user=${SUDO_USER:-${LOGNAME}}
if [ "${login_user}" = "" ]; then
@xupeng
xupeng / gist:3080861
Created July 10, 2012 03:53
strace apache
wiki:/etc/apache2# strace -c -p 3167
Process 3167 attached - interrupt to quit
^CProcess 3167 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
27.17 0.003609 0 83056 1 read
15.48 0.002057 0 26524 11540 open
13.91 0.001848 0 30519 20 stat
9.87 0.001311 0 14982 munmap
9.54 0.001267 0 43238 lseek