Based on https://stackoverflow.com/a/31632215/761771
const reduceOp = function(args, reducer){
args = Array.from(args);
args.pop(); // => options
var first = args.shift();
return args.reduce(reducer, first);
};
#!/bin/bash | |
# CloudWays - Download local backups for all applications | |
# ======================================================= | |
# * Local backups must be enabled and available. See https://support.cloudways.com/how-to-download-a-full-backup/ | |
# * Add your machine's SSH key to your server so this script needs no input. | |
# * Backups will be saved inside a new folder with today's date within your nominated backup directory. (This might not be the date the backup was taken.) | |
# * Only tested on Digital Ocean VPS so far. | |
# Configuration |
Based on https://stackoverflow.com/a/31632215/761771
const reduceOp = function(args, reducer){
args = Array.from(args);
args.pop(); // => options
var first = args.shift();
return args.reduce(reducer, first);
};
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
in OS X 10.4 to macOS sierra 10.12 and maybe higher!
Copy this entire code block and paste it into your terminal and push Return to create this file for you with correct permissions. It will (probably) ask for your password:
#!/bin/bash | |
echo "Average php-fpm process memory usage:" | |
PHPFPM="php-fpm" # it could be just php-fpm or php-fpm-X.X (eg. php-fpm-7.1) depending on configuration | |
AVG=$(ps --no-headers -o "rss,cmd" -C $PHPFPM | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }') | |
QTY=$(ps -ylC $PHPFPM --sort:rss | tail -n +2 | wc -l) | |
echo "$AVG on $QTY processes" | |
exit 0 |
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin <branch-name> |