Skip to content

Instantly share code, notes, and snippets.

View ymotongpoo's full-sized avatar
📈
observability matters

Yoshi Yamaguchi ymotongpoo

📈
observability matters
View GitHub Profile
@ymotongpoo
ymotongpoo / erlang_ja_en.txt
Last active October 5, 2015 18:47
Erlang関連 訳語表
オリジナルは力武さんの投稿 http://erlang-users.jp/ml/erlang/index.cgi?0::166
アキュムレータ accumulator
アノテーション annotation
アリティ arity
ー致条件 match specification
入れ子リスト deep list
インターフェイス interface
エクスポート export
@ymotongpoo
ymotongpoo / pavement.py
Created April 13, 2012 10:07
Pavement for building dmd, druntime and phobos from trunk. Original version is written by repeatedly in rake style. see 329850
# -*- coding: utf-8 -*-
from paver.easy import *
import os
import os.path
import subprocess
def run_git(dirname):
print "git update %s" % dirname
sh("git pull ")
@ymotongpoo
ymotongpoo / calcpull.py
Created March 28, 2012 01:10
ZeroMQ PUSH/PULL sample implementation (no collector)
import zmq
import sys
import time
cxt = zmq.Context()
receiver = cxt.socket(zmq.PULL)
receiver.connect("tcp://127.0.0.1:5555")
sum = 0
while True:
@ymotongpoo
ymotongpoo / weathercli.py
Created March 27, 2012 15:12
ZeroMQ PUB/SUB sample implementation
import zmq
import sys
context = zmq.Context()
subscriber = context.socket(zmq.SUB)
subscriber.connect("tcp://localhost:5556")
# receive only message with zipcode being 10001
zipfilter = sys.argv if len(sys.argv) > 1 else "10001 "
subscriber.setsockopt(zmq.SUBSCRIBE, zipfilter)
@ymotongpoo
ymotongpoo / requests-oauth2.py
Created February 25, 2012 07:53
Google API OAuth 2.0 Authorization Sample in Python
# -*- coding: utf-8 -*-
"""
This scripts reqire a third party module 'requests'.
You can get it from PyPI, i.e. you can install it using
easy_install or pip.
http://docs.python-requests.org/en/v0.10.4/
Original source code is written by shin1ogawa, which is in Java.
@ymotongpoo
ymotongpoo / aiff2alac.sh
Created January 10, 2012 16:54
convert AIFF to ALAC, ALAC to AAC
#!/bin/bash
IFS="
"
cd "${1}"
echo "source dir: "${PWD}
echo "target dir: "${2}
for input in `find . -name "*.aiff" -type f`
find . -iname '*.txt' | xargs python -c 'import sys; print sys.argv[1:]'
find . -iname '*.txt' | python -c 'import sys; print [f.strip() for f in sys.stdin]'
@ymotongpoo
ymotongpoo / gist:1381882
Created November 21, 2011 06:57
convert PuTTy public key.
# convert PuTTY's public ssh key file into OpenSSH public key
ssh-keygen -i -f id_rsa_putty.pub > id_rsa.pub
@ymotongpoo
ymotongpoo / gist:1376300
Created November 18, 2011 12:13
Erlang configure option
% ./configure --prefix=/opt/erlang/R15B01 \
> --disable-hipe \
> --disable-native-libs \
> --enable-smp-support \
> --enable-threads \
> --enable-kernel-poll \
> --enable-darwin-64bit \
> --without-javac
@ymotongpoo
ymotongpoo / gist:1372699
Created November 17, 2011 08:36
build sphinx project using virtualenv
#! /bin/bash
source ~/.virtualenvs/sphinx/bin/activate
cd ~/docs/
make html