Skip to content

Instantly share code, notes, and snippets.

View chyh1990's full-sized avatar

Chen Yuheng chyh1990

  • SenseTime
  • Beijing
View GitHub Profile
@chyh1990
chyh1990 / docker-compose.yaml
Created May 22, 2017 11:30
cassandra-two-dc-test
# docker-compose Cassandra Test Cluster
# docker-compose rm
# docker-compose up
# docker run -it --link cassandra_cassandra-1_1:cassandra --rm cassandra cqlsh cassandra
# copy paste the test script on cassandra-1
# run select on cassandra-2
#
cassandra-1:
#!/usr/bin/env ruby
require 'nokogiri'
require 'colorize'
require 'tempfile'
# valgrind --xml=yes --xml-file=leak.xml --leak-check=full --error-limit=no \
# --num-callers=20 --partial-loads-ok=yes --undef-value-errors=no \
# ruby -Ilib test/image_test.rb
@chyh1990
chyh1990 / gist:9108974
Created February 20, 2014 08:15
simple ruby thin server
#!/usr/bin/env ruby
require 'rack'
include Rack
port = (ARGV[0] || 8080 ).to_i
Handler::Thin.run Builder.new { run Directory.new ''}, :Port=>port