R.F. Bevan & Co.

Menu

Notebook

Lightning Fast Shop

Sunday, 19th February 2012


I finally threw in the towel with Satchmo after another hard-to-debug crash, and so I went looking for another shopping cart solution, preferably one that uses Django. After trying out Lightning Fast Shop I am now glad that Satchmo died on me, because LFS seems a much more stable and polished solution. Professional support is available, and it is released under a BSD licence.

The only snag was the lack of an ebuild for Gentoo/Funtoo, so I put one together as part of our portage overlay, which can be pulled from git://rfbevan.co.uk/portage.git. After emerging 'django-lfs', copy the lfs_project directory from this file, edit the settings.py file and follow the instructions as shown on the Lightning Fast Shop website:

python manage.py syncdb
python manage.py lfs_init
python manage.py collectstatic

The store can then be started using the python web server or incorporated into another web server using WSGI.

Adding a Virtual Printer to CUPS

Wednesday, 6th July 2011


Our print-to-fax setup is made up of a virtual network printer that accepts postscript input and runs it through a shell script that parses it for its destination address before shunting it to either the fax or email. Setting it up is relatively simple:

  1. Create a CUPS backend script like this one and place it into /usr/libexec/cups/backend. Make sure that it is executable.
  2. Restart CUPS and test that the backend is available by issuing the command:
    sudo lpinfo -v
    It should return a list of the backends of which ours (faxmail in this case) should be one.
  3. Enter the CUPS administration page and add the new virtual printer. The device URI will be faxmail:/

The script currently just dumps the postscript files into the temporary directory for later work by a cron job. A much better example is pdf2email by George Notaras.

Dongle Woes

Saturday, 2nd July 2011


I bought a Startech USB-to-serial dongle for use with a voice modem that I am using to give telemarketers the 'voicemail treatment' - a ghastly pre-recorded message that saves me the chore of having to listen to them punt their crap. However, I misread the reviews of the dongle and mistakenly believed that it was Linux compatible out-of-the-box. Unfortunately, that was not the case.

Fortunately, a little investigation found that the device has a Texas Instruments TI USB 3410 chipset, which is supported in the Linux kernel. The problem is that the driver does not recognise the USB id of this particular device.

After editing /usr/src/linux/drivers/usb/serial/ti_usb_3410_5052.h and changing the line:

#define TI_VENDOR_ID                    0x0451

to

#define TI_VENDOR_ID                    0x14b0

the device seems to work, although it fills the error log with messages about nonzero urb status, so I patched the kernel to stop those.

Jewellery Renders With Luxrender

Friday, 3rd June 2011


I have started rendering some of the letter pendants using Luxrender. I set up a simple virtual lightbox by working backwards from the reflection in a photo of a pair of Tiffany cufflinks. The result went quite well, and so now I can use the same lightbox for all manner of renders.

In order to extract the subject from its background, I first rendered the image as normal, and then re-rendered it with the background items removed soley to create an alpha channel that can be used as a layer mask. The mask then serves a dual purpose: It can be used to extract the subject, but it can also be used to mask the subject to leave behind the shadow, which is easily isolated by adjusting the levels and then using the color to alpha command to leave behind just the shadow on its own layer.

The resulting subject and shadow can then be saved as a PNG with transparency that is reasonably independent of the background colour, which gives us a bit of freedom to use the image on future designs, whether the background is pure white or not.

The views expressed in these articles are the views of the author and do not necessarily represent the views or policies of R.F. Bevan & Co. Ltd or any employee thereof.