Skip to content

Instantly share code, notes, and snippets.

###################################### MIRROR AND WEBSITE ######################################
wget -np -nv -m http://preview.byaviators.com/template/realsite/
###################################### Find out the largest files in linux ######################################
du -hs * | sort -rh | head -5
find / -xdev -type f -size +100M
###################################### Kill a port when already in use ######################################
@fitut
fitut / gist:74c5b801bda03b057df0
Last active October 9, 2015 16:03
Mongodb installation on new server
Problem : exception in initAndListen: 29 Data directory /data/db not found., terminating
sudo mkdir -p /data/db
Problem :Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
Change /var/lib/mongodb to /data/db in /etc/mongo.conf
chown -R mongodb:mongodb /data/db
Problem : Unable to lock file: /data/db/mongod.lock errno:11 Resource temporarily unavailable.
Remove mongodb.lock file from /data/db
mongod --dbpath /data/db --repair
@fitut
fitut / gist:df58425e87cf6276fe3b
Created October 8, 2015 14:29
Phusion Passenger
############### Ruby ###############
sudo apt-get update
sudo apt-get install curl libcurl4-openssl-dev
curl -L get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm requirements
rvm install 2.1.0
rvm use 2.1.0 --default
@fitut
fitut / gist:a2cfc0365ed6fc863929
Last active October 9, 2015 17:58
Clean server installation with Laravel
For Language Pack
sudo locale-gen UTF-8
sudo apt-get update
#### Git #####
sudo apt-get install git
############## Apache ##############
Installing Apache
sudo apt-get install apache2