Skip to content

Instantly share code, notes, and snippets.

View ksauzz's full-sized avatar

Kazuhiro Suzuki ksauzz

View GitHub Profile
import getpass
import os
import threading
import time
from urllib.parse import urlparse
import zipfile
import numpy
try:
from PIL import Image
@ksauzz
ksauzz / build_pyflame.md
Created August 24, 2018 10:03
build pyflame with pyenv
PKG_CONFIG_PATH=~/.pyenv/versions/3.6.5/lib/pkgconfig:~/.pyenv/versions/3.5.6/lib/pkgconfig: ./configure --prefix=/usr/local/pyflame
@ksauzz
ksauzz / uninstall-rails.md
Created June 14, 2016 01:21
Uninstall rails command

Unisntalling rails command needs to uninstall railties, not only rails.

% gem uninstall railties -v 5.0.0.rc1

You have requested to uninstall the gem:
        railties-5.0.0.rc1

coffee-rails-4.1.1 depends on railties (< 5.1.x, >= 4.0.0)
jquery-rails-4.1.1 depends on railties (&gt;= 4.2.0)
@ksauzz
ksauzz / building-mesos-on-osx-10.9.5.md
Last active August 29, 2015 14:26
Building Mesos from source on OS X 10.9.5.

My homebew is installed into /usr/local/homebrew.

Install gcc-4.8

brew install gcc48

cd /usr/local/bin
rm cc gcc c++ g++
ln -s /usr/local/bin/gcc-4.8 cc
@ksauzz
ksauzz / flush_buffer.sh
Last active August 18, 2017 10:28
flush buffer (tag:disk, storage, cache)
#!/bin/bash
free
sudo sync
echo 3 | sudo tee /proc/sys/vm/drop_caches
free
LoadPlugin "exec"
<Plugin "exec">
Exec "haproxy:haproxy" "/usr/local/bin/haproxy-stats" "-p" "10"
</Plugin>
#### Contents of the preconfiguration file (for squeeze)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.
@ksauzz
ksauzz / installing-jmx4perl.md
Created April 14, 2014 10:49
Installing jmx4perl
wget http://search.cpan.org/CPAN/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.01080605.tar.gz
wget http://pari.math.u-bordeaux.fr/pub/pari/unix/OLD/2.3/pari-2.3.5.tar.gz
tar -zxvf Math-Pari-2.01080605.tar.gz
tar -zxvf pari-2.3.5.tgz
cd Math-Pari-2.01080605
vim Makefile.PL
##Line 9: Change to $paridir = "../pari-2.3.5";
perl Makefile.PL
cpanm .
@ksauzz
ksauzz / install-s3curl.md
Last active December 25, 2015 06:09
Install s3curl

CentOS

wget https://raw.github.com/ksauzz/s3curl/master/s3curl.pl
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
sudo cpanm YAML HTTP::Date Digest::HMAC_SHA1 URI::Escape

cpanminus https://github.com/miyagawa/cpanminus

@ksauzz
ksauzz / Riak2iSample.java
Created September 5, 2013 03:20
riak-java-client v1.4.0 2i sample
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.List;