Skip to content

Instantly share code, notes, and snippets.

View fishsaidno's full-sized avatar

fishsaidno

  • Brisbane, Australia
View GitHub Profile
@jonom
jonom / DownloadCloudwaysLocalBackups.sh
Created October 4, 2019 03:30
CloudWays - bash script to download local backups for all applications on a server
#!/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
@servel333
servel333 / handlebars-operators.md
Created February 15, 2018 15:39
Handlebars {{#if (op ... )}} operators

Raise Open File Limits in OS X

in OS X 10.4 to macOS sierra 10.12 and maybe higher!

Create Launcher Script:

/Library/LaunchDaemons/limit.maxfiles.plist

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:

@MiPnamic
MiPnamic / average_php.sh
Last active February 23, 2023 01:43
Check average Memory usage of PHP-FPM processes
#!/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
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active November 12, 2023 23:00
Remove node_modules from git repo
#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>