Archive

Posts Tagged ‘Computers’

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 launching new web browser ;)

September 1st, 2008 No comments

I’ve been impressed by all of google’s offerings thus far – should be interesting to see what they do in the web browser domain.  Check it out… launches first thing on Tuesday:

http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html

Categories: Personal Tags: ,

Randy Pausch – A true inspiration…

July 25th, 2008 1 comment

If you don’t know who Randy Pausch is — well — you should.  He was diagnosed with cancer last fall – told he had 6 months to live.  Well – his time to return home has come, he passed away this morning – he beat the 6 months, but cancer finally caught up with him.  Fortunately for us – the cancer didn’t really beat him though – he showed each of us that we have the power within ourselves to reach our dreams, regardless of what odds are stacked against us.

I watched his “Last Lecture” just a few days after it was posted online.  It inspired me to action – and his death reminds me of the commitments I made to myself nearly a year ago.  I have dreams to accomplish – and need to set out to accomplish them – regardless of the trials that beset me.  If you haven’t seen it yet – I’d start by watching it (it is an hour – so be sure to set aside an hour that you won’t be interrupted – it is worth it):

Randy – you have left a legacy behind you.  To Jai and your children – we are praying for you – and I know that Randy is hard at work preparing the path for each of you once you one day meet again in the life to come.

Thanks Randy for making this world a better place than it was before you came.

Categories: Personal Tags: , , ,

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: , ,

EgdelWonk

May 14th, 2008 No comments

So, this semester (my last one with classes) is now over.  I was in a video game development class this semester, and had a ton of fun making an educational (and fun) video game targeted at the 1st grade level (in math).  It’s not all math problems – but rather primarily a space war in which you pilot your ship in order to catch up with Distractor and take him down.  The math comes in as you attempt to use power-ups found along the way… they are locked, and the only way to unlock them is by solving math problems…

(Intro Sequence for Space War)

(Molly helping you with a math question)

(Fighting the Boss “Distractor”)

… it was a true group effort – I was one of 3 in my team, and we spent quite a bit of time and effort coming up with a back-story, etc… which is somewhat integrated into this working demo.  You can listen to the story-line in the game by selecting the Story option — or if you want to just jump into the action – select the Space War option (the only module we had time to implement).  I’m actually interested in furthering the game a bit, as my kids actually enjoy playing it.  I’d love to hear any feedback you might have!

So, how do you install it then?  Not as easy as I’d hope — but you’ll first need to get some prerequisite applications on your Windows XP or Vista computer:

.NET 2.0 (Windows XP Only)

.NET 2.0 SP1 (Windows XP Only)

Vista SP1 (Windows Vista Only)

DirectX 9.0c (Both XP & Vista)

XNA Runtime 2.0 (Both XP & Vista)

Once you’ve got the above pre-requisites installed… then download and install EgdelWonk (26MB).  If you happen to have an XBox 360 controller – plug it into your computer and use it… as we designed/tested/developed the game specifically for the XBox 360.  You can play it with the keyboard – but the gameplay is much better with the XBox controller.

Again — let me know what you think!  It was fun to make, hopefully you’ll enjoy playing it (or having your kids play it)…  Bonus quesion — who plays the voice of Molly?

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: ,

Migration…

April 17th, 2008 No comments

So – I’ve finally migrated over to an actual server that is not located in my own home.  Don’t get me wrong – I still have the old server at my home, but I’m hosting on an external server now, in hopes that it’ll free up more time.  Time will tell – if I actually do free up some time, I suppose that means I might have time to blog some more – which is something I’d like to do… cross your fingers :)

Categories: Uncategorized Tags:

High School Reunion – Tracking Alumni

September 2nd, 2007 No comments

I originally created a website / alumni tracking tool for my 10 year high school reunion (see http://www.mayfield95.org/) about two years back.  My wife, who also graduated in 1995, saw the site – and figured, hey – why not re-use this for my 10 year reunion?  Thus… I ported the code over for her 10 year reunion (see http://www.goddard95.org/).

One of my brothers is getting ready to help put on his 20 year reunion, and asked if he might be able to take advantage of what I did for our reunion to track alumni, get tickets purchased, etc… and so I figured I’d take the opportunity to make my code more generalized so that the next time I’m asked to port it for another high school – it will *cross your fingers* hopefully require only copying some files, copying a database structure, and then modifying a single configuration file.

Anyhow – so taht is what I did… the site looks awfully similar – but the code behind it is much more general pupose now (see http://www.mayfield88.org/ for my brother’s site).  Yup… leave it to me to spend more time just make the behind the scenes stuff look better w/no change to the front end :)

Categories: Uncategorized Tags: ,