MUSINGS

Where in the world is my server? Or how to change timezone on a Debian Lenny 5.0 computer

Where in the world is my server? Or how to change timezone on a Debian Lenny 5.0 computer

One of the most important functions a computer does is to keep time. For instance in a Windows AD environment if the Servers and client computers are more than 5 minutes askew then Kerberos authentication will fail. In other words they refuse to talk to each other. Try supporting that.

To ensure your computers are all on the same time use an NTP server to synchronise against. That will keep all the computers on the same time and make your support team’s life happy. Exactly how to Setup an NTP daemon such as ntpd or the Windows time service will be the subject of another post.

So let’s assume your computer is nicely synchronising but you check the time and it’s out by 4 hours. What do you do? Read more about Where in the world is my server? Or how to change timezone on a Debian Lenny 5.0 computer

How to centre a block element on the page using CSS

How to centre a block element on the page using CSS

In the past I’ve always used the following CSS code to centre a DIV (or other block element) on a page.

#divid {
  width: 620px;
  left: 50%;
  margin-left: -310px;
}

It works by setting the left edge of the div at 50%, which if it containing element is BODY then we are setting the left edge to 50% of the page. If we left it at that then the DIV would start at half way and not be centred at all. The trick is to set the left margin “margin-left” to be negative half of the DIV’s width. This forces the DIV back towards the left by half and therefore you end up with a DIV centred on the page.
Another method is to use the following. Read more about How to centre a block element on the page using CSS

How to turn on auto adjust for daylight savings using a VBscript

How to turn on auto adjust for daylight savings using a VBscript

Daylight savings changes can often pose a problem for IT support professionals. Usually these issues arise when governments decide to change daylight savings rules or your organisation operates in multiple time zones. A common problem often encountered is the computers clock doesn’t adjust for daylight savings time. This can occur because either the wrong time zone is selected or the “Automatically adjust clock for Daylight Saving Time” is deselected in the time zone settings. For example the Queensland time zone may be selected for a Hobart computer which means the time will be correct until daylight savings kicks in and then the time won’t adjust.
In the first example the solution is to change the computer to the correct time zone. In the second example the solution is to simply select the “Automatically adjust clock for Daylight Saving Time” option, but what if you need to apply the setting to multiple Windows computers? The answer is to use a script via group policy or other method.
The following simple script will re-enable daylight savings. Read more about How to turn on auto adjust for daylight savings using a VBscript