Home
the TextToolKit blog
Improving VPS reliability via Automatic Restart PDF Print E-mail
Written by Dennis Reinhardt   
Monday, 31 January 2011 18:37

I have a program I am running on a Windows 2003 server under a VPS (Virtual Private Server).  For some reason, the program will simply stop running.  This happens infrequently.  I know one reason is that the underlying hardware is rebooted and the VPS is not started properly.  I can log in remotely via RDP (Remote Desktop) and restart but this is a manual process which is inconsistent with running a 24/7 service.

I have been taking statistics on two different services and this appears to occur on both.  Maybe there is some fundamental problem but in the meantime, I want an automatic restart.  This posting describes how I implemented a restart.

On a spare Windows computer, I monitor the sites with a free program called Integrio Uptime Scout.  Every 5 minutes, I check both sites via an http url.  If the site respones with a known response, the site is up.  Otherwise it is down.

Integrio Settings

You have to set up the email by clicking the Email settings button.  In the dialog which comes up, click the Change texts button to customize the message.  By default, the message will do parameter substitution so that you can tell which server is down.  You will need to use this information if you are monitoring more than one server.

 Each server is set up with a url and phrase to verify:

Server Details

I did not have any success with the Text option and use the Regular expression instead.   As long as the phrase you are testing for does not have any speciial (i.e. puctuation) characters, the phrase you are looking and the Regular expression are identical.

Before we leave this screen, notice that you can run a command on server fail.  If we were checking a single server, we would want to use this option.  However, we need to run a different command for each server.  In our case, we previously wrote custom software which runs commands based on parsed emails.  Some email clients allow for writing rules or filters which do the same thing: run a command based on the contents of an email.  You will have to customize this step to your own situation.  If you cannot do that, you will be restricted to a single server and using the Integrio screen above.

Here is a typical command file that we want to run:

Command to run

 We start an RDP file (below) to connect to a remote desktop session.  The Ping Command delays 35 seconds and then the RDP session is killed with the tskill command.  The blacked out part is merely the name of the RDP file, which I happened to name for the server.

OK.  Now lets turn to the construction of the RDP file. 

the RDP file

We enter the login information to the RDP session on the General screen.  We save the settings as a RDP file and use Open to recall it if we need to edit.  On the Programs file, we give the path to the program we want to run on the server.  Let me repeat: on the server.  So the path is the path on the server. 

In our case, we re-run our application.  If the application is already running, it exits silently.  If it is not running, this step brings it back up.

The other three tabs on the Remote Desktop options screen are not critical.

Last Updated on Monday, 07 March 2011 09:37
 
Web Site Icons for iPad, iPod, iPhone PDF Print E-mail
Written by Dennis Reinhardt   
Sunday, 02 January 2011 12:09

I am grateful to acknowledge the instructions which enabled me to make an iPad icon but my own process is sufficiently simpler that I thought it valuable to document what I did.

First, any visitor using an iDevice can bookmark your website onto their desktop.  However, this distorts, shrinks and colorizes your site to produce something ugly and undistinguished.  What you want is to supply your own icon.

The icon for an iPad is 72x72 pixels and 57x57 pixels for iPhone and iPod touch.  You do not need separate icons.  Indeed you cannot specify them separately.  The icons will be re-sized.  Let's say you start with an 800x800 original.  You could resize this to 72x72 to optimize for iPad and post this on your web site.  The 72x72 will be resized on iPhone.

Instead, what I do is resize to 144x144.  For iPad, a second resizing is done to 72x72 within the iPad and a second resize to 57x57 on the iPhone.  This improves the icon on the iPhone since the resize is based on a better image but slightly degrades the iPad since a second sizing is introduced. Whatever.  I want you to be aware that you have a choice in what size image to post.

Let's say the image you post is called iicon.png.  The name is pretty arbitrary and I am guessing that the format is not confined to PNG but I have not verified that.  If your image is in your web site root path, then you would add the following to your web site head section:

Of course you give the complete path (or absolute URL) and change the name to reflect what you actually call it.  Note that it is not necessary or possible to specify the dimensions of iicon.png.  The browser will figure that out.

The icon will appear with rounded corners and a lighting effect applied:

 simulated icpan icon

I do not recommend that your try to duplicate the beveling and lighting effect.  Rather, upload a flat image with no transparency:

Raw iPad image

and the effects will be applied automatically (and consistently!) in the iDevice.  This flat image is much simpler to develop than trying replicate what is already there.

Last Updated on Monday, 07 March 2011 09:34
 
Copyright © 2012 TextToolKit. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.