Configuring the timezone on Red Hat Linux

March 13th, 2009

I recently set up a server remotely and with much success, however I overlooked the configuration of the operating system’s timezone settings. This is typically set up during the installation of the operating system, but since the dedicated server provider performs the installation for customers, it is a step that can be easily overlooked when setting up a server that is provided by another party.

A quick search for “redhat timezone” returns Tips & Tricks: Changing timezone. In summary, the ZONE field of the /etc/sysconfig/clock file is updated to point to a file that is located in the /usr/share/zoneinfo directory tree. A symbolic link to the file located in /usr/share/zoneinfo directory tree should also be set at /etc/localtime.

The Tips & Tricks article at redhat.com recommends a reboot after setting these files up.

After the reboot, running ntpdate and configuring the ntp service is advisable. Checking that the timezone configuration is patched with ‘zdump -v /etc/localtime’ is also advisable.

Strategy-like Pattern in PHP

February 19th, 2009

Today, I had some time to write a little program while I was watching people work on the infrastructure at the office. I wrote up a couple of functions that calculated the n-th Fibonacci number, and wanted to display the sequence of the first 100 numbers as they were calculated by these functions. At first, I had something like the following:

<?php

  for( $i = 1; $i < = 100; ++$i )
  {
     printf( "%d ", fibonacci_tabularized( $i ) );
  }

  for( $i = 1; $i < = 100; ++$i )
  {
     printf( "%d, ", fibonacci_iterative( $i ) );
  }

  for( $i = 1; $i < = 100; ++$i )
  {
     printf( "%d, ", fibonacci_recursive( $i ) );
  }

?>

I quickly realized how horrible it was. That sure is a lot of duplicate code! So, I ended up rewriting it so that it looks like this:

<?php

  function print_fibonacci_sequence( $strategy, $n )
  {
    for( $i = 1; $i < = $n; ++$i )
    {
      printf( "%d, ", $strategy($n) );
    }
    printf( "\r\n" );
  }

  $strategies = array(
    "fibonacci_tabularized",
    "fibonacci_iterative",
    "fibonacci_recursive"
  );

  foreach( $strategies as $strategy )
  {
    print_fibonacci_sequence( $strategy, 100 );
  }

?>

Viewing More Work with Multiple Displays

January 16th, 2009

A news story at The New York Times, Boss, I Need a Bigger Screen. For Work Efficiency, of Course., professes the benefits of using multiple displays or a bigger screen while computing. The article’s writer, Farhad Manjoo, points to research at the University of Utah that observed a 44% increase in productivity when multiple bigger displays were used.

I can personally attest to the usability of multiple large displays. Rather than spend time manipulating application windows to fit a screen. I can quickly open two application windows that can be viewed simultaneously. It’s as easy as drag, drag, double-click, double-click. I can have software documentation open in one screen while software implementation is performed on another screen without derailing my train of thought or suffering from a mental context switch that is induced by window shuffling.

Disconnected

December 19th, 2008

A recent news article reports that a communications cable has been cut, affecting Europe, Asia, and the Middle East. This has happened before, but it did not seem likely to me that it would be something that would reoccur. The article on BBC quotes Interoute’s Jonathan Wright, “For this to happen twice in one year, on the same cable, is a serious cause for concern.”

As network disruptions become common, the disconnection of transoceanic lines should be a concern to IT administrators that manage company networks that are distributed worldwide. Distributed networks should be implemented in such a way and as much as financially feasible to allow for continued operation of the distributed sites when connections are severed. Outages occur and may last several days, if not weeks. Without a resilient company network in place, a lot of resources may be underutilized resulting in an increase in operating costs. A resilient company network shall minimize the loss of utility from company resources in the event of a network outage.

Developing GUI Applications on Linux

December 4th, 2008
Posted in Linux / Unix | 4 Comments

I’ve been looking for an API for cross-platform application development in my spare time. I would like to target GNU/Linux environments for an application that I am looking to develop as a hobby, but I would also like to make the application available to the larger pool of Microsoft Windows users. I am seriously considering GTK+. The GTK+ project described GTK+ as “a highly usable, feature rich toolkit for creating graphical user interfaces which boasts cross platform compatibility and an easy to use API.”