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 //or sudo service apache2 restart sudo service apache2 stop sudo service apache2 start //REDIS wget http://download.redis.io/releases/redis-2.8.9.tar.gz tar xzf redis-2.8.9.tar.gz cd redis-2.8.9 make make test sudo make install //To access the script move into the utils directory: cd utils sudo ./install_server.sh sudo service redis_6379 start sudo service redis_6379 stop //access the redis database by typing the following command redis-cli //The prompt will look like this: redis 127.0.0.1:6379>
vim
: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 ./phpstorm.sh
git
git clone git@bitbucket.org:repo.git folderName git clone -b develop --single-branch git@bitbucket.org:repo.git indev git branch git branch -v
httpd.conf
ServerName test.local.influencenetwork.com DocumentRoot /home/indev/public
Mongo
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart 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 /var/log/mongodb/mongod.log 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
Terminator
- 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 abc.sh)
- 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