This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Set the path where the cache is stored; Set the zone name, totalsize (400m),and max life time(60m) | |
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=AICUNGXINH:400m inactive=60m; | |
fastcgi_cache_key "$scheme$request_method$host$request_uri"; | |
fastcgi_cache_use_stale error timeout invalid_header http_500; | |
#fastcgi_ignore_headers Cache-Control Expires Set-Cookie; | |
server { | |
set $skip_cache 0; | |
# POST requests and urls with a query string should always go to PHP | |
if ($request_method = POST) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -avz --progress -e "ssh -i ssh_key" root@ip_of_the_remote:/folder/* /target-folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DEPLOYMENT_FOLDER=/deployment-folder | |
export RELEASE_ROOT_FOLDER=$DEPLOYMENT_FOLDER/releases | |
export RELEASE_FOLDER=$DEPLOYMENT_FOLDER/releases/intermediate | |
cd $DEPLOYMENT_FOLDER/build | |
tar -xvf artifact.tar | |
rm -rf artifact.tar | |
cd $DEPLOYMENT_FOLDER | |
shopt -s dotglob | |
# Unzip and copy all files in artifact into the release folder | |
mkdir $RELEASE_FOLDER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf node_modules | |
rm package-lock.json yarn.lock | |
npm cache clear --force | |
npm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo update-alternatives --set php /usr/bin/php7.1 | |
sudo update-alternatives --set phar /usr/bin/phar7.1 | |
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1 | |
sudo update-alternatives --set phpize /usr/bin/phpize7.1 | |
sudo update-alternatives --set php-config /usr/bin/php-config7.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Carbon\Carbon; | |
use Model; | |
use Validator; | |
/** | |
* Model | |
*/ | |
class WorkingSchedule extends Model | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/lib/node_modules/laravel-echo-server/ | |
npm install sqlite3 --save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo npm cache clean -f | |
sudo npm install -g n | |
sudo n stable | |
sudo ln -sf /usr/local/n/versions/node/<version>/bin/node /usr/bin/node | |
sudo ln -sf /usr/local/n/versions/node/<version>/bin/npm /usr/local/bin/npm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sync allows deleting files in target folder if the files in the source folder are deleted | |
rsync -rtvu --delete source_folder/ destination_folder/ | |
#Compressing the files while transferring them | |
rsync -rtvz source_folder/ destination_folder/ | |
#Transferring files between two remote systems | |
rsync -rtvz source_folder/ user@domain:/path/to/destination_folder/ | |
rsync -rtvz source_folder/ user@xxx.xxx.xxx.xxx:/path/to/destination_folder/ | |
rsync -rtvz source_folder/ server_name:/path/to/destination_folder/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It helps to add ClientAliveInterval of 60 mins into SSH config | |
sudo echo 'ClientAliveInterval 60' >> /etc/ssh/sshd_config | |
#Then, restart SSH | |
#Below is the command to restart ssh on Ubuntu based | |
sudo service ssh restart | |
#Other Linux distribution | |
sudo service sshd restart |