Skip to content

Instantly share code, notes, and snippets.

curl http://apt.basho.com/gpg/basho.apt.key | sudo apt-key add -
sudo bash -c "echo deb http://apt.basho.com $(lsb_release -sc) main > /etc/apt/sources.list.d/basho.list"
sudo apt-get update
sudo apt-get install riak
@iliabylich
iliabylich / gist:fc4596eea147082f094e
Last active August 29, 2015 14:10
Custom rspec runner for opal specs
/*
* Test runner for phantomjs
*/
var args = phantom.args;
var page = require('webpage').create();
var fs = require('fs');
var logfile = args[1] || "/tmp/out.log";
fs.write(logfile, '', 'w');
console.log("it works")
@iliabylich
iliabylich / mirror
Last active August 29, 2015 14:11
rubygems mirror
http://production.cf.rubygems.org
@iliabylich
iliabylich / pxc_base_setup.sh
Last active August 29, 2015 14:17
pxc base setup
# 85.159.215.71 / 192.168.168.47 / pxc1
# 178.79.171.179 / 192.168.169.82 / pxc2
# 213.52.128.96 / 192.168.170.100 / pxc3
# 85.159.209.205 / 192.168.171.36 / pxc4
# 80.85.85.243 / 192.168.168.7 / lb
# Adding percona repo
apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
echo "deb http://repo.percona.com/apt trusty main" > /etc/apt/sources.list.d/percona.list
echo "deb-src http://repo.percona.com/apt trusty main" >> /etc/apt/sources.list.d/percona.list
@iliabylich
iliabylich / redis_cluster_config.sh
Last active August 29, 2015 14:19
redis cluster configuration
# 212.71.252.54 / 192.168.171.141 / node1
# 176.58.103.254 / 192.168.171.142 / node2
# 178.79.153.89 / 192.168.173.227 / node3
# local hosts
192.168.171.141 node1
192.168.171.142 node2
192.168.173.227 node3
# remote hosts
@iliabylich
iliabylich / main.sh
Last active August 29, 2015 14:19
playing with mysql-handlersocket
## Adding precona repos
apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
echo "deb http://repo.percona.com/apt trusty main" > /etc/apt/sources.list.d/percona.list
echo "deb-src http://repo.percona.com/apt trusty main" >> /etc/apt/sources.list.d/percona.list
apt-get update
## Installing percona server
apt-get install -y percona-server-server-5.6 percona-server-common-5.6 percona-server-client-5.6 percona-server-5.6-dbg # root/root
mysql -uroot -proot -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'"
mysql -uroot -proot -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'"
class Survey
def initialize(title, &block)
@title = title
instance_eval(&block)
end
def question(question_title, &block)
questions << Question.new(question_title, &block)
end
@iliabylich
iliabylich / base_doc.rb
Created June 4, 2015 18:40
Apipie concerns
# A common concern,include into all doc modules
#
module BaseDoc
include Apipie::DSL::Concern
def namespace(namespace, options = {})
@namespace = namespace
@namespace_name = options[:name]
end
attr_reader :namespace_name
module ComparesByValue
def <=>(other)
self.value <=> other.value
end
end
class A < Struct.new(:value)
include ComparesByValue
include Comparable
end