Archive for the ‘Windows’ Category.

SMTP Sink Links

Just some links that help with programming SMTP Sinks for IIS.

  1. SMTP Server Technical Articles Microsoft Windows 2000 SMTP Service Events
    <http://msdn.microsoft.com/en-us/library/ms998608.aspx>
  2. How to write an OnArrival-type SMTP event sink in managed code by using Visual Studio .NET 2003
    <http://support.microsoft.com/kb/894286>
  3. Managed IIS SMTP Sink Wrapper: Message.CopyContentToStream
    <http://codeka.com/blogs/index.php/2005/06/06/managed_iis_smtp_sink_wrapper_message_co>
  4. C# Catchall Onarrival Event sink
    <http://gsexdev.blogspot.com/2005/05/c-catchall-onarrival-event-sink.html>
  5. ESTMP Keywords and Verbs (commands) Define
    <http://smtpfilter.sourceforge.net/esmtp.html>
  6. How to get the IP of the SMTP client
    <http://codeka.com/blogs/index.php/2007/08/08/how_to_get_the_ip_of_the_smtp_client>
  7. Sample Sink
    <http://svn.vestris.com/filedetails.php?repname=Vestris+SVN&path=%2Fsncore%2FSnCore.MailSink%2FSnCore.DomainMail%2FSink.cs&rev=1289 >
  8. Creating a custom authentication sink for IIS SMTP or Exchange
    <http://blog.rednael.com/2008/08/13/CreatingACustomAuthenticationSinkForIISSMTPOrExchange.aspx>

WP-DBManager Backup DB Fix For Windows

For this blog I like to use a plugin called WP-DBManager. It's a great tool for easily maintaining your blog's database right from the administration console. Unfortunately, being on a Windows host, sometimes plugins don't work as intended, so you have to make some adjustments.

For this plugin I kept getting this error whenever I tried to run the backup script:

Warning: filesize(): Stat failed for (blah, blah)
Warning: unlink(blah, blah) no such file or directory

To fix it I had to do a few things:

1. The actual command to create the backup needs to be fixed, so it can run properly on the command prompt. Find the file named database-backup.php in the plugin's directory. Place double quotes around the path part of the command and remove all others. Lines 47 and 51.

$backup['command'] = '"' . $backup['mysqldumppath'].'" --host='.DB_HOST.' --user='.DB_USER.' --password='.DB_PASSWORD.' --add-drop-table --skip-lock-tables '.DB_NAME.' | gzip > '.$backup['filepath'];

$backup['command'] = '"' . $backup['mysqldumppath'] . '" --host='.DB_HOST.' --user='.DB_USER.' --password='.DB_PASSWORD.' --add-drop-table --skip-lock-tables '.DB_NAME.' > '.$backup['filepath'];

2. The function that runs the command is called execute_packup(). This function is located in a file named wp-dbmanager.php in the plugin's directory. Find this function (line 205) and remove the if statement and leave only the passthru() command. Similar to this:

function execute_backup($command) {
	$backup_options = get_option('dbmanager_options');
	check_backup_files();
	/*if(substr(PHP_OS, 0, 3) == 'WIN') {
		$writable_dir = $backup_options['path'];
		$tmpnam = $writable_dir.'/wp-dbmanager.bat';
		$fp = fopen($tmpnam, 'w');
		fwrite($fp, $command);
		fclose($fp);
		system($tmpnam.' > NUL', $error);
		unlink($tmpnam);
	} else {*/
		passthru($command, $error);
	//}
	return $error;
}

3. If you want to have the gzip functionality you will need to download and place gzip.exe in the system32 folder of the server. You can download gzip from here.

NOTES:

  • Make sure the the Internet Guest Account has write permissions to the backup-db directory.
  • There is probably a better way to do this, perhaps using the exec() command in the if statement, but this one seems to work just fine.
  • Not necessary - On my server I had to put @ symbols in front of the filesize() and unlink() functions in the database-backup.php file, so that the they would not throw the php warning message and continue through to show the actual error message on the plugin page.

Windows Registry Tweaking Software

