Paul Gregg

Jack of all Tech.

Migrated to MovableType

Written By: pgregg - Feb• 03•2009

Well after a few days of poking and prodding and working my way around Ubuntu Hardy Heron bug compiling Image::Magick (tip: it is a bug in the supplied gcc-4.2.3 – you can get gcc 4.3 in gcc-snapshot apt package), I finally have a working MT install.

Next up was writing a PunBB article and comment exporter to create a MTimport format file that I could load into MT to pre-populate the blog. Couple of trial runs later and here we are.

Let’s see if I can manage to post a little more frequently.

For those syndicating the old blog, rewrite rules should mean you have nothing to change but please let me know if anything is awry. 
General feed is /feed/all
PHP category feed is /feed/php

To silent fanfare, Microsoft released SQL Server 2005 Driver for PHP

Written By: pgregg - Aug• 07•2008

On July 24, Microsoft released version 1.0 of their native SQL Server 2005 Driver for PHP.

http://www.microsoft.com/downloads/details.aspx?FamilyId=61 … 597C21A2E2A&displaylang=en

Some months back I downloaded a beta version of this after having problems working with international characters (UTF-8) with PDO and MSSQL and impressively the SQL Server 2005 Driver for PHP worked very well.

Congratulations to Microsoft for continuing with this and their recent contribution to ADODB.  I’m looking for better PDO support now :)

VMware releases ESXi for free

Written By: pgregg - Aug• 05•2008

I totally missed this one until a few days ago, but VMware has released the ESXi Hypervisor free of charge.   They obviously see the pending challenge from Microsoft, Xen and Virtualbox and are hoping to gain traction and mindshare in the community – but I have one piece of advice for VMware.

If you want to regain the "developer" mindshare – those evangelists that sponsor VMware in their corporations – then restore the VMTN Subscription.

VMTN was my affordable way in to VMware – and because of that and my persistence in my current workplace, VMware now has over 20 ESX Enterprise license sales.

My year with Microsoft Vista.

Written By: pgregg - Jul• 30•2008

Today sees the 1st birthday of my current laptop so a happy birthday to it.  The machine was a top-of-the-line, fully tricked out Dell Latitude D830, Core 2 Duo 2.2Ghz, 4GB RAM, 160GB HD, nVidia quadro NVS graphics plus the new snazzy 1GB Intel TurboCache Memory module.

Because of the specs – you need a 64bit OS to make use of the 4GB – and the TurboCache part only works on Vista I thought I would give Vista 64 a try – a serious try. I would give Vista a whole year as my primary OS.  Here I am one year later to report my findings.

The is a company laptop, and Vista is not yet an approved OS for use in the workplace, but I work in IT and I’m quite proficient at taking care of myself, plus some IT members are evaluating Vista as an option for corporate roll out. I also installed Automatic Updates from Microsoft to stay current (bypassing the corporate WSUS server that sometimes takes months to push out updates because of close periods, quarter ends, etc).
Thus there was minimal risk to this endeavour.

Setting up a new machine so you can get your work done is always the most painful part of getting a new computer, this proved to be the case again with Vista.  However, the pain was double in that many of the drivers I needed didn’t exist or were hard to source plus some of my loved devices just didn’t work any more (my MSI USB TV dongle has suffered the indignation of remaining in my drawer for a year).

Ricoh were really good with drivers for the multifunction printer/copiers in the office.  Installation of the driver was a bit fiddly, but once done it worked very well.   However, for anyone with Vista it means the drivers need to be installed manually whereas XP users get the driver delivered to them when they connect to the printer.

Most of my regular applications worked fine out of the box, Eclipse, Visual Studio, Office (well you would hope this would), McAfee AntiVirus, however I had significant issues with other necessary applications.

Initially the corporate F5 VPN didn’t support 64bit and I had to wait some months before were were given a beta version to test. 

VMware Workstation was just into beta supporting Vista so I was able to use that from the off which was useful – because I virtualised my old XP laptop and was able to keep that around for legacy app support for the things I just couldn’t get going in Vista – VMware, I love you dearly.   However, I am also our VMware Virtual Infrastructure goto-guy and to this date VMware Virtual Infrastructre Client does not install natively on Vista 64… I had some pretty nasty hoops and hacks to go through to get that installed. I wouldn’t like to have to do that again. Come on VMware, sort it out.

