Posts

Showing posts from 2019

Insights to CPU/RAM usage on Linux using the ps command

To see what processes are running on your machine, sorted by their memory usage, run the following command: ps aux | awk '{print $2 , $4 , $11 }' | sort -k2rn | head -n 15 Similar to the above, but with some headings thrown in: echo [PID] [MEM] [PATH] && ps aux | awk '{print $2 , $4 , $11 }' | sort -k2rn | head -n 15 To view similar but CPU focused, not RAM percentage: ps -eo pcpu,pid,user,args | sort -k 1 -r | head -20

PHP disable errors/reporting

error_reporting(0); ini_set("display_errors", false);

Check what will be pushed up to remote from current HEAD

 git diff --stat --cached origin/master

Check what may be going to be done from master compared to current HEAD

git fetch && git log ..origin/master That is, "go grab all of the stuff from the upstream, and then compare my current branch against the upstream master branch."

Retrieve data from webhost

wget - r - np - R "index.html*" http :// example . com /