Category: Bash Scripting

“One-liner” To Change Plesk Admin Port

Here’s a Bash one-liner to change the Plesk admin port:

Replace XXXX with the desired port number. Explanation sed -i ‘s/listen 8443 ssl;/listen 8444 ssl;/’ /etc/sw-cp-server/conf.d/plesk.conf Searches for listen 8443 ssl; in the configuration file and replaces it with listen 8444 ssl;. sudo systemctl restart sw-cp-server Restarts the Plesk control panel server to apply the new port configuration.            

Read More »

Find Sites With Most Requests In Logs

Find top sites by requests over a time period:

Replace “DD/MMM/YYYY:HH:MM” with desired period like “01/Aug/2024:15”.  

Read More »

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 »

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 »

Categories

Get a free consultation from Reliable Penguin

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