Author: gpanther

  • Calling variable functions in Perl

    What I’m trying to say with this title is the following: # … lets say we have a value $foo …. # … and we want to call method_1 method_2 … method_N on it foreach my $method_name (1..N) { $method_name = “method_$method_name”; my $func = *$method_name; my $result = &$func($foo); # … } The trick…

  • Working with bitstrings in PostgreSQL

    When working with short, fixed width binary data in PostgreSQL (for example: MD5/SHA1 hashes), an option to consider is the bitstring type. It has several advantages: Smaller data storage requirements (also – smaller index sizes). Storing an MD5 hash as characters representing hexadecimal numbers for example takes up 32 bytes, while storing it as bit…

  • Finding unused indexes in PostgreSQL

    First some quick DB/index design tips: When you have a 1-1 relationship, you might consider putting the data in one table, instead of several tables and linking them with foreign keys. This will speed up data retrieval considerably. This needs to be balanced with the number of cases when the given values are missing /…

  • How to verify executable digital signatures under Linux?

    The PE executable format (the one used by Windows) supports the use of digital certificates to verify the source of the file. Normally you can verify it using Windows Explorer (by right-clicking on the file and selecting Properties). It also shows up when you try to run an executable downloaded from the Internet with IE…

  • Vista and Dell woes

    I’ve completed my first ever Vista installation on a relative’s computer and I’m entirely underwhelmed. First of all, the only hardware it recognized out of the box was the soundcard (LOL). Just to clarify: I’m talking about a recent model of the Dell Inspiron laptop line here. Second of all, it failed to read the…

  • Changing jobs

    I think the proverbial cat is pretty much out of the bag now, so I might as well announce it: as of the first of November I won’t be working for BitDefender. It has been a fun three years, but I feel that it is time to go into a new direction. This will probably…

  • Link list

    The “Last in a Loop” Bug – closures are one of those tricky things. This shows a typical example for (mis-)understanding them, and how to fix it. Via ajaxian: Degrading Script Tags. Very cool, I didn’t know about this behavior. Although, I’m not really sure where you would use it? If a part of your…

  • A little entertainment

  • Viewing colored output with less

    When an output is filtered through less, the colored characters are transformed to black and white (or whatever your terminal settings are). This is because less, by default, strips away (filters out) escape sequences. These are special sequences which tell the terminal to do something special (like move the cursor, change the color and so…

  • Autorun malware

    There seems to be a lot of confusion out there about this topic, so I’ll try to provide here some high-quality technical information to help users / sysadmins out. What is autorun malware? Autorun malware is malware which uses the autorun feature present in Microsoft Windows as a way to spread itself. This might or…