Pages

Wednesday 2 May 2012

PHP 5.4.1 LDAPS Fix

After taking a bit of a break from blogging, I decided that it was time that I should do something again.

Anyway, last month I took a stab at upgrading PHP to version 5.4, which contained some nice little features and performance improvements. Almost everything went fine, apart from one little thing which made me roll back to version 5.3.x, which was that no matter what I did, no matter how hard I tried, I couldn’t initiate a secure LDAPS connection over our network. This is used to do some Active Directory bits and pieces and so without using an LDAPS connection there was no hope. Everything looked fine though, it was almost as if it just didn’t want to do it for whatever reason.

Anyway, a few days ago, along came 5.4.1 which even though I have checked, doesn’t mention any changes to the LDAP / OpenSSL extensions. I thought that I would give it a go – and guess what – it worked!

In addition to the above, PHP 5.4 now supports paged LDAP results whereby it contains a fix for missing feature to retrieve more than 1000 items from an LDAP server at any one time without making changes to your Active Directory configuration.

Thursday 16 February 2012

Fixing MySQL Error 1067 on Windows Server 2008 r2

Let me just start by saying that this has been really annoying me for some time now and obviously taking the server offline to fix this is difficult at the best of times.  Fortunately, this week I've had the time to take a look at this and see if I can sort the issue.

From looking at all of the various 'solutions' out there, it doesn't actually seem that any of them are correct.  Don't get me wrong, I'm sure there is one somewhere but I didn't manage to find it past page two of Google so I thought I would give it a go myself.  Just to save you some time, the following doesn't work despite what a lot of people will have you believe (and if they do, then you have been lucky):
  • Removing the service and reinstalling;
  • Removing and recreating the log files;
  • Repairing the install;
  • Recreating your MySQL instance;
Now the reason that it happened on my server was due to an upgrade from MySQL 5.1.x to 5.5.x a few months ago.  I thought that I had done the usual routine correctly of taking backups, downing the service, uninstalling, reinstalling and then restoring.  Job done I thought.  This has never been a problem on any other server that I've done this and so I wasn't expecting this.  All it meant was that from time to time, the service wouldn't start after a Windows reboot.  Not really a big deal but any down time at all is a big no no.

So, in essence you will actually need to do most of your preparation that you would normally do for an upgrade.  You might as well download the latest version of MySQL while you do this so firstly go and grab that.  Next, do your normal backup of your databases and also your my.ini from wherever you normally keep it.  Stop your MySQL service and then uninstall your MySQL installation.  Go to your ProgramData folder and remove your MySQL folder, and do the same in your Program Files\MySQL folder (remove your server folder just in case you have your tools or workbench installed in there).  Now go to your Users folder and have a look through there and it will normally be hidden in your Default\AppData folder.  Launch regedit and search for 'mysql' and remove any instance of it that is related to your server install.  Restart your server now.

When your server comes back on, run your nice new installer, giving it the same settings that you had before.  Set a new instance up (it can be the same service name if you like) and then it will go off and set your my.ini, your service and your security settings.  Your service should now be running straight away.  Just to check it though, stop the service and start it again.  You should find that it's running without erroring.  If it does error, not to worry, open a command prompt and browse to your bin folder inside your new installation and run the following:
mysqld -remove MySQL
Where MySQL is the name of your service that you specified.  Assuming that you have typed that in correctly it will say that it has removed the MySQL service.  Now run the instance configuration wizard again (inside your bin folder) and go through it again.

Lastly, restore your databases and users / permissions and you should be done.  Sorry that this is a bit lengthy but this worked for me and every other solution that I found didn't sort my problem.  It seems that this error goes way, way back to MySQL 4.x but nobody has worked out a way to fix this properly.  As I mentioned before, other people have posted their solutions which may have worked for them, but that could mean that this is an inconsistent error which is why it hasn't been fixed as of yet.

Tuesday 10 January 2012

Looking for My Briefcase in Windows? Microsoft SyncToy is Your Solution!

Remember the days where you had multiple devices that could sync from one location on Windows?  Well, when Windows 7 launched I assumed that something like this would exist as a built in feature.  I was wrong.

Instead, Microsoft seems to have gotten into the habit of releasing smaller applications as addons for Windows as part of the PowerToys range; one of these is Microsoft SyncToy.  According to Microsoft, 'SyncToy 2.1 is a free application that synchronizes files and folders between locations. Typical uses include sharing files, such as photos, with other computers and creating backup copies of files and folders'.

