This is a snippet of Perl that takes the contents of text file on stdin and then converts it to a PDF using a tool chain as follows Sed is removing the ^L form feed character from the end of the file to stop enscript creating an extra blank page Enscript is creating a...
James McDonald
Added Custom Cups Backend Discovers Cups error_log Now Available Via journalctl!
Cups mailto Install Playing with the cups-mailto from http://cups-mailto.sourceforge.net/ I discovered that you have to make the permissions correct in order for the backend to work cp mailto /usr/lib/cups/backend # unless you do this the backend will # not showup in...
Postbooks 4.8.1 GUI Client Print to Cups Printer work-a-round
Still having trouble with printing from Postbooks to a Cups based printer on Fedora 21 http://www.xtuple.org/xtincident/view/bugs/24335 The work-a-round is to change the A4 page size to custom and then it prints... or build the client from source... This has...
When we move to Melbourne what do I call my blog then?
So since my first post on this blog in July 2006 I have lived in Telarah a suburb of Maitland 40 minutes west of Newcastle in the Hunter Valley 2 hours north of Sydney. In the next couple of months my Wife and I are planning on moving to Melbourne.... So I'm wondering...
CakePHP Getting Back to Where You Were After You Submit an Edit Form
I don't know if this is the proper way to do it but... You have an edit button in a view pointing to a form... When you click edit and you navigate to the edit page and you click submit. The edit actions default is to take you back to the controllers index action...
CakePHP Editable Table Based Dynamic Superfish JQuery Menus (<==mouthful)
Below is one way to create dynamic menus in CakePHP. It uses an element, a custom helper and a database table setup for the Tree behavior. It uses CakePHP 2.6.3. Since posting the below I have made some improvements and posted them to github ==>...
Globally Change the Default Database Connection in CakePHP 2
Note: Sadly this doesn't work in CakePHP 3.x The secret is define a new database config in the DATABASE_CONFIG class ( I use "app/Console/cake bake" and the database option ) Edit AppModel.php to specify the $useDbConfig property as the correct connection name as...
Installing PostgreSQL Server and Connecting PGAdmin3 to a Local Instance on Fedora 21
yum install postgresql-server pgadmin3 postgresql-setup initdb sudo pgadmin3 disable the local all all peer line add local all all trust ...
Fixing “You have only 184MB of freespace….” on a CentOS7 VirtualBox VM
Just had a CentOS7 VirtualBox VM popup a warning saying I was down to my last few hundred MB of free space. (I installed it as a trial with a 8GB root partition and then started using it as an Apache test VM with heaps of data) The VM is using LVM and XFS. So my VM...
Take Youtube Offline with youtube-dl
If you go here http://rg3.github.io/youtube-dl/download.html and follow the install instructions you can install a utility to allow you to download youtube videos for offline use. <sarcasm> Just make sure you spend enough time watching videos on youtube proper...
Update a table based on the contents of two other tables. MySQL
The goal was to populate the pack_size_id with the correct id number from the pack_size table, based on the mappings in the part-list table. Table 1 (`items`) +-------+--------------+ | code | pack_size_id | +-------+--------------+ | 50004 | 35 | | 50005 | 36 | |...
Different output of Set::combine and Hash::combine
Just had an annoying 1/2 hour trying to get a properly formatted array to pass to a select control in CakePHP In my controller I'm trying to format an array with a Custom field $options = array( 'fields' => array( 'ReportDate.id', 'CONCAT( ReportDate.date, "...
CakePHP: Submit 0 instead of NULL for a database column that doesn’t allow NULLs
Problem: Error: SQLSTATE[23000]: Integrity constraint violation: 1048 column 'inventory_status_id' cannot be null Cakephp returns the above error when I'm trying to POST a removal of an integer from a field. Cause: The form was sending a blank value back to the...
Using gnubarcode to generate a GS1-128 barcode
Tried using the Code 128 options but couldn't get the right out put The trick I found is to use Code 128 raw mode. The caveat is it won't format a nice human readable text label for the barcode you will have to add that your self later (perhaps hack the postscript)....
What is the FNC1 character used for in a GS1 compliant barcode?
At work we ship pallets to supermarkets. Each pallet needs two bar codes A Serial Shipper Container Code (SSCC) and An item information bar code with GTIN-14 (Trade unit), Best before date, batch and quantity per pallet. On both the SSCC and item information bar code...
Implementing <<first and last>> links in cakephp pagination
I don't know why they don't include them by default but here is an example of how to add first and last links to your view. <?php echo $this->Paginator->first('<< first'); #add this echo $this->Paginator->prev('< ' . __('previous'), array(),...
Understanding the Difference between Windows Server User and Device Clients Access Licenses (CALs)
Every time I ask myself the question which type of CAL do I require? It always seems to take some thought in order to comprehend the difference.... Especially when you only ask the question every couple of years. But I found this picture which helps visualize the...
Don’t Buy USB Keys, SD Cards from Malaysian Street Vendors!
So while in Kuala Lumpur I bought a couple of 512GB USB Keys a 128GB USB/Mini-USB key and a 64GB micro SD card. At 10MR each they were less than a third of what you would pay in Australia for a 8GB USB key from Verbatim or Toshiba. After attempting to use them on both...