This file contains hidden or 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
#!/bin/sh -e | |
# chkconfig: 2345 95 20 | |
# description: Solr Server | |
# Solr Server service start, stop, restart | |
# @author Shay Alexandre Rocco | |
SOLR_DIR="/opt/solr" | |
JAVA="/usr/bin/java -Xmx256m -DSTOP.PORT=8079 -DSTOP.KEY=a09df7a0d -jar start.jar" | |
case $1 in |
This file contains hidden or 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
#!/bin/sh | |
# From - http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# Originally from - https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf |
This file contains hidden or 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
### Set up SO: | |
sudo -s | |
yum -y update | |
yum -y install gcc gcc-c++ make | |
### Download and install Redis: | |
cd /opt | |
wget -q http://redis.googlecode.com/files/redis-2.6.14.tar.gz | |
tar xzf redis-2.6.14.tar.gz | |
rm -f redis-2.6.14.tar.gz |
This file contains hidden or 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
// you can copy the collection from one old db to the new one (if needed) | |
db.oldcollection.find().forEach(function(d) {db.getSiblingDB('anotherdb')['newcollection'].insert(d);}); | |
// gets all the current docs | |
var docs = db.oldcollecion.find(); | |
// for each old doc, insert it into the new collection | |
docs.forEach(function(old) { var doc = {_id:old._id, ac:old.action}; if(old.advertiserid) doc.adid=old.advertiserid; db.newcollection.insert(doc); }); | |
// removes the old collection |
NewerOlder