Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    Archive for the '*nix' Category

    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 »

    R under Debian testing/i386: permanently set pdfviewer option

    21st October 2009

    If you get this message when opening vignettes:

    Error in openPDF(vif) :
    getOption(‘pdfviewer’) is ”; please use ‘options(pdfviewer=…)’

    and you are tired of running this command every time:

    > options(pdfviewer=”okular”)

    then you should check if your system-wide Renviron file has proper PDF viewer set:
    Read the rest of this entry »

    Share

    Posted in *nix, how-to, Notepad, Software | No Comments »

    Convenient design and debugging of regular expressions under Linux

    10th October 2009

    redet-supported languagesRegular expressions (regexps) are powerful indeed. But debugging non-trivial regexps is a burden even if you understand how regexps work, and remember most (if not all) regexp syntax.

    Miscellaneous tools exist to ease this task. This post was inspired by redet’s comparison of regexp helper tools – it could be sufficient to read only that, if you’re going to try the mentioned tools yourself. Otherwise, read on.
    Read the rest of this entry »

    Share

    Posted in *nix, Notepad, Programming, Software | No Comments »

    IOMMU: This costs you 64 MB of RAM

    30th September 2009

    If you have happened to observe similar messages in your dmesg:

    aperture

    [ 0.004000] Checking aperture…
    [ 0.004000] No AGP bridge found
    [ 0.004000] Node 0: aperture @ 20000000 size 32 MB
    [ 0.004000] Aperture pointing to e820 RAM. Ignoring.
    [ 0.004000] Your BIOS doesn’t leave a aperture memory hole
    [ 0.004000] Please enable the IOMMU option in the BIOS setup
    [ 0.004000] This costs you 64 MB of RAM
    [ 0.004000] Mapping aperture over 65536 KB of RAM @ 20000000

    and you are using AMD-based system w/o AGP video, then my advice is: just leave that as is, do not bother “improving”! Any tinkering with kernel boot options won’t do you any good, as the kernel has already done the best it could.

    Just a note: all those messages at the top of the post should only happen if you have 4 or more GiBs of RAM. If you have less than that, and do have those messages – my experience might be inappropriate for your case.

    Another note: my BIOS does not have any IOMMU settings (or “Memory hole remapping” settings), so I didn’t try that. You should check if your BIOS has IOMMU-related options first, just as kernel message suggests.

    Read on for details.
    Read the rest of this entry »

    Share

    Posted in *nix, how-to | No Comments »

    Screem HTML editor dies with ‘GSlice: assertion failed: sinfo->n_allocated > 0′

    20th August 2009

    Screem HTML/XML editor has tag-specific auto-complete, and is a nice editor for web-developers (at least as long as Quanta is not available for Debian testing).

    However, version 0.16.1 is very unstable, and dies with

    ***MEMORY-ERROR***: screem[5527]: GSlice: assertion failed: sinfo->n_allocated > 0

    As a workaround (initially suggested for the highly similar Firestarter crashes), try running screem with this command:

    G_SLICE=always-malloc screem

    Too bad last development version of Screem is dated March 2006.

    Share

    Posted in *nix, Software, XHTML/CSS | No Comments »

    Bad memory handling and server stability

    13th July 2009

    The two graphs below (clickable) are for CPU and RAM use during a period of a program going wild between 23:17 and 23:41 (24+ minutes of server’s downtime). The program was run non-root, it just consumed all the memory it could. It was killed by kernel, so the server started responding without any interventions – which were hard to perform, because none of the services (including ssh) were responding during downtime.
    cpugraph
    memgraph

    If you happen to be developing a C/C++ program – do use mtrace and valgrind, those are huge helpers against the problems akin to that shown on the graphs.

    Share

    Posted in *nix, Programming, Software | No Comments »

    Harness the power of rsync

    6th July 2009

    I have read manpages of rsync today.
    I feel enlightened.

    I had a dream of rsync being one of the legendary nix Super-Cows.

    A tiny perversive part of self created a PDF version of rsync manpages (43 pages).

    It seems that Super-Cows can damage the brain, when stared at too intensely.

    Share

    Posted in *nix | 4 Comments »