Archive

Posts Tagged ‘Geek’

Sendmail & Mailman on my terms ;)

April 3rd, 2009 No comments

So the ISP I use for hosting (westhost) uses sendmail as its default mailing client, which is fine and dandy.  I moved over to an external host about a year ago now, in hopes to minimize some of the time and work I was spending hosting my own server at my own home.  Westhost gave me the control I still wanted via a virtual private host where I can install apps, configure some server level details, etc… but I no longer have to worry about the hardware, or os upgrades, etc…  Works well.

Well – when I was hosting things myself, I came to like qmail – more specifically I really liked one built-in feature of qmail.  When I setup email accounts, each account automatically received all emails sent to it, and to any email in the form username-anythinggoeshere@domain.com.  For example — if you sent an email to todd-bestbuy@gileszone.com — it would just go directly into my todd@gileszone.com account.  And yes, that was my main use for this, to give out new email addresses to various online stores, etc… so I could better filter, and know which ones gave my email addresses over to others w/out my permission.  Several of my siblings also enjoyed this feature, and used it widely… so when I switched over to sendmail on this new host — I had to figure out how to get this same functionality (or many emails would not be directed into their proper home).

Turns out that sendmail does a very similiar thing out of the box, but they decided that the + symbol is the one to use, not the -.  So todd+bestbuy@gileszone.com worked as I wanted it — problem is, that is not the email address that best buy has on record (and it also invalidated many other email addresses I’ve given out).  Well — after searching far and wide, and coming up to speed on sendmail, and the intricacies of its configuration file, rulsets, maps, etc… I came across a fairly straightforward addition to the sendmail.mc file to get the behavior that I wanted (thanks to google, and other geeks before me).  A simple addition of the following lines did the trick:

LOCAL_CONFIG
Kplus regex -s1,2 -d+ ^([0-9a-z]{1,64})-([0-9a-z]{1,64})$
LOCAL_RULE_0
R$+ <@$=w.> $*  $: $(plus $1 $: $1 $) <@$2.> $3

It turns out that what the above ends up doing is simply replaces the ‘-‘ character in the part of the email address that comes before the ‘@’ with the ‘+’ character, and then sendmail default behavior takes care of the rest.  I won’t bore you with the gory details, but trust me ;)

Ok — so I also wanted to keep our email lists going that I had on the previous server, and I decided to use mailman for the mailing lists.  Everything was all working fine, except for one small detail — moderator and owner emails to the list where not being sent out.  I didn’t have time to look into at the time, but finally got back around to it this week.  It appeared that all the emails sent to the moderators or owners of the list just dissapeared, never reaching their intended destination.  Well — as luck would have it, my fix to make todd-bestbuy@gileszone.com work, broke mailman.

Mailman uses aliases such as listname-owner@domain.com, or listname-subscribe@domain.com to interact with the mailing list (there are others of similiar form as well).  Well — my earlier fix ended up making any email sent to listname-owner@domain.com to be sent to, yes listname@domain.com.  Ooops!  I had to figure out a fix, so I could start getting my moderator emails going again, and having subscribe emails and unsubscribe emails work (amongst other things).  So back to my good friend google…

… but google didn’t find the solution this time, although it did offer enough information for me to hack together a solution.  In the end, I modified my sendmail.mc file to only do the username-anytext@domain.com –> username@domain.com rewrite if the username was an actual user on my system (i.e. in the /etc/passwd file), otherwise — leave it alone.  It’s working great now, and I can finally go back to sleeping good at nights :)  Here is my final hack (as of now), in case this is helpful to others out there:

LOCAL_CONFIG
Kcheck regex -s1,2 ^(([0-9a-z]{1,64})-([0-9a-z]{1,64}))$
Kplus regex -s1,2 -d+ ^([0-9a-z]{1,64})-([0-9a-z]{1,64})$
LOCAL_RULE_0
R$+ <@$=w.> $*  $: $(check $1 $: $1 $) <@$2.> $3
R$+$|$=l <@$=w.> $*     $: $(plus $1 $: $1 $) <@$3.> $4
R$+$|$~l <@$=w.> $*     $: $1 <@$3.> $4

It’s fun being a geek sometimes ;)  Satisfying to finally bend sendmail and mailman’s will to my own…


Categories: Personal Tags: ,

Chickens turned “Geek” Project

February 20th, 2009 No comments

So, about 6 months or so ago, we decided it would be fun to get chickens.  To be honest, I wasn’t all that excited about the prospect at that time – but Jill and all the kids seemed keen on the idea, so I figured I’d give it a whirl.  To get myself excited, I decided I would turn the project into something closer to things I enjoy doing – yes, I turned it into a geek project.

We had finished building our chicken coop – and winter was fast approaching.  Jill started worrying about how well the chickens would do if it dropped below freezing.  She also wondered how well we had done in insulating the coop itself.  Ah-ha!  My mind started churning… this sounded like a perfect opportunity to pull out some of my “geek” skills and have a little fun!  So that’s exactly what I did.  I started doing some research online, and found several sites that gave me the motivation to move forward with the idea that was forming in my mind.

One site that really caught my eye was Daniel Klein’s thermd site.  He had written an application (in perl) over the years to support monitoring, archiving, and display of temperature (and other weather) data taken from a whole variety of temperature sensors, data acquisition devices, etc…  I had heard a bit about one-wire devices in the past, and thought they would be perfect for what I wanted to do.  I also decided (mostly from reading the info Daniel provided), to purchase a HA7Net Ethernet 1-Wire adapter, and use it as my main communication device to interface with the one-wire temperature sensors that I also purchased.  It was a bit on the expensive side for what I was doing — but I still have plans to use the HA7Net device for many future projects as well, as it can support up to 100 sensors (or so its spec sheet states).

