Configure varnish cache in front of any website

You need to get a dedicated server, VPS or a droplet on the digital ocean to setup varnish server. Now i would be explaining the life cycle of each request. The request will come on 443 which would be nginx in our case or 80 which would be varnish server. Port 443...

Read more...

Record server uptime in text file

Create a shell script and execute that shell script. TODAY=$(date +"%T") SCRIPT=$(uptime | awk '{print $(NF-2)" "$(NF-1)" "$(NF-0)}') echo "$TODAY | $SCRIPT" >> /root/script/out.txt  

Read more...

Adobe Premiere tips and tricks

"back & white" "cross dissolve"   Use "crop" filter to crop video https://www.youtube.com/watch?v=2OYJGZ9nxPs Remove effects simple press backspace or delete https://www.youtube.com/watch?v=40YL1hZjaLE How to Chroma/Green Key in Premiere Pro https://www.youtube.com/watch?v=SNNZ-ZG_j4M Multiple Video Layers in Premiere Pro https://www.youtube.com/watch?v=GJsrbuc7DaY Create Smooth Beautiful Rolling Credits in Premiere Pro CC https://www.youtube.com/watch?v=U4lZcThfmFo How to Animate Text in Premiere Pro to the Beat https://www.youtube.com/watch?v=R8iewwqzGtw Best Web Export / Render Settings for Adobe...

Read more...

Ionic basic commands

Install Ionic npm install -g cordova ionic Start an App ionic start <app-name> tabs Run your App cd myApp ionic serve Get all cordova plugin in place ionic prepare Create a new page crud from command line ionic generate page <page-name> Create a new provider from command line ionic g provider <provider-name> Check all default plugins that are used in the new Ionic...

Read more...

Sever setup of apache vhots, php with different versions, varnish, redis, proFTPD, Webmin, OpenVPN on CentOS 7

Install CentOS 7 and login in via putty. Change Password passwd Check for new updates yum check-update Update your server yum update Install commonly used programs yum install -y links htop nano Install the EPEL repository sudo yum install epel-release More info on https://support.rackspace.com/how-to/install-epel-and-additional-repositories-on-centos-and-red-hat/ Install Development Tools yum groupinstall "Development Tools" Command to list groups yum group list   Install PHP Install PHP-FPM and dependancies from base...

Read more...

MySql Query Optimization

You can turn on the slow query logs in configrations and then see logs by mysqldumpslow command mysqldumpslow -s c -t 30 /var/log/mysql/mysql-slow.log   You can optimize your queries with explain command explain extended <Execute your query here>   MySQL Explain has different row count than slow query log. Try the below command to get more stats. FLUSH STATUS; <Execute your...

Read more...

Correct owner and permissions for folders and files on linux

This command will change ownership of the folder recursively chown -R username:groupname /var/www/ This command will change folder permissions recursively find /var/www/ -type d -exec chmod 755 {} \; This command will change files permissions recursively find /var/www/ -type f -exec chmod 644 {} \;  

Read more...

How to enable root login on ubuntu 16.04 ?

Enable root logins first you have to set a password for the root account and then unlock the locked root account. If you don't set a password for the root account the passwd command will return passwd: unlocking the password would result in a passwordless account.  So, first execute in...

Read more...

How to Disable Strict SQL Mode in MySQL 5.7

What is this error? "Database query failed: Data truncated for column 'column_name' at row 1 Your mysql might be running in strict mode. you need to disable it. To disable strict SQL mode, SSH in to your server as root and create this file: /etc/mysql/conf.d/disable_strict_mode.cnf Open the file and enter these two lines: [mysqld] sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION   Restart...

Read more...