This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd ~/Desktop | |
rails braid_test | |
cd braid_test | |
git init | |
touch .gitignore | |
echo "*.log | |
tmp/* | |
*.sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# clean desktop | |
rm -rf ~/Desktop/braid_test | |
# clone plugins from github | |
mkdir ~/tmp | |
mkdir ~/tmp/braid/ | |
cd ~/tmp/braid | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat some_file.txt |grep -v GETT| awk '{split($0,array,",")} {print array[2]}'|sort -n |uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################## 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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######### 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "http://rubygems.org" | |
gem 'em-websocket' | |
gem "sinatra" | |
gem "thin" | |
gem "haml" | |
group :development do | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MUSTWATCH!!! | |
- http://www.elasticsearch.org/videos/2011/08/09/road-to-a-distributed-searchengine-berlinbuzzwords.html (after 24 min is really great stuff) | |
HADOOP + elastic search: | |
- http://thedatachef.blogspot.com/2011/01/bulk-indexing-with-elasticsearch-and.html | |
CouchDB + ElasticSearch | |
---> very strange idea: CouchDB as SourceOfTruth, ElasticSearch to be the Workhorse.... | |
- http://stackoverflow.com/questions/6636508/elastic-search-as-a-database/6761973#6761973 |
OlderNewer