Welcome to My Blog
IT related tech tips since 2006Get a Date X Days in the Past or Future using GNU Date
Recently was running a Pentaho Data Integration that had an input parameter of yesterdays date. I was getting the date inside mysql or inside a javascript step but wanted to be able to pass in an arbitrary date so I could run the report for any day. So on Linux with...
Using ImageMagick’s Convert to create a thumbnail of a PDF
Sometimes you need to create a thumbnail of a PDF file for display on the web or elsewhere. Here is the ImageMagick convert command to do it. convert \ -density 600 \ # make it high density so the resized image looks OK example_051.pdf[2] \ # use [X] to specify the...
The target origin provided () does not match the recipient window’s origin ()
This error running cakephp 3 behind a nginx proxy on port 80 and proxying back to a docker container published on port 8080. Got this error message when clicking on the DebugKit toolbar toolbar-app.js:31 Failed to execute 'postMessage' on 'DOMWindow': The target...
Ungrabbing Mouse Cursor from Guest Console Session of VMWare vSphere Client inside Citrix Receiver inside Mac OS Sierra
With Virtualisation and Remote Desktop Technologies accessing remote environments has become like Inception. The further and deeper you go sometimes it can be a challenge to break out so I'm posting the key combination to escape from vSphere Client Console session...
MacOS doesn’t need Cups-PDF because of this
I recently tried to install Cups-PDF on macOS Sierra but it failed. However because macOS pretty much prints PDF native you just have to go fishing in /private/var/spool/cups and fish out the PDF data files and rename them and you have a copy of the file you want....
CakePHP 2 – Dynamically Globally Changing the Database Connection
Dynamically Globally Changing the Database Connection in CakePHP 2.x I use this code in app/Model/AppModel.php to dynamically change my database environment in CakePHP 2.x depending where it is running <?php //app/Model/AppModel.php App::uses('Model', 'Model');...
If you, like me, haven't had formal programming training and would like to see how to properly code in PHP. Have a look at the source code to the Pheanstalk project. IANAP but to me it looks very clean and logical and very DRY (don't repeat yourself)...
CakePHP+Pheanstalk+Beanstalk+Supervisord
UI Lockups due to long running tasks Recently coded a CakePHP 3 application that would send about 30-60 emails when a user triggered the 'notify' action. When they did this it took probably 30 - 40 seconds for control to return to user. So I was looking at how to fix...
Setting the Apache 2.4 PATH environment variable in a brew services started httpd process
Note the following perl script #!/usr/bin/env perl -wT print "Content-type: text/html\n\n"; # foreach $key (sort keys(%ENV)) { print "$key = $ENV{$key}<p>"; } As you can see the hash bang is #!/usr/bin/env perl this is supposed to be more portable because it...