Category: Scripting

Get Top 10 User Agents

Extract a list of the top user agents from an Apache format log file and sort in descending order by number of occurrences:

Results similar to this:

   

Read More »

Clearing PHP opcache

Great article on how to clear the PHP opcache: https://ma.ttias.be/how-to-clear-php-opcache/ To facilitate use on a Plesk server created script and mapped into namespace: https://acme.com/opcache_clear Here’s the script: And here’s the Apache config to map into a virtual host: This above config should be placed in the “Apache & nginx setting” screen in the “Additional directives for https” field. In addition to setting the alias path we’re also setting the PHP handler. Additionally under “Password protected directories” added password protection for “/opcache_clear”. This is just a placeholder for the password file which is referenced in the above config.

Read More »

Bash Directory Stack

Ryan at Level1Techs introduces the Bash Directory Stack: Quick Reference The Bash Directory Stack is FILO (First In, Last Out) pushd /some/dir/path push pwd to stack and change to new directory dirs list stack dirs -V list stack vertical with index popd change directory to directory at position 1 in stack pushd +n change directory to “n” indexed directory actually a rotate also accepts “-n” popd +n remove indexed item from stack also accepts “-n” dirs -c clear stack

Read More »

nodejs Install Via NVM On Shared Hosting

Node can be installed on a shared hosting account if you have SSH but no root access. Using Node Version Manager (NVM) makes it easy to install and manage different node versions. Here’s the NVM project page: https://github.com/creationix/nvm To install get the curl or wget command from here: https://github.com/creationix/nvm#install-script Will be something like:

The install may advise you to create or update your .bash_profile with something like:

Immediately after install you may need to run:

Now you can use NVM to: List available node version:

Install node version:

List locally installed version:

Use node version:

Set the default version:

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.