Skip to content

Instantly share code, notes, and snippets.

View ksauzz's full-sized avatar

Kazuhiro Suzuki ksauzz

  • Tokyo Japan
  • 17:50 (UTC +09:00)
View GitHub Profile
@ksauzz
ksauzz / mochiweb.asta
Created March 5, 2012 21:56
mochiweb call sequence diagram.
@ksauzz
ksauzz / NoVerifySSLSocketFactory.java
Created March 9, 2012 07:52
No Verifying Self Cert.
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.GeneralSecurityException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
@ksauzz
ksauzz / .travis.yml
Created March 22, 2012 12:00
TravisCI configuration file for Erlang.
language: erlang
otp_release:
- R15B
- R14B04
- R14B03
- R14B02
notifications:
disabled: true
@ksauzz
ksauzz / gist:2318467
Created April 6, 2012 09:27
is ShutdownHook running?
private static boolean isShutdownHookRunning() {
for (Thread thread : Thread.getAllStackTraces().keySet()) {
if (!"DestroyJavaVM".equals(thread.getName())) { continue; }
for (StackTraceElement element : thread.getStackTrace()) {
if ("java.lang.ApplicationShutdownHooks".equals(element.getClassName())) {
return true;
}
}
}
return false;
@ksauzz
ksauzz / gist:2374142
Created April 13, 2012 05:50
building a project in maven project with submodules.
mvn clean compile -pl com.ksauss.name:app-sample-project
@ksauzz
ksauzz / gist:2397911
Created April 16, 2012 11:30
add classpath in JRuby
require 'java'
dirname = File.expand_path File.dirname(__FILE__)
Dir.glob("#{dirname}/jars/*.jar").each {|jar| $CLASSPATH << jar }
import 'com.ksauzz.ClassName'
@ksauzz
ksauzz / gist:2515493
Created April 28, 2012 03:38
making shards for flockdb.
gizzmo -s -T 0 create-table --source-type="INT UNSIGNED" --dest-type="INT UNSIGNED" --shards=15 --concrete="com.twitter.flockdb.SqlShard" --base-name=backward 1 localhost
@ksauzz
ksauzz / cvs2svn_mac.markdown
Created July 25, 2012 08:40
CVS2SVN on OS X
@ksauzz
ksauzz / remote_execution.sh
Created July 30, 2012 07:39
remote shell script execution.
cat <<"EOS" | ssh username@hostname 'bash'
# ref: http://backreference.org/2011/08/10/running-local-script-remotely-with-arguments/
hostname
EOS
@ksauzz
ksauzz / gist:3405559
Created August 20, 2012 16:28
YCSB with cassandra.

Preparation

$ cassandra
$ cassandra-cli
create keyspace usertable
    with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
    and strategy_options = {replication_factor:1};
use usertable;
create column family data;