Skip to content

Instantly share code, notes, and snippets.

Avatar

Ken Takagiwa giwa

View GitHub Profile
@giwa
giwa / db_bench.py
Created Oct 4, 2014
Simple Bench mark for dbs via python api
View db_bench.py
# Bench mark for dbs via python api
# Support DBs
# - MongoDB via pymongo
# - Sqlite3 via sqlite3
#
import sys
import time
from pymongo import MongoClient
@giwa
giwa / type_indetifer.py
Last active Aug 29, 2015
Identify type of string.
View type_indetifer.py
# Provide function to identify the data type
import socket
class TypeIdentifer(object):
_identifers=list()
@staticmethod
def is_int(s):
"""
@giwa
giwa / LMVExtend
Last active Aug 29, 2015
add LVM and extend existed volume
View LMVExtend
Personal memo for extend LVM voule
Disk /dev/vda: 317.1 GB, 317085921280 bytes
255 heads, 63 sectors/track, 38550 cylinders, total 619308440 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009c06d
Device Boot Start End Blocks Id System
/dev/vda1 * 63 1028159 514048+ 83 Linux
@giwa
giwa / stat_basic.py
Last active Aug 29, 2015
Set of basic statistic operations
View stat_basic.py
# Set of basic statistics operations
#
import math
def median(items):
"""
Return median
if number of items is odd, return average of 2 middles.
View init.d play
#!/bin/sh
### BEGIN INIT INFO
## END INIT INFO
# Path to play install folder
PLAY_HOME=/usr/share/play
PLAY=$PLAY_HOME/play
# Path to the JVM
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
View gist:1a967d689b2a71ade715
#!/bin/bash
# chkconfig: 345 20 80
# description: Play start/shutdown script
# processname: play
#
# Instalation:
# copy file to /etc/init.d
# chmod +x /etc/init.d/play
# chkconfig --add /etc/init.d/play
# chkconfig play on
View file0.go
package main
import "fmt"
func main() {
// Stringsは+で足すことができる。
fmt.Println("go" + "lang")
// intgers と float
fmt.Println("1+1 =", 1+1)
View file0.txt
brew update
brew install go
View file0.go
package main
import "fmt"
func main() {
// 1個以上の変数を宣言することができる。
var a string = "initial"
fmt.Println(a)
View file0.go
package main
import "fmt"
import "math"
// 定数は constで宣言される。
const s string = "constant"
func main() {
You can’t perform that action at this time.