Coggle requires JavaScript to display documents.
.pub
cat ~/.ssh/id_rsa.pub | pbcopy
mkdir ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
sudo adduser semaphoreci
su semaphoreci
node -v
install PM2
npm install -g pm2
ssh-keyscan -p 22 -H droplet-ip-address >> ~/.ssh/known_hosts
pm2 deploy ecosystem.json production
cat ~/.ssh/semaphoreci_id_rsa | pbcopy
ssh -i ~/.ssh/semaphoreci_id_rsa semaphoreci@droplet-ip
nano ~/.ssh/config
Host semaphoreci-droplet
Hostname droplet-ip-address
User semphoreci
ForwardAgent yes
Port 22
IdentityFile ~/.ssh/semaphoreci_id_rsa
ssh semaphoreci-droplet
cd ~/.ssh
ssh-keygen -t rsa -b 4096
id_rsa.pub
ssh -T git@github.com
npm init
npm install --save express
nano app.js
var expres = require("express");
var app = express();
app.get("/", function(req,res){
res.send("HELLO WORLD")
});
app.listen(3000)
process.on("SIGNIT", function(){ //To do: clean up before reload
node app.js
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash
nvm install 6
iptables
iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000
apt-get install iptables-persistent
/home/deploy/.nvm/versions/node/<version>/bin/pm2
.nvmrc
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vim build-essential libssl-dev git unattended-upgrades authbind openssl fail2ban
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get install -y mongodb-org
service mongod status
sudo apt-get install redis-server
redis-benchmark -q -n 1000 -c 10 -P 5
source ~/.profile
sudo add-apt-repository ppa:chris-lea/redis-server
sudo apt-get -y install redis-server
sudo service redis-server status
redis-cli
redis-server
netstat
sudo netstat -naptu | grep LISTEN
sudo service redis-server restart
redis-benchmark
/etc/redis/redis.conf
bind 127.0.0.1
bind 0.0.0.0
#requirepass foobared
foobared
PING
AUTH <password>
PONG
redis.conf
SECURITY
rename-command CONFIG 123aqCNFGG
rename-command CONFIG ""
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
source ~/.bashrc
nvm install stable
nvm alias default stable
pm2
~/.bashrc
nano ~/.bashrc
case $- in
*i*);;
*) return;;
esac
/var/www
var/www/
sudo mkdir /var/www
sudo adduser semaphoreci wwww-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+wr /var/www
touch /var/www.test.txt
nano ecosystem.json
pm2 ecosystem
pm2 deploy ecosystem.json production setup
pm2 startup ubuntu
ssh root@droplet-ip-address
#paste output and run it here
pm2 status
pm2 save
sudo reboot
https://<GITHUBTOKEN>@github.com/username/repo.git
pm2 deploy production
pm2 deploy production --force
pm2 monit
siege -c 50 http://<ipaddress>
sudo apt-get git
sudo timedatectl set-timezone America/New_York
sudo timedatectl set-timezone Europe/London
timedatectl status | grep "Time zone"