Microsoft AD and Exchange Admin Tools. What can I say? They don’t work.  Microsoft acknowledge that they won’t work on Vista.   Your prime adopters of Vista in a corporate department are the IT people – but we *need* the admin tools to do our jobs.  Thus we need XP.  How can you expect corporate IT departments to push Vista to the workforce when we can’t use it for our basic Windows AD/Exchange administration?  Major, major oversight.

Yahoo Messenger was another troublesome application, and still is.   Before the "beta vista" version, it frequently crashed out and would not remain connected.  However since the beta vista version arrived it has been stable but and it is a big but, RAM usage in it is insane.    I have just started the application and have had no messages sent or received and it is already claiming over 500MB of ram.

Which neatly leads me on to…. RAM usage.   Everything takes more RAM in Vista.  Vista introduces some new processes to the mix like the PresentationFontCache.exe (520MB) plus lots more buried in svchost.exe processes (the DLL service runner program). If I total up the RAM usage in svchost.exe processes I come to 1.8GB ram.
This laptop has been powered on for maybe 30 minutes and it is using 2.5GB ram – what applications are open? Firefox, putty and Task Manager.   By the time I fire up Outlook and some other apps I use I’ll be looking at 3.8GB – which isn’t necessarily bad, it is within my physical RAM limit so the machine isn’t swapping.  However it does bring into question the reason for a 64bit OS in the first place – to make the 4GB ram available.   Would I have been better taking the addressing limit of XP and living with 3.5GB ram?

Finally, and the cruncher.   This machine is slow, sometimes and frequently, painfully frustratingly slow.  I fully expect that it will take minutes from pressing the power on button to getting to my Desktop.   Powering down sometimes takes longer and frequently hangs/locksup/bluescreens when powering down while in the docking station (I can’t believe Microsoft and Dell still haven’t figured out this constant and widespread problem after all these years – this is a constant bugbear for Dell owners).

When in operation the machine will start to act slowly, to the point that I can see the putty terminal window repaint itself.  Firing up SysInternals task manager shows the CPU(s) at 100%, sometimes it is McAfee’s updates, sometimes other apps, sometimes nothing is apparently consuming the CPU, but all the same, it is pegged at 100%.   

This week already I have had 4 "coffee events" – where the machine gets so slow that you decide you may as well go and make some coffee in the vain hope that the machine will rectify itself by the time you get back.   If it is still stuck when you get back then it is a measurable coffee event.   The responsiveness will return perhaps within 5-10 minutes, but it is frustrating and supremely annoying.

My conclusion?

Vista is not a terrible OS by any means.  It is Windows, it works like the Windows and for the most part behaves in an acceptable fashion.  However, I find it hard to justify the resource requirements – I don’t see the benefit.   Vista doesn’t do anything more than XP did except for perhaps the annoying UAC controls and the feeling that somehow you are slightly better protected from the world.   I constantly ask myself if XP would perform better on this machine (which isn’t a slouch) and now that I have completed my Vista year the next (if you’ll pardon the pun) window of opportunity available to me, I will be reformatting and going back to XP.
Vista is years ahead of its time – maybe in 3-5 years when we have Eight Core 10Ghz CPUs it might perform to an acceptable level.

Script to generate a list of valid email recipients from a qmail setup

Written By: pgregg - Jul• 26•2008

Last week I set-up a Postfix+MailScanner+ClamAV anti-spam and anti-virus mail relay server. Testing seemed all good, except that it was scanning lots of bogus email addresses, e.g. to nosuchuser@pgregg.com

Postfix provides a relay_recipients file (at least thats what the MailScanner setup called it) where you specify the specific email addresses that you are prepared to accept email for.

In the old days we used SMTP VRFY – which people dropped because it was a way to verify good email addresses and clean spam lists.   However, by dropping it it seems the spammers just ignored cleaning and just blast out to any and all email address they could find.  The irony being that the problems are now worse because we are constantly being bombarded by spam to bogus addresses.

As my primary email system is (still) qmail I needed a way to build a list of valid emails that qmail would accept – so I set about writing a perl script that would process the control/virtualdomains users/assign and dot-qmail files in the same way that qmail would.

The result is here:
  http://www.pgregg.com/projects/qmail/makevalidrecipients/MakeValidRecipientsList.pl

Feel free to make use of the script – hopefully it can help others too.   Note that it doesn’t handle ~alias users, nor if you have a database backed system – but manual and vpopmail setups should be just fine.  No warranty implied or given though :) Use at your own risk.

