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
// 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 |
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
### 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 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 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 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
# update | |
sudo yum -y update | |
sudo yum -y upgrade | |
# enable EPEL6 by changing enabled=0 -> enabled=1 | |
sudo vim /etc/yum.repos.d/epel.repo | |
# install htop | |
sudo yum install htop |
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
sudo -s | |
## dependencies to build | |
yum -y groupinstall "Development Tools" | |
## download and build | |
cd /opt | |
wget http://nodejs.org/dist/node-latest.tar.gz | |
tar zxf node-latest.tar.gz | |
cd node-latest | |
./configure |
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
sudo -s | |
curl -L get.rvm.io | bash -s stable | |
source /etc/profile.d/rvm.sh | |
rvm requirements | |
rvm install 1.9.3 | |
rvm use 1.9.3 --default | |
# ruby -v | |
# should be ruby 1.9.3 | |
rvm rubygems current | |
# gem -v |
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
#!/bin/bash | |
sudo -s | |
yum -y update | |
yum -y install mdadm sysstat | |
cat <<EOF > /etc/yum.repos.d/10gen.repo2 | |
[10gen] | |
name=10gen Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 | |
gpgcheck=0 |
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
#!/bin/bash | |
# node.js using PPA (for statsd) | |
sudo apt-get -y install python-software-properties | |
sudo apt-add-repository -y ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get -y install nodejs | |
# Install git to get statsd | |
sudo apt-get -y install git |
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
#!/bin/bash | |
apt-get update | |
apt-get install -y python-software-properties software-properties-common | |
add-apt-repository ppa:chris-lea/node.js | |
apt-get update | |
apt-get install nodejs |
OlderNewer