How many CQ5 concurrent users?

Defining the concept of concurrent user in the web world is difficult and it’s even more difficult to do it in CQ as it doesn’t keep any session informantion. Technically speaking I define two users as concurrent when a request from user A has not finished yet that the one from B starts.

Don’t know if it’s possible to achieve such information just by looking at CQ logs but the analyse-access tool help you in the analysis of the access.log files that CQ produces giving you some numbers in a very handy markdown format that can be then converted to PDF for presenting it to the business.

References:

[bash] format date

It happens often a script I have the needs to append a simple timestamp in the format of YYYYMMDDHHMMSS to a generated file.

It’s very easy to get it to work in pure bash, without perl script and similia. Just use the native date command with his format option. Easy as drinking a glass of water, the command is (for the format above)

$ date +”%Y%m%d%H%M%S”

for the full detail of the format arguments, refer to the man page.

A simple usage in script is

#!/bin/bash
set -e

NOW=`date +”%Y%m%d%H%M%S”`
FILE=my-cool-file-${NOW}.txt

echo $FILE

[Script-Fu] case sensitive file-glob

Let’s talk again about script-fu. file-glob is a beautiful function that retrieve all the files within a specified directory with the specified pattern. But if you have to deal with case sensitive file system, soon or late you’ll bump in the problem that *.jpg is different from *.JPG.

In order to solve this it’s enough to think about regular expression. Yes, it seems that file-glob make use of regular expression for file pattern matching. So if you, for example, have a patter like /home/edivad/img/*.jpg and want a case insensitive matching you can use a pattern like /home/edivad/img/*.[jJ][pP][gG].

[Script-Fu] portfolio

I did it again. For the photo training I’m attempting to, I need to show at the final year test a portfolio for the reportage subject.

I have to show 30 photos paged in a portfolio. So in order to speed up the pagination work, I did a gimp script.

This will process the opened image and generate a new file with the paginated photo and a caption.

Here is the code; pdf as usual damn wordpress.

Again, I’m not proof in script-fu so if you encounter something wrong or that can be done better, use the comments 🙂