Simple XSLT ifnull for numbers

Answer to question how to display zero instead of NaN in XSLT for non existing node containing number values (kind of ifnull or coallesce functions that are available in SQL). You can do it by standard expressive XSLT way, with using variable and <xsl:choose>, or abuse built-in sum() function and do whole thing in one […]

OpenVPN OCC ping patch

Hello, i’ve created simple patch for OpenVPN implementing OCC ping. Main difference of OCC ping and existing OpenVPN ping is that OCC ping is being actively replied on other side of the communication channel. This way you can configure various per-client channel reliability policies: Non-mobile clients might ping more frequently to ensure stable connection, and […]

Fixing pg_dump invalid memory alloc request size

I’ve encountered unusual problem while dumping one of the bigger PostgreSQL databases. Every try to run pg_dump resulted in this: sam@cerberus:~/backup$ pg_dump -v -c js1 >x pg_dump: Error message from server: ERROR: invalid memory alloc request size 18446744073709551613 pg_dump: The command was: COPY job.description (create_time, job_id, content, hash, last_check_time) TO stdout; pg_dump: *** aborted because […]

Monitoring disk drives via collectd

I’ve made two simple (but useful) disk drive monitoring scripts for collectd exec plugin. You can find them on This script monitors SMART attributes of given disks using smartctl (smartmontools). This one monitors some interesting values of MegaRaid adapter physical drives using MegaCli tool.   Description how to use them can be […]

log-malloc2 v0.2 released

I’ve actually released log-malloc2 library for linux, that logs calls to memory allocation functions and should be very helpful when trying to locate memory leaks. It can be used without recompiling application, simply by preloading it using LD_PRELOAD . Logged functions: malloc realloc calloc free memalign Every function callĀ  is logged with their parameters, amount […]

Oracle VARNUM/NUMBER encoding in C

Just a short example C implementation of Oracle VARNUM/NUMBER type encoding, in case you could not use library functions. I didn’t found it anywhere when needed (and afterwards I found it doesn’t helps me at all due to little ‘problem’ in ora :() and Oracle documentation is pretty unclear about how-to do it.   typedef […]

perl utf8 and using Digest functions

I’ve implemented new neat feature (to store unique content only once in cache) to my perl based etl tool and suddenly it started to print sometimes ‘Wide character in subroutine entry‘ perl warning in sha1_hex call. As if this was not enough processed content after being stored in cacheĀ  started to be utf-8 corrupted in […]

Solr Pager 0.2.2 released

Released solr_pager 0.2.2. This release fixes little bug that prevented solr_pager to work in some configurations (ie. with standard search handler). Well, Solr documentation did not mentioned that it can pass empty (null) result set to my component. Also added some sanity checks to prevent similar situation again. New version can be found on, […]

Solr Pager 0.2.1 released

Released solr_pager 0.2.1, an feature update with improved first/last page navigation. Now they appear in result only when first/last page is not visible in generated paging list. This version can be found on, for more informations about how it works see this post.