wordpress blog stats monitoring from remote using curl and bash and send it in mail.

Here\’s something that I had been planning to do for sometime now. I have my blog on wordpress and have Statpress plugin installed. The plugin does give me a good idea of the visits to my site. Now, I have to keep logging in every now and then to check the stats. Also since I did not want to spend some more amount 🙂 so I do not have the shell access to the server, too bad 🙁

But I want to monitor the stats of my site. So I was looking for options and to see if I could get it from my desktop and mail that to myself :). This would be pretty neat to do.

Problem: I cannot access the page without logging in.

Ah, problems is what makes Linux worth using. I know for quite sometime now that curl can be used with cookies and to submit forms and can really do a lot of things but had never tried it. So I spent the night searching for some docs and examples of curl and finally managed to do what I had to do 🙂


1) From the shell script get the web-page of the statpress

2) mail the web page.

3) Put it in cron.

How to do it:

First use curl with cookies and post data to get to the page. This might take some time depending on your requirement. But here\’s what I needed:

curl -v -b ~/cookies.txt -c ~/cookies.txt -d \’username=raj&password=raj\’ \”http://blog.amit-agarwal.co.in/admin.php?page=statpresscn/statpresscn.php\” > /tmp/ak.html

Here, the -b and -c, options sets the cookies that will be used intially and the update cookie file. and then -d is used to submit the form with the parameters that you require: username and password. For the security of my website, I have changed the data above, but you can get the parameter name by runnig the curl command once on your site. You will see the login page with the name and id of the boxes for username and password.

And then finally we have the URL to fetch with the redirection to desired file.

So to put it all together. Here\’s the script to put in the /etc/cron.hourly directory:


curl -b ~/cookies.txt -c ~/cookies.txt -d \’username=raj&password=raj\’ \”http://blog.amit-agarwal.co.in/admin.php?page=statpresscn/statpresscn.php\” > /tmp/ak.html

cat /tmp/ak.html |mailx -s \”Stats for my site at `date`\” amit.agarwal@amit-agarwal.co.in

BTW, after you have got the page for the first time and you have the cookie, you don\’t need to use the username and password, if your server supports cookies. Just remove the -c and -d part and run curl to get your page.

Hope you find it useful. I found that the same approach can be used to do a lot of other stuff also. Let me see how that would go.

Update (Jan 29) :Just a couple of days after posting this, I found that Linux Joural posted a video on using curl to loging to website\’s :). Its definately with more details but Video, check it out here.

6700 free and redistributable fonts for Linux.

Today I was searching for some good fonts for my desktop running Fedora 11 – Leonidas. In my quest to find the required fonts that I would liked, I reached some good sites so just thought would share the same with you.

First, how do you use them, simple steps:

mkdir ~/.fonts

Now you can put your fonts in this directory. You can make sub-directories to keep your fonts organized. On F11, I did not need to refresh the font server or logout and login. 🙂

Now the sites:

1) Selectively download the font from the list of nearly 6800 fonts from here.

2) Download archieve of more than 6700 fonts from here.

3) You can head over here to get few more interesting fonts.

rawtherapee — raw image processor.

Image via Wikipedia

Download RT v3.0 alpha 1:


Rawtherapee is a RAW image processing software. It gives full control over many parameters to enhance the raw picture before finally exporting it to some common image format.

You can also install the version \”3.0\” from the fedora repo using the command:

sudo yum install rawtherapee

Main features :

* Selectable high performance demosaicing algorithms (EAHD and HPHD and VNG-4).
Compare them on this comparison page.
* Using DCRaw 8.82/1.398 for decoding RAW images
* Image post processing in 16 bit / channel mode
o Exposure control in RGB space
+ Auto exposure with adjustable clipping point / Exposure compensation / Shadow and highight compression / Contrast adjustment, curve editor
o White balance adjustment in RGB space
+ With in-camera, automatic and spot white balance options / Temperature/Green tint fine tuning
o Highlight Recovery
o Shadows/Highlights control in RGB space
o Basic Luminance curve tool to modify the luminance channel in CIELab color space
+ Brightness / Contrast adjustment, curve editor
o USM sharpening applied on the CIELab luminance channel
+ Classical USM parameters (Radius, Amount, Threshold) / Option to avoid noise amplification / Sharpening halo control
o Optional RL Deconvolution based sharpening for even better sharpening results
o Color shift control in CIELab color space
+ Allows color shift by shifting the CIELab \”a\” and \”b\” channels
o Color booster applied on the CIELab \”a\” and \”b\” channels
+ Amplifies color channels \”a\” and \”b\” together or separately / Avoids color overamplification in high chrominance areas / Option to avoid clipping caused by too high color boosting
o Luminance denoising algorithm applied on the CIELab luminance channel
+ Edge sensitive method to preserve as much details as possible
o Color denoising tool applied on the CIELab \”a\” and \”b\” channels
+ Classical gaussian blur or edge sensitive bluring of the color channels
o Fast switching between different postprocessing profiles
o Image flipping horizontally or vertically, rotation by 90 degrees clockwise or counter clockwise
o Arbitrary image rotation (straightening tool)
+ with fill function or automatic crop
o Simple lens distortion correction
o Crop tool
o Chromatic Aberration correction tool
o Channel Mixer for Red, Green and Blue channels
o C/A Correction
o Vignetting Correction
* ICC based color management
* Change History with bookmarks to support before/after checking
* Output options:
o Supported file formats:
+ JPEG (8 bit), PNG (8 or 16 bit), TIFF (8 or 16 bit)
o Image ouput size could be set
o EXIF data is preserved in JPEG output (except crw files)
o Output directory and automatic file naming highly customizable
* File browsing with thumbnails
* Localization supported (utf8 language file):
already included languages are: czech, deutsch, english, espanol, italian, latvian, magyar, nederlands, polish, russian, slovak, swedish

Screenshot\’s for you:

\"Rawtherapee\" \"Rawtherapee\" \"Rawtherapee\"