Once I added the relay_recipients file to the postfix relay and waited a few days, awstats reported that 99.8% of all my email was to bogus addresses – wow!  That is a massive saving on CPU (antispam/av scanning) and traffic.

Enjoy.

Holy Irony Batman!

Written By: pgregg - Jan• 04•2008

There’s a new website about to be launched over at http://www.mycatholicvoice.com

In the Terms of Service it notes:

"YOU AGREE THAT CATHOLIC CONTENT, LLC, ITS AFFILIATES AND ANY OF THEIR RESPECTIVE OFFICERS, DIRECTORS, EMPLOYEES, OR AGENTS WILL NOT BE LIABLE, WHETHER IN CONTRACT, TORT, STRICT LIABILITY OR OTHERWISE, FOR   …    ANY FORCE MAJEURE"

:D haha

Want to try out the next major version of Delphi for PHP ?

Written By: pgregg - Dec• 19•2007

CodeGear is looking for additional beta testers for the next major version of Delphi for PHP (http://www.codegear.com/products/delphi/php).
Interested PHP developers can apply to become a field tester at http://www.surveymonkey.com/s.aspx?sm=AsT7NAxv4zC5WYKIaK9pRw_3d_3d.

FastCGI for IIS (PHP related)

Written By: pgregg - Sep• 28•2007

I haven’t seen this announced on the PHP blogs (planets) yet and since it may be of interest to those running PHP (with IIS as a CGI) I’ll repost the details here.

Joe Stagner’s Blog (Microsoft employee) has posted that the IIS team have released the FastCGI extension for IIS 5.1/6.0 as a free download from http://www.iis.net/.

Rather than reword it all, here are the salient bits in Joe’s words:

HUGE KUDOS to the IIS team for their hard work and innovation (technical and political) for making FastCGI a reality.)

If your a developer that needs to use a CGI based platform (Like PHP) and work on Windows � then this is a godsend.

They guys went into over-drive to get this ready before the upcoming Zend-Con.

Here are the official particulars.

Since early 2006, Microsoft and Zend have been working together on a technical collaboration with the PHP community to significantly enhance the reliability and performance of PHP on Windows Server 2003 and Windows Server 2008.  As part of this collaboration, the IIS product group has been working on a new component for IIS6 and IIS7 called FastCGI Extension which will enable IIS to much more effectively host PHP applications.   

New blog category – Photography

Written By: pgregg - Sep• 19•2007

I’ve had a semi-keen interest in photography for a year or so now, but never really put anything together to display some pictures properly.  So in the absence of actually writing any real blog posts – why not put up some pictures? :)

Well first up is a shot of my little girl, Lauren, who just turned 3 years old. I was really going for the depth of field, and I think this one (out of about 20) came out really well.


link

Next is my eldest, Erin.


link

Here we have the first of the twins, Kirsten.

link

And finally, the other twin half who makes up all of the noise quota for any set of twins, Shane.

link

Comments and suggestions are very welcome.

Delphi for PHP (aka D4PHP)

Written By: pgregg - May• 04•2007

Yesterday I installed Delphi for PHP (D4PHP), a new development environment from CodeGear, a Borland company.

D4PHP is CodeGear’s first attempt at bringing visual rapid application development to PHP.  To be honest my first impression was fear. Here I am, 10+ years into PHP and used to developing raw PHP in vi and Zend Studio, with a couple of forays into Eclipse, staring at a PHP RAD tool without the first clue where to begin.

At first glance, it looks like a familiar IDE environment and my first thought was to File / Open, open a .php and use it as an editor. But no, if I’m going to use it I should use it the way it was meant to be.

"Hello world" was pretty straight forward, but going beyond that left me pretty bewildered, not sure what was going on underneath, nor how it was supposed to plug together. VCLs (Visual Component Library) exist to "simplify" the building of applications, so I thought I would follow the build-a-component guide and turn my preg_find recursive directory iterator/filter/sorter into a VCL.  I think I succeeded (it "compiles" ok) but I don’t know how to test it!

Make no mistake – D4PHP is a mindshift for traditional PHP developers like myself.   

Step back from the POST handlers and sequential logic we are used to and prepare to look at application components that seem to have a life of their own.   I have to confess that being a simple procedural kind of guy that thinks OO is mostly hype, D4PHP is a huge concept for me to grapple with.  But I think I might just enjoy it.