Just last week I was in the position where I needed to have a synchronised set of data that existed on two servers (not ideal I know but it couldn't be helped in this case) and there wasn't any built in solution that I could find.  After a bit of searching around I came across SyncToy 2.1 from Microsoft.  And it does exactly what it says on the tin.  There are both 32 and 64 bit versions available here for your download pleasure.

SyncToy has a friendly interface, that gives you the choice from where you want to sync from (left folder) and where you want to sync to (right folder).  There are then three types of sync that you can do:
  • Synchronize: Does a left and right sync which includes deletes and renames;
  • Echo: Updates and new files are copied left to right including deletes and renames;
  • Contribute: Same as echo without deletes;
So far it's all easy stuff, but it's not all rosy and nice though as the application does have one major shortcoming - built in scheduling.  It can be done but it involves you setting up a scheduled task from within Windows using the following syntax: 'C:\Program Files\SyncToy 2.1\SyncToyCmd.exe -R "Your Sync Name Goes Here"' which is fairly straight forward.

So there you have it, the return of Microsoft Briefcase!  I've tested all three syncs and they all work well, as does the scheduled task.  My only criticisms are that this should be part of the OS and also the scheduling should be built in.

On a final note, I've been working on a web paper recently located over at paper.li called the Web Feed which takes a look at an in depth range of articles from around the web and also takes a look at the latest in technology news.

Wednesday 21 December 2011

Upgrade of Moodle 1.9.10

Because this time of year is so quiet, I thought that I would do a small point release upgrade of my standard Moodle 1.9.10 install to the current latest version of 1.9.15 as of today.
There are a few reasons that I wanted to get this done and out of the way before January.  Some of my reasons were:
  • General bug fixing;
  • Performance upgrades;
  • Module enhancements;
  • Preparation for Moodle 2.x upgrade;
Even though I know that none of these reasons were particularly urgent, my main reason for doing so is in for the preparation for our imminent update to version 2.x quite shortly.  I've used x because from what I have read, version 2.3 will be out around June 2012 and so that will most likely be the one that I'll be going for.  My work so far to upgrade our version 1.9.10 to version 2.0.6 didn't go so well as I ended up finding lots of small errors that hindered the installation, but upon upgrading to 1.9.15 prior to upgrading to version 2.0.6 many of these errors (mostly relating to blocks and modules) went away.

Anyway, as for the update.  It actually went very smoothly and quickly.  The entire update was done within a few minutes.  This is what I did in preparation:
  • Backup the database and file structure;
  • Copy over the top of the existing files with the new files;
  • Run the update;
There was one new setting that was asked for which related to the automatic storing of passwords in browsers, but other than that nothing.  Point releases generally should only be done if you have problems but in my case it was more about preventing future problems than fixing any major current problems.

Note to all those upgrading from 1.9.x to version > 2.0.x, make sure that you upgrade to version 2.0.x first before attempting to upgrade to either 2.1.x or 2.2.x. The changes made in version 2.0 were large and so it is recommended within the Moodle documentation that you do this first.

Monday 19 December 2011

IE6: The End Nudges Closer

Microsoft has today announced that from January 2012, Internet Explorer updates will automatically be downloaded and installed in the background whilst retaining all of your custom settings like addons and search providers.

The new feature will work for those who have automatic updates enabled on their machine and this means for anybody using Windows XP you will be jumped up to version 8, whilst if you are on Vista or Windows 7 you will be pushed to IE9 whether you like it or not.  This is definitely a good thing for Microsoft as it means that the death of IE6 just moves that little bit closer.

In the past I have criticised Google and Mozilla for pushing out these updates on the stealth as it means that developers are constantly having to make changes - especially when they both at the moment are doing a new release every eight weeks.  In terms of security, this is most definitely a good thing for the Internet as a whole.  I myself as of earlier this year completely dropped support for Internet Explorer 6 as it was simply becoming too difficult to maintain.

Ie6countdown.com has the world usage for IE6 pegged at 8.3% as of today, with certain countries faring better than others.  For example, the UK has 1.8% and the US has 1.0% - fairly impressive, however China is massively behind here at a massive 27.9%.  I can only put this down to counterfeit software but whatever happens, the Internet will go on with and without it.

As a final note to those of you out there still using IE6, please, please, please update!

Thursday 15 December 2011

Manage Memory Limits SQL Server Enterprise 2008

Currently on our network is a server that's running SQL Server Enterprise 2008 running on our Hyper-V cluster.  On the cluster, dynamic memory is enabled.  Now, normally this isn't a problem, but when configured incorrectly SQL Server Enterprise will eat up as much data as it needs and so you suddenly have a server (low usage) that is eating up 14gb of memory.

The solution is to go to SQL Server Management Studio and right click on the server in the task pane on the left and go to properties.  Under memory on the left is an option to set max server memory in megabytes.  By default this is set to 2147483647mb (maaaaaaaassive).  The minimum you can set this to is 4mb but that would be silly now and so after a bit of a debate we decided that 6144mb (6gb) would be a nice number.  It now means we can continue to use dynamic memory on the VM without having to set static amounts of memory for the server itself.

Wednesday 14 December 2011

Chrome 16 Out Now

Today sees Chrome 16 released as part of the Google rapid release cycle.  With it comes the ability to sync your life, for example when you upgrade to version 16 your home machine with Chrome and your work machine with Chrome will share everything like your extensions, settings, history, bookmarks and other things between each other.

Obviously, in able to do this you will need to pair your Chrome with your Google account which also has other benefits including being automatically logged in to any Google based sites.  Is this potentially dangerous though especially with Google + (Plus)?  The jury is out on that one for now I think.

Personally for me, this is where Mozilla is going wrong with Firefox.  These features simply don't exist and once upon a time it would have been Firefox with all of the new bells and whistles so for me this deserves a pat on the back.  Well done Google!  Now that Mozilla are following Google with their rapid release cycle, I think it will be even harder for Mozilla to keep up.

Chrome 16 is available to download now, or if you already have Chrome installed then just sit back and wait patiently for Chrome to update the next time you load up your browser.