11h.net

The blog of 11h

August 13th, 2008

Sending DHCP IP based on clients hostname

I’m working on a project where I need my DHCP server to send an IP address from a specific DHCP range if the hostname is a certain value otherwise it needs to send a normal IP address range.

I’m using Internet Systems Consortium DHCP Server V3.0.3 (ISC-DHCP).

To give a specific address range, we first need to detect if the DHCP client is sending the option 12 host-name and if so assign it to a class.

class “FooBar” { match if (option host-name = “foobar”); }

Once the client has a class associated to it we need to give it an address from a pool that doesn’t deny it.

subnet 192.168.0.0 netmask 255.255.255.0 {

Other DHCP settings here but make sure that the range is not specified; it overrides the pool settings.

pool {
allow members of “FooBar”;
range 192.168.0.90 192.168.0.99;
}

Otherwise we want the systems that don’t specify a hostname to get an address from the normal IP address pool

pool {
range 192.168.0.254 192.168.0.100;
}

Add more pools if needed

} # ending the subnet declaration

Pretty simple, hu?

UPDATE:

Thanks to a post I read by Bill Stephens of the PepsiCo Business Solutions Group, you can match a hostname using substr.  If your DHCP clients are named foobar-xyz you can use substr to match for foobar:

class “FooBar” {

match if ( substring(option host-name,0,6) = “foobar”);

}

(This would match the first 6 characters of the option 12 host-name)

May 20th, 2008

no network provider accepted the given path

I received the following error today when trying to open a samba share on a FreeBSD system from a clean Windows Server 2003 install:

“no network provider accepted the given path.”

“PC LOAD LETTER, what the fsck does that mean?!” I thought to myself. After some digging, I found that the default LAN Manager authentication level is set to NTLM response only and not LM & NTLM response.

Fix for the issue:

Administrative tools -> Local Security Policy -> Local Policy -> Security Options

Change: Network security: LAN Manager authentication level

From: Send NTLM response only

To: Send LM & NTLM responses

May 9th, 2008

Solar water heating

solar heater using black plastic irrigation hoseI recently created a solar water heater for a pool in France. Since I had a limited set of tools and could not make anything permanent I had to use materials that were cheap and reusable or recyclable. What I ended up with was a 50 meter long by 13 millimeter in diameter irrigation hose.

Plastic is an absolutely horrible heat conductor. Most people who use irrigation hose for solar water heating live in areas where it is hot and sunny and/or does not get very cool. Or they do not care about the absolute best efficiency of their solar collector.

Even though I knew that plastic is a terrible conductor of heat, I still pressed on with the heater.  Last summer the pool was too cold to swim for very long so any, _any_, additional heat would be better than nothing.

I laid out the pipe in an elongated spiral as I did not have the room for a closely packed spiral like The Sietch’s irrigation pipe solar water heater in Hawaii.

Once the pool was actually opened, the water temperature was 14 degrees Celsius. Damn, that is cold. I set the one of the pool’s pumps to push about one liter (litre [sic]) of water per minute through the hose. However, flow rate is really not important as the amount of energy the pipe collects would remain the same.

Now that we have flow through the pipe on a nice sunny day I was quite pleased to feel hot water come out of the end of the pipe!
To calculate the effectiveness of the heater I need to do some calculations. We will need to know the amount of water in the irrigation pipe, the input temperature to the pipe, the output temperature of the pipe or collection of water, the flow rate, and the time it took to raise the temperature.

Temperature change = 13 degrees Celsius
Pipe length = 50 meters
Pipe diameter = 13 mm
Volume of water in the pipe = 5000cm*pi*0.65cm^2 = 6,636.62 cubic centimeters = 6.64 liters
Flow rate = 0.7 liters per min
It takes 9.48 minutes to exchange the water in the pipe
The specific heat of water at 14 degrees Celsius is about 4.186 kJ/kgK
The density of water at 14 degrees Celsius is about 999.2 kg/m3
There are 3.6 kilojoules per Watt hour

Q = cmT Where:
Q = heat added in kilojoules
c = specific heat in kilojoules/kilogram degrees Celsius
m = mass in kilograms
T = temperature change

