Skip to content

Instantly share code, notes, and snippets.

@aminamid
aminamid / gist-file0.txt
Created March 17, 2015 03:29
Usage of sed, awk, grep
zcat imapserv.*.stat.gz | grep -e ' .... ms' | sed -e 's#[;/\(\)]# #g' | awk '{printf("%s %s ",$2,$6); for(i=9;i<NF;i++){printf("%s%s",$i,OFS=" ")}print $NF}' | column -t | sort -k2
@aminamid
aminamid / _vimrc
Created March 5, 2015 07:38
vimrc
" POSTTASK
" cd .vim/plugin/jedi-vim; git submodule update --init
" wget
" https://gist.githubusercontent.com/miyakogi/2338fc7705fdc515447e/raw/12e334ec6c3d0817c8171434f50b1f352621bf0c/nim.snip -O ~/.vim/snippets/nim.snip
set tabstop=8
set softtabstop=4
set shiftwidth=4
set expandtab
set smarttab
@aminamid
aminamid / smpl.sh
Last active August 29, 2015 14:16
performance information of host
#!/bin/bash
DATESTR=`date "+%Y%m%d%H%M%S"`
INTERVAL=3
DURATION=10
OUTDIR=/tmp/pss$DATESTR
TARGETS="java influxd"
function pgreps() { echo $(for target in $@ ; do pgrep $target; done); return 0; }
We couldn’t find that file to show.
:r !for i in $(seq 53 152); do printf 'mig\%07d\n' $i ; done
@aminamid
aminamid / file0.py
Created February 24, 2015 17:14
第一回 オフラインリアルタイムどう書くの参考問題の解答をPythonで書いてみた ref: http://qiita.com/aminamid/items/bfaf2ae1cdbeb48fa2ef
import re
import itertools
SPEC = {
"suit": ["S","H","D","C"],
"rank": ["2","3","4","5","6","7","8","9","10","J","Q","K","A"],
"hand": (
("4K", lambda x: max(snds(uniq_cnt(snds(x)))) == 4),
("FH", lambda x: sorted(snds(uniq_cnt(snds(x)))) == sorted((2,3))),
("3K", lambda x: max(snds(uniq_cnt(snds(x)))) == 3),
<!DOCTYPE html>
<html>
<head>
<title>Hello, World!</title>
<script src="http://fb.me/react-0.11.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.11.2.js"></script>
</head>
<body>
<div id="content"></div>
<script type="text/jsx">
@aminamid
aminamid / index.html
Created December 10, 2014 10:21
kokudo
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map { height: 100% }
</style>
@aminamid
aminamid / file0.txt
Last active August 29, 2015 14:10
pythonでjson又はyamlを色付きでpretty printする ref: http://qiita.com/aminamid/items/8b3966ef3707eaa40c12
# json
$ echo '{ "name": "pp.py", "list": [ 1, 2, 3, "Da!" ] }' | pp.py
#yaml
$ echo '{ name: pp.py, list: [ 1, 2, 3, Da! ] }' | pp.py
@aminamid
aminamid / file0.txt
Last active August 29, 2015 14:10
pythonでcolor文字をprettyに出力 ref: http://qiita.com/aminamid/items/3819e1c34c597c535d60
python pp.py <ファイル名> [インデント数]