Compdigitec Labs

Firefox 3 on Windows 7 undocumented key combo

By admin | August 16, 2009

When using Firefox 3 on Windows 7, you may find that sometimes Firefox randomly converts some of your keystrokes into different keys. However, this has not yet been experienced on any other program on Windows 7 or Firefox on a different operating system. For example some of the keys that are “randomly translated” include:

Regular alphanumeric characters and the number pad to the right of the regular keyboard do not seem to be affected apart from the above mentioned ones. A current working workaround would be to press the Shift-Alt combination, which changes those characters back to their regular combos for a while. Currently, the only true workaround is to restart Firefox.

This problem may or may not affect you, as it has only been reproduced with Firefox 3 on Windows 7 and on no other browser, application or operating system.

If you found this article helpful or useful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful or interesting articles!

Topics: Windows | 10 Comments »

Converting AVI videos to animated GIF images

By admin | August 12, 2009

AVI is one of the many video formats out there, but what if you only want to show the picture portion of the clip and not the sound? By converting the AVI to a GIF clip, it can not only be distributed on the Internet easier and quicker and doesn’t require a media player to be installed. This is achieved thanks to a small freeware program called Movies 13 which is a GIF animator that allows for conversion from AVI to GIF.

Instructions

  1. Download Movies 13 and install it.
  2. Run Movies 13 and go to Tools >> AVI to GIF converter.
  3. Click the “Open AVI” button and select the AVI you wish to convert.
  4. Then click the “Convert” button.
  5. To save the file, click the “Save GIF” button.
Movies 13

Movies 13

If you found this article helpful or useful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful or interesting articles!

Topics: Windows | 5 Comments »

KeePass password safe for Linux

By admin | August 7, 2009

Update (2013-06-26): Updated for KeePass 2.22.

KeePass password safe is an effective way to manage your passwords securely and safely without writing them down in text files. However, the current Linux-native port KeePassX is still in development and not quite usable. Here is a port of KeePass 2.x (“Professional Edition”) to Linux without changing anything. This is done with the runtime of the Mono Project, which allows for execution of .NET executables in non-Windows operating systems such as Linux.

Requirements

Installation

  1. Download the Linux package of KeePass (alternate download if first one doesn’t work).
  2. Install it (either double click on the downloaded package or run in a terminal in the same folder that you downloaded the package to sudo dpkg –install keepass-2.22.deb)
  3. To run, go to Applications >> Accessories or run keepass from the command line.

Screenshots

KeePass 2.08 running under Ubuntu Linux

KeePass menu entry

KeePass notification area icon

Topics: Linux | 8 Comments »

Solving svn: /opt/lampp/lib/libcrypto.so.0.9.8: no version information available

By admin | August 4, 2009

If you are using WebSVN with XAMPP for Linux, you may find that when you try to invoke the svn binary, an error will occur when you try to browse a repository.

/usr/bin/svn: /opt/lampp/lib/libcrypto.so.0.9.8: no version information available

/usr/bin/svn: /opt/lampp/lib/libcrypto.so.0.9.8: no version information available

This error arises as a result of Apachefriends’ decision to strip all statically linked libraries’ symbols (debugging and version). As a result, when another library on the system (like here, here, here, here and even here), even if invoked from another program,which in this case happens to be svn, attempts to load symbols from the “stripped” library, they are not able to find it and throw an error. This error does not occur if executed outside the web server because the default shell PATHs are different.

Note that the following instructions will only work if you have access to non-stripped versions of libcrypto and libssl (openssl). If you need a place to look, a good place would be Ubuntu Packages.

Instructions

  1. You need to make sure you have shell access to the server in question. Open a shell on the server and navigate to /opt/lampp/lib. (cd /opt/lampp/lib)
  2. Move aside the static libcrypto.so.0.9.8 (sudo mv libcrypto.so.0.9.8 libcrypto.so.0.9.8.bak).
  3. Similarly to above, move aside the static libssl.so.0.9.8 (sudo mv libssl.so.0.9.8 libssl.so.0.9.8.bak).
  4. Link the unstripped libcrypto.so.0.9.8 to replace the moved libcrypto (sudo ln -s /usr/lib/libcrypto.so.0.9.8 ./)
  5. Copy the unstripped libssl.so.0.9.8 to replace the moved libssl (sudo ln -s /usr/lib/libssl.so.0.9.8 ./)
  6. Reboot the XAMPP Apache server (sudo /opt/lampp/lampp restart)

If you found this article helpful or useful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful or interesting articles!

Topics: Linux | 8 Comments »

MySQL Query Browser – a standalone MySQL administration tool

By admin | August 3, 2009

Online MySQL administration tools such as phpMyAdmin are great for administering MySQL databases, but unfortunately it is not so great if you work with large databases or have to mass manipulate records. By using an offline MySQL administration tool, you can remove the overhead of the HTTP(S), (X)HTML and the web browser by communicating directly with your database. MySQL Query Browser is an official tool developed by MySQL AB and Sun Microsystems in order to adminster MySQL databases remotely. It is usually faster that using something like phpMyAdmin because it does not have a “browser overhead” unlike other server-run tools. It is also official and supported by the developers of MySQL meaning that it will always be compatible with MySQL, which third-party products tend to lack. A disadvantage of MySQL Query Browser is that is requires the database to listen on the network.

MySQL Query Browser running on Ubuntu

MySQL Query Browser running on Ubuntu

Installation

If you found this article helpful or useful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful or interesting articles!

Topics: Linux, Windows | 7 Comments »

Solving “Fatal error: Exception thrown without a stack frame in Unknown on line 0”

By admin | August 2, 2009

If you attempt to throw an exception from a PHP destructor or an PHP exception handler, your script will execute fine for the most part and then crash with the rather cryptic error message, “Fatal error: Exception thrown without a stack frame in Unknown on line 0“. This message is unfortunately very cryptic if you are trying to debug your code. This effect is further amplified due to a lack of PHP debuggers and you must instead resort to using various print_r()s and var_dump()s in order to debug the program. The error message in basic form means that you’ve thrown an exception where an exception cannot be thrown (leading to “no stack frame” – exception handlers and destructors do not have a stack frame. This instead results in this rather cryptic error message that does not include script locations or detailed error information).

Most often, the error will appear if you use an exception handler combined with an error reporting to exception handler by converting it to an ErrorException, then there a suddenly a whole new magnitude of ways to throw errors within the exception handle, especially if E_NOTICE, E_STRICT and/or E_WARNING errors are converted. This form most often occurs when you use variables without first initializing them. This error may be preventable by wrapping the exception handler within a try/catch block.

A second form of this error occurs when you attempt to throw an exception in a destructor. This is well documented in the PHP manual, but this can still be triggered if you accidentally throw an exception:

There is no exactly solid way to identify this type of error as you may not know exactly what your functions do. If you are throwing exceptions manually in your destructor, you need to go back to the PHP manually and read that it is not possible to throw exceptions within the destructor (as it lacks a stack frame). For the other two, you may need to comment out your destructors and manually uncomment parts until you reach the point where you find the error line as the error message produced by PHP is not too informative.

Topics: PHP | 4 Comments »

Disable WordPress conversion of double-dashes in posts

By admin | July 24, 2009

Update (2014-08-09): Still works for WordPress 3.9.2.

Update (2013-11-16): Still works for WordPress 3.7.1.

Update (2012-07-26): Updated for WordPress 3.4.1.

Update (2012-02-03): Updated for WordPress 3.3.1.

Update (2011-08-21): Updated for WordPress 3.2.1.

Update (2009-08-16): Updated for WordPress 2.8.3.

If you use WordPress (like this blog and many hundreds and thousands of blogs) for your blogging engine and you attempt to post code or programming related posts, you may find that WordPress will mess up your code. This was pointed out to us by a commenter on the aforementioned page. Out of the side, the guide at Tech-Recepies will not work as the mentioned line of code no longer exists in WordPress.

This guide has been tested with WordPress 2.7.1, 2.8.3, 3.3.1, 3.4.1, 3.5, 3.7.1, and 3.9.2 (latest).

WordPress 3.9.2, 3.7.1, 3.5, and 3.4.1
Apply this diff to wp-includes/formatting.php like so:

patch formatting.php formatting.diff

Manual patching: replace lines 73 and 74 of “wp-includes/formatting.php” with these two lines:

		$static_characters = array_merge( array( /*'---', ' -- ', '--', ' - ', 'xn–',*/ '...', '``', '\'\'', ' (tm)' ), $cockney );
		$static_replacements = array_merge( array( /*$em_dash, ' ' . $em_dash . ' ', $en_dash, ' ' . $en_dash . ' ', 'xn--', */'…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace );

WordPress 3.3.1
Apply this diff to wp-includes/formatting.php like so:

patch formatting.php formatting.diff

Manual patching: replace lines 56 and 57 of “wp-includes/formatting.php” with these two lines:

		$static_characters = array_merge( array(/*'---', ' -- ', '--', ' - ', 'xn–',*/ '...', '``', '\'\'', ' (tm)'), $cockney );
		$static_replacements = array_merge( array(/*$em_dash, ' ' . $em_dash . ' ', $en_dash, ' ' . $en_dash . ' ', 'xn--',*/ '…', $opening_quote, $closing_quote, ' ™'), $cockneyreplace );

WordPress 3.2.1
You can apply this diff to wp-includes/formatting.php like so:

patch formatting.php formatting.diff

Or you can patch it manually with the following directions:

  1. Download <blog path here>/wp-includes/formatting.php from your webserver (using something like FTP or SSH). Don’t navigate to the page and try to use “Save Page As”, it won’t work.
  2. Open formatting.php with a text editor, preferably with the ability to navigate to specific lines (such as Geany, which also displays the line numbers beside each line).
  3. Go to line 52/53 and find this:
  4. $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'\'', ' (tm)'), $cockney);
    $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, $closing_quote, ' ™'), $cockneyreplace);
    
  5. Replace it with this:
    $static_characters = array_merge(array(/*'---', ' -- ', '--', ' - ', 'xn–',*/ '...', '``', '\'\'', ' (tm)'), $cockney);
    $static_replacements = array_merge(array(/*'—', ' — ', '–', ' – ', 'xn--',*/ '…', $opening_quote, $closing_quote, ' ™'), $cockneyreplace);
    
  6. Save and re-upload to web server.

Instructions (2.x)

  1. Download <blog path here>/wp-includes/formatting.php from your webserver (using something like FTP or SSH). Don’t navigate to the page and try to use “Save Page As”, it won’t work.
  2. Open formatting.php with a text editor, preferably with the ability to navigate to specific lines (such as Geany, which also displays the line numbers beside each line).
  3. (2.7.1 only)
  4. Navigate/browse to line 47/48 and find the following code:
  5. $static_characters = array_merge(array(‘—‘, ‘ — ‘, ‘–‘, ‘xn&#8211;’,‘…’, ‘“’, ‘\’s’, ‘\’\”, ‘ (tm)’), $cockney);
    $static_replacements = array_merge(array(‘&#8212;’, ‘ &#8212; ‘, ‘&#8211;’, ‘xn--‘,‘&#8230;’, ‘&#8220;’, ‘&#8217;s’, ‘&#8221;’, ‘ &#8482;’), $cockneyreplace);
  6. (2.8.3 only)
  7. Browse to line 55/56 and find the following code:

  8. $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn&#8211;', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
    $static_replacements = array_merge(array('&#8212;', ' &#8212; ', '&#8211;', ' &#8211; ', 'xn--', '&#8230;', $opening_quote, '&#8217;s', $closing_quote, ' &#8482;'), $cockneyreplace);


  9. (end version specific instructions)
  10. Once you have found the aforementioned lines of code, comment out the first four items in each array. In short, replace the above two lines with:
  11. (2.7.1 only)
  12. $static_characters = array_merge(array(/*’—‘, ‘ — ‘, ‘–‘, ‘xn&#8211;’,*/‘…’, ‘“’, ‘\’s’, ‘\’\”, ‘ (tm)’), $cockney);
    $static_replacements = array_merge(array(/*’&#8212;’, ‘ &#8212; ‘, ‘&#8211;’, ‘xn--‘,*/‘&#8230;’, ‘&#8220;’, ‘&#8217;s’, ‘&#8221;’, ‘ &#8482;’), $cockneyreplace);
  13. 2.8.3 only

  14. $static_characters = array_merge(array(/*'---', ' -- ', '--', ' - ', 'xn&#8211;',*/ '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
    $static_replacements = array_merge(array(/*'&#8212;', ' &#8212; ', '&#8211;', ' &#8211; ', 'xn--',*/ '&#8230;', $opening_quote, '&#8217;s', $closing_quote, ' &#8482;'), $cockneyreplace);


  15. (end version specific instructions)
  16. Save the file and re-upload to take effect.

Topics: (X)HTML, Internet | 11 Comments »

Installing sound drivers for VirtualBox sound in Windows 7

By admin | July 21, 2009

Even with the latest version of Windows 7 and VirtualBox 3.0 available, there is no sound drivers for the emulated sound card bundled, unlike Windows XP. To enable sound in Windows 7 under VirtualBox it is needed to install the drivers for the sound card.

Instructions

  1. Navigate to Realtek’s website and download the first item (Vista/Win7 (32/64 bits) Driver only (ZIP file)).
  2. Unzip the package into a temporary directory.
  3. Run setup.exe in the temporary directory.
  4. Click “Next”.
  5. After it displays “Begin to install/update AC’97 drives”, several popup windows by Windows will appear complaining about the verifier of the driver. Click “Install this device driver software anyway”.
  6. After a while Setup will, complete. Restart if you want.

Screenshots

AC'97 SetupWindows Device Driver WarningInstalling AC97 drivers

If you found this article helpful or useful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful or interesting articles!

Topics: Windows | 32 Comments »

Using (X)HTML entities in plain XML files

By admin | July 14, 2009

Update (2009-07-28): Here is a place that you can find accents for English characters.

If you try to use non-ASCII characters (e.g. accents) in directly in a Windows-1252 (ISO-8859-1) encoded web page directly without converting/transforming them into an entity, the web browser may get confused when the header of the web page is sent wrong or is misunderstood, resulting in garbled accents and even possibly mojibake.

The correct way to embed those into a web page are to use the corresponding (X)HTML entities such as &ecirc; for the ê accent. But if you try to load a string from a XML file into a web page (as many PHP scripts do nowadays), you will encounter a nasty error informing you that the entity was not defined (e.g. parser error : Entity ‘eacute’ not defined). To remedy this, in the XML file instead of the direct entity replace the ampersand (&) in the entity with its entity version. This may sound confusing at first but after a while it starts to make sense.

  • XML file display = &amp;ecirc;
  • HTML source display = &ecirc;
  • Browser display = ê

If you found this article helpful or useful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful or interesting articles!

Topics: (X)HTML | 9 Comments »

Dynamically upgrade LiveCD packages

By admin | July 10, 2009

If you attempt to follow APCMAG’s dual boot tutorial with an older version of the Ubuntu Live CD, you may unknowingly install an old version of GRUB. This is fine if yournewer Ubuntu installation uses paritions that an older version of GRUB will recognize, but with new partitions like ext4 the old Ubuntu Live CD may cause problems.

Old Ubuntu Live CD

In orderto solve this problem, you need to dynamically upgrade the packages on your Live CD. However, you do not need to butn a new version of the CD or modify the CD. This is because a “LiveCD system” is just really a regular Ubuntu system loaded onto a CD and memory and then booted from. Note that upgraded LiveCD packages only last the current session – they are eased from memory after a restart.

  1. Boot the Live CD (or make sure you are in the Live CD environment).
  2. Open a terminal.
  3. Type in “sed ‘s/cdversion/newversion/’ /etc/apt/sources.list > /tmp/sources.list“. (Replace cdversion with the codename of the Ubuntu CD – e.g. hardy) (Replace newversion with the codename of the version of the packages you want to upgrade to – typically the latest Ubuntu version – e.g. jaunty)
  4. Type in “sudo /bin/cp /tmp/sources.list /etc/apt/sources.list
    ” No password is required.
  5. Type in “sudo apt-get update” to update packages.
  6. Now you can upgrade whatever packages you want to upgrade. For example, to upgrade GRUB, type in “sudo apt-get install grub“. To upgrade GParted, type in “sudo apt-get install gparted“. Simply replace “grub” or “gparted” with the package you want to upgrade.

Topics: Linux | 15 Comments »

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles! « Older Entries Newer Entries »