Skip to content

Instantly share code, notes, and snippets.

@yesoreyeram
Last active August 7, 2017 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yesoreyeram/8309e3f5ae88589a234cadfa44c36252 to your computer and use it in GitHub Desktop.
Save yesoreyeram/8309e3f5ae88589a234cadfa44c36252 to your computer and use it in GitHub Desktop.
Ubuntu

Add user

sudo adduser username

user to sudo

sudo usermod -aG sudo username

sudo auto password

sudo visudo

username ALL=(ALL) NOPASSWD: ALL

Enable Password authentication

sudo nano /etc/ssh/sshd_config PasswordAuthentication yes service ssh restart

Install Graphite on Ubuntu 14/16
==============================
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt-get install build-essential graphite-web graphite-carbon python-dev apache2 libapache2-mod-wsgi libpq-dev python-psycopg2 --yes
sudo nano /etc/default/graphite-carbon # enable carbon cache
sudo service carbon-cache start
sudo graphite-manage syncdb # username leave as blank
sudo chown _graphite:_graphite /var/lib/graphite/graphite.db
sudo cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available
sudo a2dissite 000-default
sudo a2ensite apache2-graphite
sudo service apache2 reload
sudo service apache2 restart
curl http://localhost/
echo "foo.bar 1 `date +%s`" | nc localhost 2003
curl "localhost/render/?format=json&target=foo.bar&from=-10minutes"
# sudo nano /etc/apache2/sites-available/apache2-graphite.conf
# sudo nano /etc/apache2/ports.conf
# sudo a2enmod headers
//
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, OPTIONS"
Header set Access-Control-Allow-Headers "origin, authorization, accept"
Header set Access-Control-Allow-Credentials true
//
Install Grafana on Ubuntu
==========================
sudo apt-get update && sudo apt-get upgrade --yes
wget https://grafanarel.s3.amazonaws.com/builds/grafana_4.1.2-1486989747_amd64.deb
sudo apt-get install -y adduser libfontconfig
sudo dpkg -i grafana_4.1.2-1486989747_amd64.deb
sudo service grafana-server start
curl "localhost:3000"
Install NodeJS on Ubuntu
====================================
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt-get install npm --yes
sudo npm install n -g
n stable
npm install -g pm2
node -v
npm -v
npm list -g --depth=0
Install git on Ubuntu
=====================
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt-get install git
git --version
Install nginx on Ubuntu
========================
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt-get install nginx --yes
Install Java on Ubuntu
======================
sudo apt-get update && sudo apt-get upgrade --yes
sudo add-apt-repository -y ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get -y install openjdk-8-jre
java -version
Install elasticsearch on Ubuntu
===============================
sudo apt-get install unzip
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/2.4.2/elasticsearch-2.4.2.zip
unzip elasticsearch-2.4.2.zip
sudo mv elasticsearch-2.4.2 /opt/
sudo ln -s /opt/elasticsearch-2.4.2/bin/elasticsearch /bin/
elasticsearch &
curl "localhost:9200"
https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.2/elasticsearch-2.4.2.tar.gz
https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.4.2/elasticsearch-2.4.2.deb
Install powershell on ubuntu
===============================
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
sudo apt-get update
sudo apt-get install -y powershell
Useful articles
==============
setting up basic authentication in nginx
https://www.digitalocean.com/community/tutorials/how-to-set-up-http-authentication-with-nginx-on-ubuntu-12-10
nginx as a reverse proxy to host multiple sites
https://timothy-quinn.com/using-nginx-as-a-reverse-proxy-for-multiple-sites/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment