Sunday, May 23, 2010

How to get Flash on Froyo on the Nexus One

First of all you need to upgrade to Android 2.2 Froyo. Follow the guide at http://nexus404.com/Blog/2010/05/22/google-nexus-one-android-froyo-official-installation-instructions-android-froyo-almost-ready-for-your-nexus-one-you-can-install-it-alone-here’s-how/.

Next, you would think Flash was installed out of the box. It is not. To install it go to the Market, search for flash and select "Flash Player 10.1 BETA" (with an Adobe 'f' icon). Install this. Now you should be able to view flash content in your browser.

Solution found at: http://www.sizzledcore.com/2010/05/23/flash-player-10-1-beta-for-android-2-2/

Wednesday, May 5, 2010

Preventing web vulnerabilities

Two nice sites to check out when working with public web pages are:
http://jarlsberg.appspot.com/
and
http://ha.ckers.org/xss.html

Both are useful for learning about how your webpage can be exploited and how to prevent it.

Postscript delegate failed for ImageMagick PHP library

For ImageMagick in PHP through the library Imagick the following error may occur for versions ImageMagick-6.3.5 to ImageMagick-6.4.2:
Postscript delegate failed `': No such file or directory

This is a bug and the error appears when one is trying to use the readimageblob function to read a PDF file.

The fix has been posted and the bug is no longer present. See http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=11989. So to fix it get the latest release from http://www.imagemagick.org/.

Some installations (like server environments), haven't got the latest version and cannot install it. For these, it is possible to work around this bug, by using a temp file.

So instead of:
$im = new Imagick();
$im->readimageblob($data);


Use:
$im = new Imagick();
$temp = tmpfile();
fwrite($temp, $data);
fseek($temp, 0);
$im->readimagefile($temp);
fclose($temp);


(This would typically be followed by for example:
$im->setImageFormat("png");
$data = $im->getimageblob();
)

Sources: http://markmail.org/message/6mg3lxi26gd5fluv#query:readimageblob%20Postscript%20delegate%20failed+page:1+mid:6mg3lxi26gd5fluv+state:results

If this doesn't fix it for you, also check out: http://stackoverflow.com/questions/588918/imagemagick-imagick-convert-pdf-to-jpg-using-native-php-api

Saturday, May 1, 2010

Setting Ubuntu menu item icon

Every tried setting the icon for a menu item on the Ubuntu start menu and discover that ubuntu can't find your icon files?

First of all, to get to the place where you change the icon:
Right click 'Applications' menu on the taskbar -> select 'Edit Menus' -> find your menu item in the list -> click 'Properties' -> click the current icon

When you select Browse... and go to the directory where your icons are located it doesn't show any files there. The key is to press Open when you are in the directory where the files should be. A new window will open showing the files that can be used as icons.

"The image files must be one of the types: PNG, XPM, or SVG, and the extension must be ".png", ".xpm", or ".svg" (lower case)." Source: http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-0.6.html