Skip to content

Instantly share code, notes, and snippets.

@zj8487
Forked from dirkk0/doit.sh
Last active August 29, 2015 14:16
Show Gist options
  • Save zj8487/52f443f53e27ff827cc5 to your computer and use it in GitHub Desktop.
Save zj8487/52f443f53e27ff827cc5 to your computer and use it in GitHub Desktop.
sudo apt-get update
# get ec2 ip and hostname
curl http://169.254.169.254/latest/meta-data/public-ipv4 > public.ip
curl http://169.254.169.254/latest/meta-data/public-hostname > public.hostname
sudo apt-get install --yes build-essential curl git
#install latest node
sudo apt-get install --yes python-software-properties python g++ make
sudo add-apt-repository --yes ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install --yes nodejs
sudo apt-get install --yes graphicsmagick
git clone https://github.com/e14n/pump.io.git
cd pump.io; npm install; npm install gm; cd ..;
cp pump.io/pump.io.json.sample del.txt
# delete these lines
sed -i '/key/d' del.txt
sed -i '/cert/d' del.txt
# replace example.com and org
sed -e "s/example.com/`cat public.hostname`/g" del.txt > temp && mv temp del.txt
sed -e "s/example.org/`cat public.hostname`/g" del.txt > temp && mv temp del.txt
sed -e "s/pumpio.localhost/`cat public.hostname`/g" del.txt > temp && mv temp del.txt
sed -e "s/\/var\/local\/pump.io\/uploads/uploads/g" del.txt > temp && mv temp del.txt
#replace username
sed -e "s/\"pumpio\"/\"ubuntu\"/g" del.txt > temp && mv temp del.txt
# replace databank driver
sed -e "s/disk/memory/g" del.txt > temp && mv temp del.txt
# use redis
sudo apt-get --yes install redis-server
cd pump.io; npm install databank-redis; cd ..
sed -e "s/memory/redis/g" del.txt > temp && mv temp del.txt
sed -e "s/\"dir\": \"\/tmp\/pumpio\/\"/\"host\":\"localhost\",\"port\":6379/g" del.txt > temp && mv temp del.txt
# move the config file
sudo mv del.txt /etc/pump.io.json
screen -S pumpserver -L -dm bash -c "cd pump.io; npm start"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment