Old posts

Drupal HTTPS images

Posted by on March 2, 2011 | No comments

I was involved with a project for a while which was using Drupal as the CMS. The entire site was being served over HTTPS, which was quite annoying as a large pile of the images that were being posted were being served over HTTP from their respective webservers. Naturally, this resulted in everyone getting very annoyed at their browser warning about loading unsecured content on a secure page.

So, I came up with this module. I’ve been meaning to release it for ages, but as I need to clear down the server it was running on it’s made me take the five minutes to write this post. Still needs a bit of work, but does what it says on the tin.

It identifies non-local images in content, downloads them and serves them from a local cache.

Download the module here: img_proxy.tar.gz

If you use Drupal, you should already know the drill – extract the file to your modules directory and enable it in the modules page. The module is implemented as an input filter, so you will then have to add it to the appropriate input formats at http://your.site.com/admin/settings/filters


  • Licenced under the GPL version 2.
  • *** There is nothing in the code that verifies the file being proxied is an image!! *** (that’ll be in the next version!)
  • May not work with sites that check the referer of the request for images.
  • I’ve been meaning to release this for ages, but there is sill a lot of debug code thats just commented out.

Hopefully I’m not the only webmaster that ever had this issue and somebody will find this handy.

Maybe one day I’ll tidy up the code and submit it to the Drupal Module repository!


Tags: , , , , ,

SCE2007 Failed to install agent

Posted by on July 6, 2010 | 4 comments

I’ve been doing more and more work with the System Center product suite of late, and suffice to say I have some big loves and some big hates about the whole thing.

My recent hate is System Center Essentials 2007. Thankfully, I actually quite like Essentials 2010.

Anyway, while installing the SCE2007 agent the other day, I encountered an odd error message while trying both a push install and a local install of the agent.

Error 25211.Failed to install performance counters.. Error Code: -2147023886 (The configuration registry key is invalid.).

Sadly, there’s not a lot on the web in relation to this error. The only pointer that might have helped was this technet article: How to manually rebuild Performance Counter Library values.

This starts out pretty nasty, involving copying files from your install media and hacking about in the registry, which Microsoft always massively caveats. The one item of help on the page was the command:

lodctr /R

According to the help, this will rebuild the perf registry strings and info from scratch based on the current registry settings and backup INI files. And accorting to the KB article: “/R is uppercase. You must have administrative rights on the computer to successfully perform this command.”

That did the trick for me and completely avoided all the nasty work of actually finding the install media for this server 🙂

I’ve included below a larger chunk of the installation error log below which will hopefully help people find this page via searches.
» Read the full post

Tags: , , ,

EU Browser choice debacle

Posted by on March 13, 2010 | No comments

Theres been quite a bit of chit chat about this update that Microsoft has now released.

My personal opinion is Microsoft shouldn’t have been forced to release this. If you FORCE a choice for a web browser, you should also force a choice for every single application that comes with Windows.

Additionally, I fail to see why people should be forced to pick from a number of free products. Perhaps a better option would be for Microsoft to allow third parties to produce branded versions of Windows and then users can make their initial choices at the point of purchase.

This, of course, assumes a level of knowledge of the end users so questions like “where have all my favourites gone?” don’t happen…

Anyway, this was supposed to be a vaguely technical post and not a rant.

So, as a systems administrator, how do you block this update?

If you are using an internal update server such as WSUS or SCCM (which I love), then you have the simple option of not approving the update for release.

Otherwise, Microsoft have released a KB article showing a simple registry key that can be set to prevent the Browser Choice screen running – KB2019411.

So, as a sysadmin, how do you implement this?

Well, you can custom roll a Group Policy to set this as a preference on your client machines. I’ve written some GPOs before, but in this case I’ll simply direct you to this blog post by Christoffer Steding where you can download his version.

However, in my opinion, a much more graceful group policy to set is a software restriction policy. This has been documented by The Angry Technician.

Tags: , ,

Troubleshooting 101

Posted by on January 17, 2010 | No comments

I’ve recently started in a new role which, of course, has brought with it new challenges 🙂

This weeks challenges related to SQL 2008 and Office Communications Server 2007 R2.

My SQL 2008 issue related to a “feature” known as Parameter Sniffing. In simple terms, SQL Server generates a execution plan based on the parameters passed to a stored procedure the first time it’s executed. Of course, given that the parameters passed may or may not be typically representative any given execution the “optimization” may be way off. A good indicator this is an issue is if you execute that SQL code in Query Analyzer and the time taken is significantly shorter than the same query run through an “optimized” stored procedure.

There is a really good overview of this on sqlpointers.com. The workaround is fairly simple if a little annoying.

My other big issue I lost a fair amount of time to was with OCS 2007 R2.

Packet sniffing (using Wireshark or Microsoft Network Monitor) between my server running the Mediation Server role and my IP PBX (Cisco CallManager, but thats irrelevant) showed that the SIP FROM address being used to establish an outbound call was [email protected] and not using an e.164 number eg [email protected] This meant that the PBX was unable to establish an appropriate Caller ID to use when establishing the outbound call via the carrier.

After many hours of trailing top to bottom through all the config options for OCS, and seriously considering a fresh build of the core server, I found the issue was related to a setting being force in Group Policy from a previous OCS project.

This setting was forcing the OCS client to operate in the remote call control mode, which was overriding the setting on the OCS server that meant users were operating in Enterprise Voice mode. The setting in question is TelephonyMode and it was set to 2.

One nice little (undocumented!!) feature that came to light while troubleshooting this issue is the ability to get a summary of the operating OCS client configuration! Simply hold down the CTRL key and right click on the OCS icon in the system tray. Select the “Configuration settings” option and a nice little window will appear with a list of the settings in operation!

This helped me diagnose the issue as it showed the address my client was using for its Line setting was the setting it should have been using when I was previously using Remote Call Control of my Cisco handset and not my full e.164 number as I would have expected.

Always nice to finish a Friday on a positive note 🙂

Tags: , , , ,

WordPress Front Page Single Post

Posted by on September 11, 2009 | 6 comments

Well, I’ve rejigged my site theme, and I decided to play a bit with the layout.

The look of the site seemed to be better with just the excerpt from a single post on the front page.

Now, that sounds really straight forward and something that WordPress should be able to do out of the box. And it is.

However, if you want the “Older Entries” pages to then show, say, 10 posts you’re knackered as all subsequent pages will just show 1 entry. I tried the Custom Post Limits plugin, but it still didn’t work as page 2 started at post 6.

After reading a lot of entries on this topic (it seems I’m not the only person keen on this!) and getting nowhere fast. Lots of “read this link then work it out yourself” type replies I finally got something to work. Using both the offset AND paging attributes of the query_posts() function!

The only issue with this is that the last page wouldn’t show at all. This was due to the fact that the front page misses all but 1 of the entries, then the 2nd page starts at entry 2. In effect you’re missing a number of entries up to the usual number per page minus 1 – everything that would be on the last page. To get round this, I simply double the number of entries displayed on what WordPress believes is the final page.

» Read the full post

Tags: , , ,

Powered by Wordpress and Stripes Theme Entries (RSS) | Comments (RSS)