Got a new jobba. Back to Linux, after years of developing in Win, using NuSphere, came to essentials. In this post I will write all of the usefull shell and not only commands frequenly used.

Apache & mysql &Redis:

//change permission
chmod -R 0755 /var/www/html/mysite/images/
sudo /etc/init.d/mysql start
sudo /etc/init.d/mysql restart
service mysqld status
sudo start mysql
sudo gedit /etc/apache2/apache2.conf
/etc/init.d/apache2 start
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/apache2 stop
sudo service apache2 restart
sudo service apache2 stop
sudo service apache2 start
tar xzf redis-2.8.9.tar.gz
cd redis-2.8.9
make test
sudo make install
//To access the script move into the utils directory:
cd utils
sudo ./
sudo service redis_6379 start
sudo service redis_6379 stop
//access the redis database by typing the following command
//The prompt will look like this:


:q to quit
:q! to quit without saving
:wq to write and quit
:x to write and quit
:qa to quit all

Run PhpStorm

cd /home/serhii/phpstorm/bin


git clone folderName
git clone -b develop --single-branch indev
git branch
git branch -v


DocumentRoot /home/indev/public


sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10
echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-org
sudo service mongod start
sudo service mongod restart

Install Php5.5

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update && sudo apt-get dist-upgrade

To restart mongo if it says it runs but fails to connect - del lock mongo file.

locate mongo
locate mongo | grep lock
cd /var/lib/mongodb/
del lock file


  • ls - List Directory Contents (“ls -l” - in long listing fashion, ls -a- including hidden)
  • lsblk - List Block Devices. lsblk -l in 'list' structure
  • dd - Convert and Copy a file (dd if=/home/user/Downloads/debian.iso of=/dev/sdb1 bs=512M; sync)
  • uname - Unix Name, detailed info about the machine name (uname -a)
  • history - list of executed commands in terminal
  • sudo - super user do - allows to execute a command as the superuser (sudo add-apt-repository ppa:tualatrix/ppa)
  • mkdir - Make directory (mkdir tecmint)
  • touch - creates the file, only if it doesn’t exist (touch file)
  • chmod - change file mode/permission bits (chmod 777
  • apt - Advanced Package Tool (apt-get install player)
  • chown - change file owner and group
  • tar (tar -zxvf abc.tar.gz (Remember 'z' for .tar.gz))
  • cal (cal 02 1835)
  • cat - Concatenate plain files and/or print contents of a file on standard output (cat a.txt b.txt c.txt d.txt abcd.txt)
  • cp - copy (cp /home/user/Downloads abc.gz /home/user/Desktop (Return 0 when sucess))
  • mv - moves a file from one location to another (mv /home/user/Downloads abc.tar.gz /home/user/Desktop (Return 0 when sucess))
  • pwd - print working directory
  • cd - change directory (cd /home/user/Desktop)

Each day merge (when working on lots of branches)

git pull
//watch if any commits made to another branches
git checkout locations-stats-da14 
git pull
git checkout Front-End-Serge
//merge develop to Serge
git merge locations-stats-da14

Leave a Comment

Fields with * are required.

Please enter the letters as they are shown in the image above.
Letters are not case-sensitive.