Tuesday, December 16, 2014

Some useful linux commands

Give read/write permission to the specific folder

chmod -775 folder_name

//Give read/write permission to all the sub-folders
chmod -775 -R folder_name

//Check rails server
ps aux|grep rails

//Check Ubuntu version
lsb_release -a

Mongodb locations

//Config file
/etc/mongodb.conf

//Actual Storage location file
cd var/lib/mongodb/

/etc/init.d/mongod

Change the owner

sudo chown -R mongodb:mongodb /var/lib/mongodb/

Repair the mongodb is nothing can't be fixed

sudo -u mongodb mongod --repair --dbpath /var/lib/mongodb/

Check all ports

 netstat -tulpn

Show all running processes

ps aux | less

Checking free memory

free -m

Stop Bitnami mysql

sudo ./ctlscript.sh stop mysql

Start the default mysql server

/etc/init.d/mysql start
/etc/init.d#

Sometimes if the Bitnami stack is installed and local mysql is running, it can cause the problem

//End the default mysql
cd /etc/init.d
sudo service mysql stop

Check haproxy log

vim /var/log/haproxy.log

No comments:

Post a Comment