Month: February 2007

CFEngine in mixed Solaris, Linux, environments

If you’ve ever tried to use CFEngine for package management, you know that it is basically useless.

  1. CFEngine only supports installing packages and not removing them (yet).
  2. It has some crazy limit defined at compilation time which limits the number of packages you can install. (see Google://cfengine “Too many arguments in embedded script”)
  3. It merges all your package work into one logical section even if you logically split up the sections and had them in a certain order etc.
  4. etc.

What comes out of all this is that you are better off using repository aware package management tools via the shellcommands actions (IMHO).

In the case of Solaris, the choice of champions seems to be pkg-get ala bolthole and blastwave.
In the case of Debian/Ubuntu, use apt-get.
This also means you no longer need to copy your package files using the cfengine copy actions since these tools will automatically retrieve them from your custom repository.

For those wanting to set up a pkg-get repository, the makecontents script should help you on your way.

Redundant power for single power supply

Someone recently asked me how to setup redundant power for a rack of machines without relying on all the equipment to have dual power supplies.

The answer is called an Automatic Transfer Switch. Depending on the sensitivity of your equipment to momentary losses of power, you can choose between an Open Transition Transfer Switch and a Closed Transition Transfer Switch.

  • Open Transition Transfer Switch – This switch always makes the connection to the secondary power supply a split second after the first connection dies.
  • Closed Transition Transfer Switch – This switch will make the connection to the secondary power supply before the power from the first connection dies if possible, ie. the first connection is browning out, etc. In this case the switch briefly connects both power sources with an overlap time under 100 ms. This way there is never a complete loss of power.

Transfer Switches are not unreasonably priced considering the prices of an additional power supply for some servers but they do not solve single point of failure problems- If your single power supply fries, having a second feed won’t help it 😉

Setup PPTP on Ubuntu

Here is a quick howto on installing and setting up PPTP on Ubuntu.
Specifically I’ll be attempting to configure this machine to use the Israeli ISP 012 over a cable modem. 012 provides some sort of installation package for Linux but it doesn’t support Ubuntu.

Anyway- here are my steps:
xhost +
sudo su-
export DISPLAY=’:0′
echo ‘deb ./’ >> /etc/apt/sources.list
apt-get update
apt-get install pptp-linux
apt-get install pptpconfig
Use the server and the user/password provided by the ISP

Set the Cable connection to by your default route (All to Tunnel)

Select ‘usepeerdns’ enabled (Automatic)

Set the tunnel to reconnect if disconnected.
Use the following pppd options:

noipdefault noauth default-asyncmap noipx defaultroute hide-password nodetach maxfail 1 lcp-max-configure 6 linkname cable ipparam cable-pptp userpeerdns persist mtu 1460 mru 1460 noproxyarp noaccomp nobsdcomp nodeflate nopcomp user cable lcp-echo-interval 20 lcp-echo-failure 3

Click Add and Start
Now if you don’t have a network connection which is very likely you will need your ubuntu cd and these files from the apt source we added:

Instead of the ‘apt-get install pptpconfig’ step above do:
dpkg -i php-gtk-pcntl_1.0.0-2_i386.deb
dpkg -i php-pcntl_4.3.8-2_i386.deb
dpkg -i pptpconfig_20060821-0_all.deb

Samba Permissions and Backup Exec

I recently started using Symantec’s Backup Exec for Windows to backup files from a Samba share. I joined the Samba machine to the domain and gave the backup user permissions to the share but the backup kept getting access denied errors.

It turns out that Backup Exec doesn’t connect directly to the share (at least that’s not how our people set it up). It connects tot he IPC$ share and expects to find what to backup in the list of the machines shares.

Basically, I had to grant the backup user access to the IPC$ share as well. This tricky one slipped through testing since connecting directly to the share (ie. \\machine\share\) worked the whole time.

Format Excel numbers as GB, MB, KB, B

Here is a great tip for formatting numbers in Excel as Gigabytes, Megabytes, Kilobytes, Bytes, etc.
Use the following formula:


The same formula will work for Gigabits, Megabits, etc. assuming you start with bits instead of bytes. If you want to convert from bits to bytes in the process, use this formula: