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
#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/ [email protected]:/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
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
#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
# This is the sample from Scaling PHP applications book | |
#Set the path where the cache is stored; Set the zone name(my_app), totalsize (100m),and max life time(60m) | |
fastcgi_cache_path /tmp/cachelevels=1:2keys_zone=my_app:100minactive=60m; | |
#Set the cache key used,in this case: httpsGETtest.com/somepage.html | |
fastcgi_cache_key "$scheme$request_method$host$request_uri"; | |
server{ | |
listen 80; |
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
ssh-add ~/.ssh/id_rsa &>/dev/null |
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 |
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
git branch -r --merged | grep -v '\*\|master\|dev\|DTP-263' | sed 's/origin\///' | xargs -n 1 git push --delete origin |
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 namespace Author\PluginName; | |
use System\Classes\PluginBase; | |
use Backend\Facades\BackendMenu; | |
class Plugin extends PluginBase | |
{ | |
public function register() { | |
BackendMenu::registerContextSidenavPartial('Author.PluginName', | |
'sidebar-menu', |
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
shopt -s extglob | |
rm -rf !(file-or-folder-name-to-keep) |