Skip to content

Instantly share code, notes, and snippets.

Avatar

Kazuhiro Suzuki ksauzz

View GitHub Profile
View hdfs_image_dataset.py
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 Aug 24, 2018
build pyflame with pyenv
View build_pyflame.md
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 Jun 14, 2016
Uninstall rails command
View uninstall-rails.md

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 Aug 29, 2015
Building Mesos from source on OS X 10.9.5.
View building-mesos-on-osx-10.9.5.md

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 Aug 18, 2017
flush buffer (tag:disk, storage, cache)
View flush_buffer.sh
#!/bin/bash
free
sudo sync
echo 3 | sudo tee /proc/sys/vm/drop_caches
free
View Haproxy monitoring for collectd
LoadPlugin "exec"
<Plugin "exec">
Exec "haproxy:haproxy" "/usr/local/bin/haproxy-stats" "-p" "10"
</Plugin>
View preseed.cfg
#### 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.
View installing-jmx4perl.md
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 Dec 25, 2015
Install s3curl
View install-s3curl.md

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 Sep 5, 2013
riak-java-client v1.4.0 2i sample
View Riak2iSample.java
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;