Troubleshooting Gallery2 HTTP Status 500 Internal Server Errors

If you are receiving a “HTTP Status 500 Internal Server Error” when trying to Edit or view a Gallery2 setup, you would ought to check whether your choice of graphics toolkit is the cause of the error. In a gallery I was setting this morning, the “Gd” graphics toolkit was causing the site to crash because of a time-out which arose when Gallery2 attempted to use Gd to generate a thumbnail. The fix is to fight your way to the Admin/Plugins page, configure and activate the ImageMagick plugin, and deactivate (& delete) the Gd plugin. Incidentally, the only way to trouble-shoot Gallery2 when it is in this condition is to: Check your host’s error log for any errors generated by the PHP scripts and/or Apache; and Activate Gallery2’s immediate debug mode. Immediate debug mode should at least generate output, the last line of which should indicate where/why Gallery2 has died. Finally, if you are running on a Linux Host / LAMP stack and you want to use a local php.ini,

Continue Reading...
July 24th, 2011

Conditional Gallery2 Shopping Cart Block

I am in the process of developing a photography website, and for that purpose I am combining WordPress + Gallery2. Gallery2 has a very neat shopping cart feature, which lets a viewer select images, and then purchase/download, order prints, email etc in one go. Gallery2 comes with a “Shopping Cart Info” block (a design element) which shows the contents of the cart. If selected, this block will display itself, whether or not there is actually anything within the cart. I thought it looked a little tacky for the site to show a shopping cart on the gallery, and sub-gallery pages when there is nothing in it. My solution to this issue was to create a new block, called “Conditional Cart Info”, which invokes the original “Shopping Cart Info”, only if the contents of the cart is greater than 0. It requires a modification to the file /modules/cart/templates/blocks/ and the creation of a new file /modules/cart/templates/blocks/ConditionalCart.tpl. You can download my modified files here or click through below to read the source

Continue Reading...
July 9th, 2011

BASH script to photocopy a page and scan to a PDF

I have been using an Epson TX110 for all of my at home printing needs for about three years. While its scanning function is good, I am absolutely sick of the way I need to keep on replacing colour cartridges even though I only ever print in black and white. My colour usage has, in fact, almost entirely been taken up by routing cleaning of the printer heads. So, rather then spend another dollar on colour cartridges I will never use, I finally bit the bullet and purchased a laser printer. Being a linux-geek, the first thing I did was connect it to my home server and share it with my laptop and desktop. The next thing I wanted was the ability to link the scanner function on the Epson TX110 with the Brother laser printer, to be able to quickly photocopy a page. This is amazingly easy with bash and the right tools installed:- #! /bin/bash #Find the default printer, or set printer with a literal string e.g. PRINTER="HL2140"

Continue Reading...
March 11th, 2011

Remember to check your Live CDs!

I was going to do a post about creating a rescue image of a Windows 7 install using OSS (Ubuntu 10.10 + PartImage) however I thought I’d post a warning about corrupted Live CDs instead. Essentially, I tried unsuccessfully three times to install Ubuntu off a Live CD (it would always crash at the third step) before it occurred to me that I ought to check the CD for errors. To do this you need to access the “hidden” boot menu on the Live CD, by pressing any key the following symbol comes up: My check told me that it “found errors in 1 files!”. So I threw this CD out, burnt another Live CD (slowly – at 8 speed), checked it (“Check finished no errors found”) and low-and-behold it worked properly first time.

Continue Reading...
February 28th, 2011

Remotely starting X11 apps on other displays

user@laptop:~$ ssh -X user@desktop … user@desktop:~$ printenv … DISPLAY=localhost:10.0 … _=/usr/bin/printenv user@desktop:~$ Take note of the “DISPLAY” variable, this is the local port (on the machine called “desktop”) which is forwarding X11 server commands to the X11 client running on the machine called “laptop”. user@desktop:~$ export DISPLAY=:0.0 user@desktop:~$ vlc & This sets the “DISPLAY” variable to the first screen on the desktop, and starts VLC as a background process. For this to work you must be logged into the server with the same user account, and have an X11 client running on the desktop. user@server:~$ export DISPLAY=localhost:10.0 user@server:~$ gedit & This sets the “DISPLAY” variable to the laptop, and starts Gedit on the server, but displaying it on the laptop.

Continue Reading...
February 19th, 2011
Contact Nixz Kerr