You are likely wondering what this geeky idea that I had was – or perhaps you’ve figured it out after looking through the above sites on the devices and software that I decided I’d use.  Well – for those that can’t read my mind – let me share with you my idea.  I decided I would place a temperature sensor just outside the chicken coop in the shade (to measure ambient temperature outside), and another one inside the coop itself.  I also wanted to have an automated system to turn on a heat-lamp that we’d placed inside the coop on and off dependant upon the temperature inside the coop itself.  Sound fun?  I agree :)

HA7Net / Ethernet Connections

HA7Net / Ethernet Connections

The day the HA7Net arrived – I had to go out and purchase wire so I turn my vision into a reality.  I ended up purchasing some 4-lead twisted pair at a local shop (Electronic Parts Co).  I also ended up picking up a crimping tool, some RJ11 connectors to interface the HA7Net to the twisted pair wire, and some heat shrink tubing to make for a nice clean finish to where I connect the thermometers to the wire.  After some trial and error with a short 3′ section of cable I created for testing my one-wire devices, I was ready to solder the two thermometers to the wire, and mount them out in the coop.  Here’s a look at the HA7Net device as it sits today, mounted on the wall – with my “test” cable mounted on the wall with a one-wire thermometer in it — I decided to just keep this one connected so I could have a monitor of the temperature in my house as well, why not, right?

After I finished soldering the other thermometers together, shrink wrapped um, etc… I initially stapled the wire up the wall, across the roof, and out the window to our coop out back.  As you can imagine – Jill didn’t quite like the new home decor I had stapled to our ceiling (wish I had thought to take a pic), so I eventually (only 1 week or so later if memory serves me correct) cut some holes in the wall – purchased another tool (I love buying tools) to snake the wire through the wall and inside the space between our 1st and 2nd story, and directly out to our back yard.  It does look much nicer I must admit.

1-Wire into wall (instead of across the ceiling)

1-Wire into wall (instead of across the ceiling)

Ok, so at this point, what we now have is three thermometers that we can monitor and archive and plot over time.  I was pretty excited just to get to this point – yes, I’m easy to please ;)  Click here to see the first week of temperature data that my new set of thermometers recorded.

If you looked closely at the first week of data, you may have noticed that by Friday, Nov. 14th that the next stage of my project was in place.  After getting the initial temperature monitoring up, I started working on a solution to automatically control the heat lamp when things got too cold for our pampered chickens.  After doing a bit of research, I decided to use X10’s ActiveHome Pro for the heat lamp automation.  Again, a bit more than I would need to spend for just this single use — but it’s also expandable (i.e. more geek projects in the future).  I purchased a single 3-prong appliance module for this project for controlling the heat lamp, and simply plugged the heat-lamp (through an extension cord) into the module.

For those who don’t know what X10 is – basically, its a way to control devices by sending them signals directly on the power lines, pretty neat stuff.  So all I had to do was to connect the main unit into the wall by my computer and a usb cable from it to my computer, and then connect the module on the other side of the house (in the garage actually).

With this setup, I now have control via my computer to turn power to anything plugged into the module on and off (a heatlamp in my case).  So of course, I wrote a little program to automate the operation of the heat lamp dependant upon the temperature in the coop.  After a few tweaks — it works like a charm ;)  Heat lamp comes on when it drops below 36 degrees, and then turns back off after it warms up above 40 degrees.  Yes – we’re spoiling these chickens, but hey – its fun :)

For those interested in the current temperatures of our chicken coop – and whether or not the heat lamp is on – you can always see the latest here:

http://todd.gileszone.com/thermd/thermd

I’ll post some pictures of the coop, chickens, heat lamp, etc… soon.  I keep forgetting to take them until night, and want to get you something that is visible to see ;)  Plus, I’ve gone on for too long already – I’m pretty sure this is my longest blog post to date — long overdue I might add.  I initially planned on blogging each day as I worked on this project, better late than never, right?

Google Reader

May 16th, 2008 2 comments

In a world that is being filled with more and more blogs every day, how do you keep track of them all? Well – you don’t… but, google reader is sure a nice way to keep track of those you are interested in, as well as share those posts you find interesting with others, etc… give it a try if you haven’t already!

You can keep up to speed with the blog posts I find interesting either on the right hand side of this site, or directly here (all via google reader):

Categories: Personal Tags: ,

There is so much truth to be found in Dilbert…

May 16th, 2008 1 comment

Categories: Uncategorized Tags: , ,

Street View is now in Albuquerque

April 21st, 2008 No comments

I’m quite impressed with the amount of data that Google has collected by camera mounted cars driving through all the streets across the nation.  Albuquerque in particular has been covered quite well – in fact, you can get a perfect view of my house as good as if you had driven by yourself.  For those of you that know my address – just enter it into http://maps.google.com/ and click on street view and there ya go — that’s my house :)

Just to show an example – so you can play around with it – here is the street view of the chapel that we attend church at:


View Larger Map

Quite impressive both in the amount of data they have collected (both satellite, and now street view) as well as the seamless way they present it to the end user.  I’m sure there are privacy concerns from many – regardless – this is quite an amazing piece of work that Google has done, and continues to do.

You can even see the car that the pictures were taken from:


View Larger Map

Neat stuff!

Categories: Uncategorized Tags: ,