The use case I had for this was when I was wanted to copy over a large data from one server to another and this was going to take a couple of hours.
So I just started the
rcyncas a background process on the server and used the following command to monitor the process output from time to time.
sudo strace -e open $(ps -o lwp= -LC rsync | sed 's/^/-p/')
Xdebug is a powerful tool for debugging PHP code, but it can be a memory hog when it is continually turned on. Xdebug can be quickly enabled and disabled by creating simple custom scripts.
Download these shell files on your Mac, make them executable and you are good to go!
[code]curl -L https://gist.githubusercontent.com/Nikschavan/0222875b8ca913d19a10773c40764ca6/raw/8aecb01f11d12c58afdeb6a77505d780b8cd8313/disable-xdebug.sh -o /usr/local/bin/disable-xdebug
curl -L https://gist.githubusercontent.com/Nikschavan/0222875b8ca913d19a10773c40764ca6/raw/8aecb01f11d12c58afdeb6a77505d780b8cd8313/enable-xdebug.sh -o /usr/local/bin/enable-xdebug
chmod +x /usr/local/bin/*able-xdebug[/code]
enable-xdebug on your terminal to enable Xdebug and
disable-xdebug to disable it.
A dirty hack but essential at times, MySQL server consumes higher memory if not configured correctly and due to which the MySQL service is terminated by the OS to save itself from crashing under high traffic.
A simple shell script can be used to restart MySQL service when it terminated.
Download this script using wget
[code lang=”shell”]wget https://gist.githubusercontent.com/Nikschavan/2346941b328b2c7f08b79611b2c9157c/raw/75ccc4855a2e8955d1c9ffac430857704f8c15f4/mysql-monitor.sh[/code]
Make the script executable
[code lang=”shell”]sudo chmod +x mysql-monitor.sh[/code]
Execute this script each minute with a crontab
[code lang=”shell”]sudo crontab -e[/code]
[code lang=”shell”]*/1 * * * * sh /path/to/script/mysql-monitor.sh[/code]