Skip to content

Instantly share code, notes, and snippets.

akiniwa akiniwa

Block or report user

Report or block akiniwa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
$ docker-machine env
# export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://"
export DOCKER_CERT_PATH="/home/hoge/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval $(docker-machine env)
mkdir volume
cp aerospike.conf volume/aerospike.conf
$ docker-machine create -d virtualbox default
akiniwa /
Last active Feb 18, 2017
Aerospike on OSX
vagrant init aerospike/centos-6.5
vagrant up
vagrant ssh -c "sudo service aerospike status"
# Aerospike Management Console (AMC)
vagrant ssh -c "sudo service amc status"
vagrant ssh -c "sudo grep -i cake /var/log/aerospike/aerospike.log"
vagrant ssh -c "ip addr"|grep 'global eth1'
# >>
# inet brd scope global eth1
akiniwa /
Last active Jan 26, 2017
Logistic Regression CV
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.cross_validation import train_test_split
from sklearn.metrics import accuracy_score, roc_auc_score
def score(model, X, y):
X_train, X_test, y_train, y_test = train_test_split(X, y), y_train)
pred_proba = model.predict_proba(X_test)
View gist:32f5041d84042050e6f4bdce0318b26a
run('pwd', pty=False)
View gist:8d13c252df54ce7e8098b3f2984967a3
AWS環境で, Fabricの実行結果がhungすることがある。
Fabricは、デフォルトでコマンドの前に、"/bin/bash -l c"とする。
とりあえず、 = "/bin/bash -c"
akiniwa / gist:7707d3b135c43adfa12d85b9b8522c75
Created Nov 11, 2016
Conda入れてからvagrant upでコケる
View gist:7707d3b135c43adfa12d85b9b8522c75
sudo rm -rf /opt/vagrant/embedded/bin/curl
akiniwa / gist:a2848d1a41fdd57daa27550832bb447f
Last active Nov 10, 2016
Error: b'pyenv: pg_config: command not found\n'
View gist:a2848d1a41fdd57daa27550832bb447f
running this command.
$ pip install psycopg2
Collecting psycopg2
Using cached psycopg2-2.6.2.tar.gz
Complete output from command python egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
cents = [km.kmeans.cluster_centers_ for km in kms]
D_k = [cdist(rid_brand_pca, cent, 'euclidean') for cent in cents]
# 最も近い中心との距離
dist = [np.min(D,axis=1) for D in D_k]
avgWithinSS = [sum(d)/rid_brand_pca.shape[0] for d in dist]
# elbow curve
import datetime
from datetime import timedelta
# 現在時刻
now =
# 文字列へのフォーマット
now.strftime('%Y-%m-%d') # => '2015-09-15'
# 引き算
now - datetime.timedelta(days=2)
You can’t perform that action at this time.