RegToy is a free program for tweaking settings in Windows. It will pretty much let you change any setting there is to change. It works very well and the install is very straight forward and simple. I've only tested it on Windows XP, but it should also work with Vista and Windows Server 2003. It also comes with a bunch of other utilities like SecureDelete, MemoryCleaner, and FileEncryptor to name a few. (For a complete list click here.)

Download Link

Windows XP New Look

Over time I've grown very tired of the same old Windows XP look. I've tried using some other themes, but installing them properly is a little time consuming, so I've given up...That is until I recently discovered XPize!

Xpize is basically an installer that changes the Windows XP GUI by installing a new theme, new icons and images and even adds some new programs like a better task switcher.

Have a look at their main site for more information: http://www.xpize.net/

One thing to note is that this program does update DLLs as many icons are embedded. I was a little worried at first, but after using it for some time, I think it's pretty stable. At least as far as I can tell, nothing seems out of the ordinary.

Moving Server to New Hard Disk

I recently built a new web server. (Yes, the very sever that served up this page…) After I got all the hardware connected and I turned it on, I immediately noticed the hard disk was humming louder than the drive in the old server. I didn’t really pay much attention to it thinking it wasn’t all that loud, so I proceeded to install the operating system and countless other programs. After I was finished several hours later, I realized the not-so-loud humming of the drive was indeed too loud.

I decided I had to replace the drive, but I didn’t want to reinstall everything, especially since I had just finished getting everything just right. I started to think of a way to do this and immediately I knew what to do. It was the perfect opportunity to test out this new software I blogged about a few weeks back. DriveImage XML allows you to create a clone or backup of a system and then restore it later. This was exactly what I needed.

Here is what I did to move my server to a different drive:

  1. Downloaded and installed DriveImage XML on the server.
  2. Created a compressed backup of the system drive (c:\) to secondary drive (d:\).
  3. Shutdown the server.
  4. Installed the new empty drive as a third drive in the server (e:\) and booted the server.
  5. I restored the backup onto drive (e:\) using DriveImage XML.
  6. Shutdown the server.
  7. Removed drive (c:\), put drive (e:\) in it’s place and booted the server.
  8. When the server came back up, it was running on the new hard disk.

Yes, it was that easy! The server was about 4GB in size, but the backup image only took up 1.7GB compressed. The whole process took about an hour with the backup itself taking only about 25 minutes. The rest of the time was used up by the physical installation. (I had a few issues with drive jumpers…)

Great Free Tool for Disk Cloneing and Backup

Screenshot

DriveImage XML is a freeware program that can take your “C:\” drive on your Windows pc and make an exact clone of it.

This is great if you want to replace your old hard drive with a newer, higher capacity disk, or if you simply want a quick and easy way to backup your entire system.

For more details and a great video tutorial, please visit the link below. You will find a help file, a FAQ page, and a link to the video on YouTube.
http://www.runtime.org/documentation.htm (Scroll down to DriveImage section)

Defragmenting the Hard Drive

Defragmenting the hard drive is very important in order to maintain good overall system performance in a Windows environment. Here is a tool that works very well and it’s not very expensive. It has several different modes of defragmentation and a very easy way to schedule jobs as well. It is a must-have utility for Windows users.

Download a 30 day, fully functional trial from O&O Software here

defrag image

WhoLockMe Explorer Extension

How many times have you gotten that annoying Windows error telling you you couldn’t delete a file or a folder because it was locked by another user or program? Way too many to remember, I’m sure!

errdelfilefold.jpg

Finally I found a utility that really helps. Microsoft should buy it and make it a standard part of Windows. I can’t help but wonder why Windows can pop up an error box telling you that a file or folder is locked, but can’t tell you which specific user or which specific program is doing the locking?

Anyway, here is the link to this wonderful little app.

http://www.dr-hoiby.com/WhoLockMe/index.php

Windows XP Themes

Royale Remixed Theme

This is one of my favorite XP themes ever. It is a black theme based on the Windows Media Center theme. It has some nice new icons and excellent sounds too. Please check it out at the link below: (Don’t forget to install the Uxtheme patch before you install the theme…)

http://forums.hardwarezone.com/showthread.php?t=1467751

Zune Theme

This was my fav until I found the Royale Remixed…

http://www.zune.net/en-us/meetzune/software.htm