David Huby’s Blog Technical and business stuff

21Dec/080

Backups and Blat not sending attachments properly

I wrote a batch file to 

* Dump MySQL databases and Subversion repositories

* Zip those files using 7 zip

* Email them using Blat

 

This was all working fine until my attachments reached about 5mb. At this point, I started receiving funny looking messages like this 

begin 644 archive-2008-21-12-15-54.zip
M4$L#!`H``````,-^E3D````````````````(````4W1A9VEN9R]02P,$%```
M``@`PWZ5.66F^"0XN`,`V@H+`"P```!3=&%G:6YG+V%V:64M<F5P;W-I=&]R ...

Blat was automatically splitting large messages into multiple parts.

Suppressing this functionality using -nomps stopped the mail from being sent at all!

Checking my log revealed

Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19)

Message is too big to send.  Please try a smaller message.

MailEnable was advertising an attachment size limit of 5mb. 

If you are using MailEnable, you can alter the attachment size limit by opening MailEnable Administrator, clicking on "MailEnable Management", "Servers", "localhost" (or your server name), "Connectors", and right clicking on "SMTP". The message size limit setting is on the Inbound tab.

20Dec/080

Installing PHP 5 on IIS 6 on 64 bit Windows

When setting up this blog on my new VPS, I had some trouble configuring PHP 5 on IIS6. I have installed PHP on Windows/IIS successfully a number of times in the past so this came as a surprise.

For the first time I was installing on an x64 operating system, and this does make a difference to the installation process.

Running PHP on 64-Bit Windows from the IIS Admin Blog noted the first issue was "trying to load a 32-bit application (in this case PHP) inside a 64-bit worker process"

In order to configure IIS to run in 32-bit mode you need to execute the following command :

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs
SET W3SVC/AppPools/Enable32bitAppOnWin64 1

There are a number of helpful steps and screenshots available at http://www.iisadmin.co.uk/?p=14

Secondly, I added PHP5 to my list of Web Service Extensions.
* Navigate to the IIS Manager in whichever management console you prefer (I usually run compmgmt.msc)
* Open the Web Service Extensions panel
* Etiher click "Add a new Web service extension..." or right click in the current pane and click on the context menu item of the same name.
* Type a sensible extension name such as PHP5 into the "Extension name" box
* Click Add and navigate to your copy of php5isapi.dll
* Check "Set extension status to Allowed"
* Click OK

The IIS Admin blog has an alternative way to do this (on the command line). From the article How To Install PHP on IIS 6.0:

cscript iisext.vbs /AddFile c:\PHP\php5isapi.dll 1 PHPISAPI 1 “PHP ISAPI”

Restart IIS if necessary, and PHP5 should be ready to go.

Tagged as: , , , No Comments
20Dec/080

Subversion via Apache

http://svn.spears.at/ is a straightforward guide to installing multiple subversion repositories and serving them via Apache.

I ran into one problem during installation - I downloaded a zip file containing subversion from tigris.org, and unzipped it into my Program Files\Subversion directory. The Apache service would not start. Since I was not using the installer I also had to add Program Files\Subversion\bin to my PATH.

The error in the event log appeared as:

 

Event Type: Error

Event Source: Apache Service

Event Category: None

Event ID: 3299

Date: 12/20/2008

Time: 5:19:33 PM

User: N/A

Computer: ********

Description:

The Apache service named  reported the following error:

>>> httpd.exe: Syntax error on line 127 of C:/.../Apache2.2/conf/httpd.conf: Cannot load C:/.../Apache2.2/modules/mod_dav_svn.so into server: The specified module could not be found

This was despite it existing in the Apache2.2/modules directory.

 

20Dec/080

Family Village Tribe – The Story of Flight Centre Limited

(the following was originally posted November 24th, 2008)

Family Village Tribe: The Story of Flight Centre Limited

Mandy Johnson documented the journey of Flight Centre from humble beginnings as a tour operator in the UK, to a highly profitable organisation worth millions and over 8000 employees in hundreds of shops globally.

Three focal points drew my attention:

1. Turn “bad” situations to your advantage. Each time the rest of the travel industry experienced downturn, Flight Centre used this as an opportunity to expand and advertise. When the markets recovered, they captured greater market share and quickly recovered their losses.

2. Let people own things. There is a level of emotional equity in doing this. When someone is responsible for the success or failure of something, they are more likely to work hard to ensure it is a success.

3. Give people financial equity in the business when you can. If the aim of the business is to return sustained profits and grow, equity will help people align their interests with the business.

The key point of the book is the principle of family, village, and tribe. By aligning the size of teams and their structure within the Flight Centre organisation, the founding partners attempted to exploit the social structures and instincts developed by humanity over the millions of years prior to agricultural societies.

19Dec/080

Use the CALL command when nesting batch files

When nesting batch files, you must use the CALL command

first.bat

echo Begin first.bat

CALL second.bat

echo End first.bat 

If the "CALL" command is not used, "echo End first.bat" will never be executed.

19Dec/081

Daily or Hourly MySQL database backups on the command line in Windows

for /f "tokens=2,3,4,5,6 delims=/: " %%a in ("%date% %time%") do set timestamp=%%c-%%b-%%a-%%d-%%e

mysqldump -u DatabaseUsername -pPassword TheDatabaseName > C:\Archive\TheDatabaseName-%timestamp%.sql

 

References: http://technet.microsoft.com/en-au/library/bb490909.aspx

This currently points to the "for" article under Command Line reference A-Z under Windows XP in technet. Of course, by the time you click on the link, the article will have moved to a different URL.
19Dec/080

Blip.fm – Your own radio station made easy

(the following was originally posted November 23rd, 2008)

Here is a link to my radio station on Blip.fm

http://blip.fm/aligma

There is a wide variety of music to choose from and it is easy to sign up and use. Great implementation.

Filed under: Web 2.0 No Comments
18Dec/080

Location of IIS Logs – IIS 6.0

 

By default, IIS logs are located in %SystemRoot%\system32\LogFiles

If you need to know the value of the environment variable %SystemRoot%, open a command prompt and type "echo %SystemRoot%"

Other environment variables are listed here http://en.wikipedia.org/wiki/Environment_variable#Examples_from_Microsoft_Windows

Tagged as: No Comments
18Dec/080

The Blog has moved

I will no longer be blogging on the Wordpress servers, instead I have set up my blog here on my own server so I have full control over the domain name and the content.

(the following was originally posted November 22nd, 2008)

With this blog, I’m hoping to

  • Learn how WordPress works
  • Create a list of great resources and links,
  • Improve my writing skills, and
  • Keep track of all my ‘projects’
Filed under: Uncategorized No Comments