Compdigitec Labs

Archive for August, 2008

DOMNodeList as an Array

Sunday, August 31st, 2008

When using getElementsByTagName, it returns a DOMNodeList which you can use with foreach, but you can’t use array indexes to access elements. For example, you can use the following code to the contents of the first “test” tag: <?php $file = ‘z.xml’; $xmlfile = new DOMDocument(); @$xmlfile->load($file); $iplist = $xmlfile->getElementsByTagName(‘test’); $i = 0; foreach($iplist as $v) { […]

The “Gtk-CRITICAL gtk_text_buffer_emit_insert assertion” warning in PHP-GTK2

Saturday, August 30th, 2008

If your internationalized PHP-GTK2 apps have ever failed to work, you probably received the following message in the terminal before: Gtk-CRITICAL **: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)’ failed This means that you have been using or passing non-UTF8 (good chance that it is CP1252 on Windows) strings to PHP-GTK2 classes and methods, such as […]

WordPress author email blacklist patch

Friday, August 29th, 2008

If you’ve ever needed to block a single comment spammer using multiple IPs, referrers and urls, but the same email, here’s a patch for WordPress 2.5. This patch is released under the GNU General Public License. Add the following code to wp-comments-post.php after the line “$comment_content      = trim($_POST['comment']);” (line 30 on v2.5): // ****** Start of comment email patch by Compdigitec ****** $name = […]

Geany - the ultimate IDE for programming

Thursday, August 28th, 2008

Geany (Wikipedia article) is one of the best open source, multi-platform (supports Windows, Linux, Mac and BSD) and multi-language IDE/text editors. It also supports a selection of development commands and supports lots of languages/formats (see note 1). It also supports some unusual file formats such as Makefiles, ini files and SQL files. Installing/Upgrading Geany (Ubuntu+Debian) […]

Binaries for rarcrack 0.2

Wednesday, August 27th, 2008

Update (2009-01-24): You may have been looking for the Windows binaries. Rarcrack is a lightweight and powerful tool for cracking lost or forgotten RAR passwords. However, (again), there is no already made package, so here is one premade for you. Download: .deb for Debian and Ubuntu (version 0.2, 33KB) Download: .rpm for Red Hat or […]

Latest comment spammers on Compdigitec Labs

Monday, August 25th, 2008

A list of recent comment spammers for you to check IPs against. Note that the actual comment or the link spammed is not provided because it either may be copyright violation or the sites may be harmful or is an bad exploit website. IP 142.32.208.234 using email d62s_test469@hotmail.com. Spammed on 2008-08-17 21:16:21 GMT. Spam consisted […]

Aliases for common command line typos

Sunday, August 24th, 2008

Update (2008-08-25): Lists complete and ready for download. Update (2008-08-24): The list may take some time to compile, so downloads may not be available until August 25. Are you tired from “bash: somethinghere: command not found” errors that happen when you type something like vf instead of cd, or cla instead of cls (alias for […]

Manipulating symbolic and hard links on Linux and Windows

Saturday, August 23rd, 2008

Symbolic and hard links are a very convenient feature of the Linux and UNIX operating systems - they enable you to create a short alias, use it to avoid duplicate data and much, much more. They are also availible on Windows to a limited extent - NTFS supports only hard links while FAT/FAT32/VFAT supports neither. […]

Changing the user agent of PHP

Wednesday, August 20th, 2008

If you ever need to adjust or change the default user agent that PHP accesses pages with (http and ftp wrappers) because either the default PHP user agent was blocked (“PHP”) or you wrote a bot with PHP and wish to customize it, you can do so easily with a php directive called “user_agent”. Note […]

Compiling re2c 0.13.5 on Ubuntu 8.04+ (binaries available)

Tuesday, August 19th, 2008

If you need the latest features of the re2c compiler, you would normally sudo apt-get install re2c to install the re2c compiler. However, the Ubuntu packaging team (again) has not updated their re2c package to the latest re2c v0.13.5, so here are some pre-compiled re2c binaries. Be sure to remove the official version in the […]

« Previous Entries