For a 1 degree change we see:
Q = 4.186*(6.64*.9992)*1
Q = 27.75 kilojoules
Q = 7.71 Watt hours

For a 13 degree change we see:
Q = 4.186*(6.64*.9992)*13
Q = 360.68 kilojoules
Q = 100.19 Watt hours

My father says “Efficiency doesn’t matter. It is what it is”
My step mom says “You have TPS - Tiny Pipe Syndrome”

Interestingly, with the pool open (no solar bubble wrap cover) and this heater running, the temperature in the pool rose 3 degrees Celsius the first day even though it has been about 8 degrees Celsius at night.
The pool has about 50000 liters of water in it. It’s 5 meters by 10 meters by ~1 meter.
Q = 4.186*(50000*.9992)*3 = 627,397.68 kilojoules = 174,277.1335 Watt hours

I know that this small heater didn’t do that! I’ll bet that Earth’s solar flux of 1380 Watts/meter^2 has a little something to do with it though.

Overall, for 30 Euro’s this might mean that the pool is more comfortable and can stay open a few days longer this summer.

I’d like to make a collector out of copper painted flat black to see what it can do in the Pacific Northwest.

*UPDATE 10 May 2008* looks like this heater is working quite well. I had to change the pump flow so it is much faster but I am seeing a three to four degree rise in temperature from the input to the output. That is 23 to 30 Watt hours of heat being added to the pool eight to 10 hours per day. The pool is now up to 18 degrees C - four degrees warmer in three days.

May 6th, 2008

Pinball: France has a pinball machine!

Terminator 3 pinball in Montpellier, FranceI’ve been traveling recently and on my travels I have searched for pinball machines, however none have been found. Until now!

I was in France last November and during that time I never saw a pinball machine. Of course I didn’t travel too far out of the Gard département.

Three weeks ago I flew to Taipei, Taiwan to give a presentation on some Open Source software and some additional software that I wrote for SGPIO (SFF-8485). When I was in Taipei I didn’t see any pinball machines. I did see lots of iPod knock-offs in the electronic markets though.

And now I’m on vacation in the South of France; I flew from Taipei to the Pacific Northwest to Amsterdam to the South of France in less than two days. Roughly 12,000 miles in 48 hours. And I wasn’t even jet-lagged!

I had just about given up on keeping an eye out for pinball machines in foreign countries until last night when I was walking around Montpellier with some friends. There it was. A Terminator 3 pinball machine. Unfortunately, I did not notice which bar it was in!

January 13th, 2008

How to: Make a cheap monitor stand

A while ago, I picked up a several 17″ LCD monitors for pocket change. They were old monitors from a school district in the Seattle area that had upgraded their computers. The only problem with the screens was that they didn’t have any stands. I’ve had the screens for almost a year and I haven’t used them solely because I haven’t found a stand for them. Today, I finally gave up finding cheap stands and just made some. The following is a quick how to make a LCD monitor stand.

Materials:
acrylic sheet (anything larger than 32cm x 12cm and 0.23622 cm thickness)
aluminum foil
ruler
drill
drill bits
screws
heat source
plastic cutting knife

First, cut a piece of acrylic about 1cm wider than the center of the mounting holes on each side on the mounting area on the screen and long enough to reach the bottom of the screen plus a little extra. The extra is so that you can bend and create a base for the screen. For my Dell screen I cut a 12cm x 32cm piece. That leaves 1cm width of extra acrylic on each side and a lot on the bottom.

Next, mark on the acrylic where the mounting holes reside on the back of the screen. The holes on my screen were 10cm apart in a square. Drill the required number of holes in the diameter of the screws. Make sure it mounts properly.

Measure or eye where the acrylic will need to bend to be effective to hold up the screen.  Cover the acrylic that you do not want to bend in aluminum foil. Leave about a 1cm gap where the acrylic will bend. The foil will help protect the acrylic from getting hot enough to be malleable.

Use a heat source to heat the acrylic. I used my stove. Hold the work piece over the heat source until it begins to bend on it’s own. Why work when gravity will do it for you!

Once the work piece is hot, bend to a 90 degree angle. The weight of the screen will cause this thin acrylic to bend a bit.

If you feel adventurous, you can repeat the heat bending process to make a neat base.