Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    fail2ban and Google translate: how to easily cut your WP blog traffic

    14th November 2009

    translate_logofail2ban has a php-url-fopen rule.

    WordPress has a Global Translator plugin, which – among others – uses Google Translate service.

    If someone uses Google Translate (e.g. using Global Translate’s mini-language-flags), and goes back to your blog – that someone might get banned by fail2ban (especially if you have set maxretry to 1), as the referrer will contain the php-URL-fopen attack signature. The bad thing is that you will not realize that until after you check one or several translations yourself, as a random site visitor experiencing the problem is highly unlikely to bother reporting this problem – especially when your blog’s Contact page is also inaccessible.

    Clearly, Google Translate is not the only legitimate service which will trigger that rule.

    Solution: The only solution I have found is to specify the whitelist regex for the php-URL-fopen rule.

    Share

    Posted in *nix, Software, Web, WP PlugIns | No Comments »

    Google barcode day: make one for your site/blog

    7th October 2009

    bogdan.org.ua barcode Today Google celebrates the invention of the barcode.

    To help in this celebration, you can make a barcode with your site’s address (there is at least one more at barcodesinc, but at the moment of writing it is painfully slow).

    I find these parameters nearly optimal:

    • Type: Code 128-B
    • Styles: Draw value text
    • Size: 234×60 (half-banner size)
    • Xres: 1
    • Text font: 5
    • Value: bogdan.org.ua :)

    If you wish, you can also exactly replicate today’s Google logo – which says “Google”, as you could have guessed.

    You can place this barcode on your “souvenirs” – pens, cups, t-shirts. Many phones now have barcode scanners (e.g. Nokia E71), so put this code onto your namecard.

    Read on to learn about matrix barcodes.
    Read the rest of this entry »

    Share

    Posted in Links, Misc, Software, Web | 1 Comment »

    My readers are natural-born workaholics

    12th June 2009

    Here’s the ultimate proof :) :

    visitors

    One can clearly see that on weekends the number of unique visitors of my blog drops drastically to about 40-50% of the working week average.

    And yes, that is an almost perfect 5+2 pattern, which I’m observing for many months, like a week-long circadian rhythm. “Almost perfect” must be due to the differences in time zones.

    I wonder if the same pattern is characteristic for most web-sites… That is, if people mostly do the browsing at work, and not at home.

    Anybody wants to share the secret cycles of one’s blog audience?

    Share

    Posted in Misc, Web | 2 Comments »

    Blog accessibility from handheld and mobile devices

    26th December 2008

    I’ve seen someone reading my blog from a 320×240 handheld device, and realized that it must be pretty inconvenient. Testing my blog with the help of ready.mobi confirmed my worst expectations with a mobile-readiness score of 1.

    I’ve installed and then tested one-by-one a series of WP plugins designed to make your blog mobile-accessible. Testing was done using ready.mobi; all plugins were using default settings – except for viewMobile, which had Images option set to Resize, not Keep As Is.

    pluginscoresize (KiB)min cost (EUR)max cost (EUR)best speed (sec)worst speed (sec)passeswarningsfails
    mowser plugin3.573.420.010.061.012.832114
    viewMobile3.4823.380.070.401.057.672033
    PDA & iPhone2.2324.650.070.421.057.971844
    MobilePress1.7453.980.160.921.1115.081943
    no plugin0.92820.854.801.5570.410610
    Mobilize by MippinN/AN/AN/AN/AN/AN/AN/AN/AN/A

    On Mobilize by Mippin plugin ready.mobi exited with error “Could not retrieve page content”, which is no wonder as Mippin plugin redirects the handheld device’s browser to mippin.com, which converts the page into mobile-accessible form (however, it is indeed strange that mowser.com plugin worked fine, though it is also a redirector). I’ve used mippinmaker to estimate what would my blog look like via mippin – and it appears to me that mippin is using my RSS as the source of content; actually, plugin description explicitly states that. I’m sure this would get real high scores on ready.mobi, but I can’t find the way to test that; thus Mippin plugin didn’t participate in the final feature-based comparison.

    viewMobile plugin is a clear winner best by score in “plugins” group – it has the highest scores in the feature table (well, after mowser plugin, which is not a plugin but a redirector to an external service). Also, in addition to “keep as is” and “downsample”, there is an option to “strip” images – I presume that would bring the page size further down. However, viewMobile removes comment forms from posts; at the same time, PDA & iPhone plugin preserves comment forms – thus it is better for my purposes.

    The mowser-based service has even higher scores than viewMobile – but is an external dependency. For my blog, I decided to stick to PDA & iPhone plugin. Also, such a low page size (see table) is due to mowser splitting the tested main blog page into two pages – and ready.mobi then only weighs the first (much smaller) page; so there is no benefit in page size when using mowser.

    Please comment to share your experience of turning your blog mobile-accessible, or of reading my blog from handheld/mobile devices.

    P.S. If you are used to visiting websites and blogs from your handheld device, and those sites/blogs are not optimized for mobile devices, I’d recommend using the free mowser service (though Opera Mini is easier, I guess).

    P.P.S. This post wasn’t sponsored by mowser or any other mentioned services :)

    Important update: clearly, viewMobile and any other PHP-level mobile accessibility plugins are incompatible with SuperCache. So either (super) caching, or mobile version – but not both. I’ll have to look into possible solutions.

    Update 2

    A “clever” solution would be to have a subdomain or even a different TLD domain for the mobile version of the blog (to avoid SuperCache interference – ideally, both database and files would be the same, but some tiny bit of configuration would make all the difference; the easiest tiny bit would be a mod_rewrite rule). Another good solution would be to modify SuperCache’s mod_rewrite rules, so that mobile User-Agents aren’t fed cached versions – and thus viewMobile has a chance to trigger and serve correct version (this solution doesn’t require another domain or subdomain, but is less reliable).

    I’ve tried mowser plugin, but it suffers from the same cache interference problem (because it is also PHP-level, and SuperCache works at apache and mod_rewrite level). For the same reason, PDA & iPhone plugin wouldn’t work as well.

    For now, I’ve disabled SuperCache (leaving WPCache on), and turned on PDA & iPhone plugin (unlike viewMobile, it does show the comments form below each post). Seems working. Will look into domain/mod_rewrite solutions.

    Update 3

    SuperCache is back on, except for a list of mobile User-Agents; those User-Agents were also added to SuperCache’s UA exclude list. Thus now if a “normal” browser requests a page, such a request is cached, or a cached page is fed to the browser. If the mobile browser requests a page, it is not fed a cached page even if one exists, and cache page is not created while running WP’s PHP engine. Tested using both built-in browser (I could even fill in captcha while commenting) and Opera Mini on a Samsung phone: seems to work fine. However, all of ready.mobi’s phone emulators for some reason choked on the comment form’s textarea, refusing to display the page. I ignore this but if compliance is important then viewMobile will be a better choice than PDA & iPhone.

    Drawbacks of this solution: 1) mobile requests are not cached, 2) if the mobile browser’s User-Agent is not in the list, then it will be fed a standard-looking page, 3) hard to maintain – need to update both the list of UAs in .htaccess and in the configuration of SuperCache.

    Better solutions are welcome.

    Share

    Posted in how-to, Web, WP PlugIns | No Comments »

    Need a computer science paper? Try SCIgen!

    9th December 2007

    Quite an entertaining story:
    SCIgen at wikipedia
    SCIgen tool
    SCIgen blog

    Finally, just a useful resource if you need a shiny name for your brand-new 2.0-beta project: anagram server.

    Share

    Posted in Humour, Links, Science | 1 Comment »