Category: Scripting

How-to Cut With Multi-Character Delimiter

The “cut” command is great for splitting a string on a single character and extracting specific fields. But it will not work with multi-character delimiters. Here’s a simple replacement using awk that will get the job done. Let’s assume you

Read More »

Cronjob for ClamAV

ClamAV can be useful for things like scanning a web root for viruses. Use this handy script with a cron job to setup nightly scans that send an email report.

Follow the directions on the site to install. We’ve

Read More »

Plesk 11.5 with Multiple PHP Versions

The latest version of Plesk support multiple PHP versions. The user or admin can select the version from the control panel. Once you have the PHP versions installed use  the /usr/local/psa/bin/php_handler utility to inform Plesk. for example:

Also here’s an article

Read More »

Copy Files & Create Missing Directories

I needed to find all the image files in a large directory tree and then copy them to a new directory tree while preserving the directory structure. Here’s my solution: 1. Find the files and save list to a file:

Read More »

Local File Inclusion Attacks

We’ve seen several sites compromised in the last few weeks using a “local file inclusion” vulnerability with “php://input”. Here are some sample log entries: 91.224.160.25 – – [23/May/2013:12:23:54 +0000] “POST /?-d+allow_url_include%3d1+-d+auto_prepend_file%3dphp://input HTTP/1.1” 200 247 “-” “Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2

Read More »

Get a free consultation from Reliable Penguin

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