Skip to content

Instantly share code, notes, and snippets.

View mindreframer's full-sized avatar
🎯
Focusing

Roman Heinrich mindreframer

🎯
Focusing
View GitHub Profile
#!/usr/bin/env bash
cd ~/Desktop
rails braid_test
cd braid_test
git init
touch .gitignore
echo "*.log
tmp/*
*.sqlite3
#!/usr/bin/env bash
# clean desktop
rm -rf ~/Desktop/braid_test
# clone plugins from github
mkdir ~/tmp
mkdir ~/tmp/braid/
cd ~/tmp/braid
# mongo_template.rb
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842)
#
# To use:
# rails project_name -m http://gist.github.com/gists/219223.txt
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
@mindreframer
mindreframer / gist:644073
Created October 24, 2010 22:13
splitting a file by comma, printing uniq numerical sorted values
cat some_file.txt |grep -v GETT| awk '{split($0,array,",")} {print array[2]}'|sort -n |uniq
@mindreframer
mindreframer / for_ubuntu_10.04.sh
Created December 15, 2010 14:29
update to percona 5.1.52-12.3-159 for ubuntu 10.04/8.04
##### move your default mysql datadir and initialize a fresh db:
mkdir /tmp/percona
cd /tmp/percona
wget http://www.percona.com/downloads/Percona-Server-5.1/Percona-Server-5.1.52-12.3/deb/lucid/x86_64/libmysqlclient-dev_5.1.52-12.3-159.lucid_amd64.deb
wget http://www.percona.com/downloads/Percona-Server-5.1/Percona-Server-5.1.52-12.3/deb/lucid/x86_64/libmysqlclient16_5.1.52-12.3-159.lucid_amd64.deb
wget http://www.percona.com/downloads/Percona-Server-5.1/Percona-Server-5.1.52-12.3/deb/lucid/x86_64/percona-server-client_5.1.52-12.3-159.lucid_all.deb
- servers on 93 => 1, 94 => 2, 95 => 3 (checked)
# zoo.cfg ###############################################################
tickTime=2000
dataDir=/var/zookeeper
clientPort=2181
initLimit=5
syncLimit=2
server.1=192.168.2.93:2888:3888
server.2=192.168.2.94:2888:3888
server.3=192.168.2.95:2888:3888
################################## irb1
>> require 'zookeeper'
=> true
>>
?> ZK = Zookeeper.new('192.168.2.93:2181, 192.168.2.94:2181, 192.168.2.95:2181')=> #<Zookeeper:0x16f9ab8 @dispatcher=#<Thread:0x16f9810 sleep>, data#<CZookeeper:0x16f99a0, @current_req_id=1, @host="192.168.2.93:2181, 192.168.2.94:2181, 192.168.2.95:2181", @req_mutex=#<Mutex:0x16f9a18>, watcher_reqs{-1=>{:watcher=>#<Proc:0x00000000017179c8@/usr/local/lib/ruby/gems/1.8/gems/zookeeper-0.4.2/lib/zookeeper.rb:228>}}, completion_reqs{}
>>
?> def set_callback(path)
>> wcb = Zookeeper::WatcherCallback.new do
?> puts "callback fired for #{path}"
>> new_value = ZK.get(:path => path)[:data]
@mindreframer
mindreframer / gist:807542
Created February 2, 2011 10:53
zookeeper testing script
######### installing zookeeper from github
git clone https://github.com/twitter/zookeeper.git
gem uninstall zookeeper
gem install echoe
cd zookeeper
rake package
cd pkg
gem install zookeeper-0.4.2.gem
@mindreframer
mindreframer / Gemfile
Created May 3, 2011 00:14
Titanium Logger with Gemfile
source "http://rubygems.org"
gem 'em-websocket'
gem "sinatra"
gem "thin"
gem "haml"
group :development do
end
@mindreframer
mindreframer / links.txt
Created January 7, 2012 14:18
Interesting Links for ElasticSearch