February 17th, 2009Bending Apache ANT

By reading this site lately you would think I had given up my day job as a software developer; however, that is not the case. On the contrary I have been very busy with several projects. One such project is piecing together a continuous automation package. Basically, cron on steroids. I could have just used cron to do everything, but I needed standard reporting and logging features that would have been replicated in every cron script. That said, I decided to use CruiseControl and ANT. These tools are usually used in a software build environment, but they adapt nicely to other types of automation projects.

For my project I setup a standard CruiseControl, ANT build loop on a Linux server, and all was well…until one of the remote servers I connect to became eratic. I, unfortunately, do not have control over the remote server so I had to figure out how to put failure tollerance into my build loop. In a nuthsell, I needed to keep running the ANT script in a loop until I received what I was looking for. To complicate matters, I had to do this on a once a day basis as well. The primary problem with my setup is that CruiseControl does not have the ability to loop until success. Complicated problems call for creative solutions.

To get around the issue I decided to use a simple text file and a modification set inside of CruiseControl. Because of the sceduling I also had to use two CruiseControl project blocks. The first project block is on a daily schedule to call an ANT script and modify the “setup” file.

<project name="setup" requiremodification="false" buildafterfailed="true">
<modificationset>
<alwaysbuild/>
</modificationset>
<schedule>
<ant antscript="/usr/bin/ant" buildfile="build.xml" time="0800" day="monday" target="setup" />
    <ant antscript="/usr/bin/ant" buildfile="build.xml" time="0800" day="tuesday" target="setup" />
    <ant antscript="/usr/bin/ant" buildfile="build.xml" time="0800" day="wednesday" target="setup" />
    <ant antscript="/usr/bin/ant" buildfile="build.xml" time="0800" day="thursday" target="setup" />
    <ant antscript="/usr/bin/ant" buildfile="build.xml" time="0800" day="friday" target="setup" />
  </schedule>
</project>

Every week day at 8:00 AM an ANT build script is called and the setup target is ran. This target touches the setup file making it appear that it was modified. Here is the setup target from the ANT script:

<target name="setup">
<touch file="setup.txt"  />
</target>

At this point the second CruiseControl project block springs into action.

<project name="run" requiremodification="true" buildafterfailed="true">
<modificationset>
<filesystem folder="setup.txt"/>
</modificationset>
<schedule interval="1200">
<ant antscript="/usr/bin/ant" buildfile="build.xml" />
</schedule>
<publishers>
<onfailure>
<antpublisher antscript="/usr/bin/ant" buildfile="build.xml" target="setup"/>
</onfailure>
</publishers>
</project>

This project block runs every 20 minutes looking for a modification to the setup file. Because the first project modified the file at 8:00 this project will take notice and start running. If things go well this project executes once a day shortly after 8:00 AM. However, if the script fails, which it often does due to a connection timeout, I have safeguards in place to loop back and start over again.

If you notice there is a buildafterfailed parameter in the project tag. This tells CruiseControl that it is okay to run the project again if the previous run failed. This alone will not loop the project it merely states that it is alright to do it again. The real magic happens in the <onfailure> tag; this tag is only executed when the project exits with an exception. Inside of that tag I make a call to the same target I used in the first project. This target changes the date on the setup file again making it appear to be modified. When that happens the build project will run again on the next cycle because there has been a modification since the last execution.

This loop will continue until the build script in the second project exits cleanly or CruiseControl is stopped. Do note that it is possible to create an infinate loop this way. Make sure that the primary target in the build file will exit cleanly. It is also a good idea to have CruiseControl email you on failure and success.

January 17th, 2009Garden Planning

Finally, it is time to start planning for our 2009 vegietable garden. Last year was the trail run to see if we could pull off producing something from the ground. After such a successful 2008 garden we are going to go all out and really try to produce some food in 2009.

This year we are moving from the raised beds to a large in-ground plot. The main reason is because we need the space. The other is because the soil I put in the raised beds was too sandy and needed some clay. In our area, most of the exsisting soil is clay. Tilling up the plot and throwing the dirt from the raised beds in the mix should give me the type of soil I need to make my garden produce better this year.

Tilling up the soil does come with its issues. The main one is our cute little furball, Lucy. Last year I had to build a fence around the raised beds to keep her out of them. This year I am not real sure what I am going to do to keep her out. I am planning a trip over to the local pet supply store to see what they suggest.

The other big challenge this year is starting my seeds. Last year we used a few commercial seed starter trays, and everything promptly died after sprouting. Most of the carnage was due to lack of light. Our house faces west and we only have one south facing window, in the master bathroom. After some discussions with my wonderful wife, I was assured that racks with dirt and seeds do not go in the bathtub. To solve the problem I am looking into building a small greenhouse in the back yard. This should give me the space I need to get the seeds started and be out of the house.

Another big decision yet to be fully made is seed selection. Last year we went with whatever organic seeds were available at the local hardware store. This year I want to be a little more selective. Right now the only seed selections I have made are for tomatoes. I went with the guys over at Tomato Fest. We are going to plant the Atkinson for canning and slicing, the Sprite for salads and eating whole, and the Big Italian Plum for making sauces and paste. I am going to spend some quality time on the seed websites this weeking to round out the rest of the garden.

I am really looking forward to spring and producing a pile of vegietables to eat fresh and can for next winter.

It has been a big year for my family; my wife and I celebrated our 7th anniversary, and our children became a year older. We all went on our first camping trip together and took a small vacation up to Jonesboro to see friends. My oldest and I went to Missouri and visited route 66; we also went on our first overnight backpacking trip together. The kids and I also did part of the Big Dam Bridge 100 bicycle ride. We even started a successful organic garden at our house. As a family the biggest change we undertook this year was becoming a one car family. A few months ago we sold my truck and became truly committed to scaling back our lifestyle — and our carbon footprint. The next biggest adjustment has been dealing with the severe peanut allergy we found out our youngest has.

Personally it has been a big year too. I ran my first marathon, starting riding a bicycle religiously, and managed to loose 40 pounds in the process. I also managed to get to Seattle and see friends and experience life on the west coast for a few days. A few months ago I also became a League Certified Bicycle Instructor. And a group of local cyclists, myself included, started an advocacy group, and pulled off several worthwhile projects.

At this time of year I always look back and think how much has changed in the last year and wonder where the next will take me. I also set some goals for myself and do everything I can to achieve them. I did alright this year, I completed about 75% of them. The other 25% is split among things that just did not work out and goals I am still trying to reach. Whether it be success or failure on the horizon, I am looking forward to 2009.

December 18th, 2008A New Direction

Earlier this year I started rebuilding bicycles, and since then I have become fairly good at it. To that end, I also started rebuilding too many and created a surplus. During this time I also started coming up with ideas for innovative new bicycle products. Add all of that together and it starts to sound like a business plan.

So…I give you Drew Gracie Cycles. Right now it is just a website with information about some of my bicycle overhauls. In the future it will be so much more. I plan on rebuilding old bicycles and making them better than they were originally. I am also going to finally put some of these ideas rolling around in my head into actual products. Stay tuned for more.

While you wait, go read about my 1980 Schwinn Continental Single Speed Conversion.

December 8th, 2008Officially Certified…

For the past three days I have been in Bentonville Arkansas riding bicycles, talking bicycles, learning about bicycles, and more importantly — learning how to share all of that information with others. The League of American Bicyclist, arguably the worlds largest bicycle advocacy group, has a huge education program to teach people how to cycle smart and safely. The program this weekend made me part of that program. I am now a League Certified Bicycle Instructor — I know, watch out world.

I went down this road for several reasons; one of the primary reasons is to put some credit behind all of my bicycle related interactions with the general public, political officials, and fellow cyclists. The main reason however, is to teach others have to safely drive a bicycle — yes, I did say drive.

The seminar was long and intense. Last night, after returning, was the first full nights sleep I have had since Thursday. We sat in a class room, we did handling drills in a parking lot, and we rode our bikes (over and over again) across the craziest, busiest set of intersections man has devised — at least by Arkansas standards. After it was all said and done I came away with volumes of new information and the confidence to effectively pass that information along.

I did have one really embarrassing moment this weekend. We were in the parking lot doing quick avoidance turns. These are basically 90 degree right hand turns, at speed, through a 4 foot corridor. During one of my turns I did not have enough speed to sling shot my bicycle and unconsciously started to peddle. Normally this is not a problem, but when you have your bike banked leaning into a turn your inside food can really get low to the ground. Mine got to close, my peddle clipped the asphalt and I took a tumble. My first true bicycle crash since childhood, and it happened at a bicycle instructor training seminar. Fortunately a few scrapes, a bruised ego and some ribbing was all the damage I received.

Another cool thing about the trip was being able to stop in Fayetteville on the way up and ride the new cross town bicycle trail the city just installed. This is one heck of a utilitarian bicycle trail. It literally runs from one side of the town to the other with an awesome tunnel that goes under Interstate 540. Along the trail local businesses have tied into the trail to provide the users easy access to their shops. It is awesome to see projects like this. My only complaint is the city installed clover leafs at busy intersections that put the trail users on very narrow sidewalks facing oncoming traffic. There are going to be some serious incidents on these portions of the trail. I say that because we almost had one. I turned up the cloverleaf on the right side of the trail, which is a blind turn, and two cyclist were headed straight at me. None of us had enough room and the only place to ditch was into traffic. Fortunately, I was able to stop and allow them through before something bad happened.

The weekend was fun and enlightening. Now the real work begins, scheduling and teaching. I am sure there will be more to come on this topic.

November 4th, 2008Part of the Process

If you have been under a rock or out in the backcountry you may not be aware that today is election day in the United States of America. Today is not an ordinary election though; at least not like the others I remember. This election actually has two very different candidates that think they have a plan to get us out of the mess the last guy put us in. Of course, time will be the true measure of that.

In local politics we have two very import amendments this cycle. One that wants to see Arkansas finally get a lottery; I am all for this one. The other seeks to ban cohabiting and homosexual couples from adopting children; I am adamantly opposed to this one. In my little area we also have a heated state senate race between an out-of-touch old guy and a lying, two-faced, fundy bureaucrat. I voted for the old guy because I cannot stand people without backbones. There are other lesser races and amendments on the list but those are the big ones.

The poles were a little busier than I expected this morning. It took me about 50 minutes to vote. An unscientific test showed the line to be moving at about one voter per 30 seconds. I almost early voted this year but opted not to. Why? Because I love being part of the election day fervor. To a geek this is almost like Super Bowl Sunday. I will also be awake and watching the TV until a winner is announced this evening.

And yes, I did ride my bicycle to the polling station.

Last week I came into possession of a 1986-1987 Bianchi Premio that had not seen the road in many years. Unlike most bikes I end up with, this one needed minimal work to be road ready.

New tires, a lube job, a wheel true, a new saddle and it was ready to go. This morning I took it our for its maiden voyage, and it was amazing. This is the only road bike I have been on since I bought my Allez earlier this year. Now I fully understand why people like riding steel bikes in urban settings. This bike absorbed bumps way better than any carbon or aluminum bike ever could. It does not mean I am going to ditch the Allez (at least not yet) but I am more than happy with this bike.

During my ride this morning I noticed that fall is fully here. The trees are all shades of red, orange, and brown. The grass is becoming dormant. And it is really cold when one is zipping along at 20 MPH on a bicycle. This winter is going to be interesting if I do not find some good warm cycling clothes.

October 24th, 2008Ding Dong the Truck is Gone

About a year ago the thought of selling my truck entered my head. At the time I had no real idea how my family would get along without a second vehicle, but thought it would be nice not to be burdened with a second vehicle. The idea soon faded and life went on as normal.

This past June a series of events occurred that put the idea back in my head… The day before I left for a vacation in Seattle my truck was in a minor accident. When I got back we had to take it to the shop and leave it there for a week. During that week we did not really notice the truck was missing. For transportation I started to rely on my bicycle.

When we got the truck back we decided to stick with bicycle travel and see how it went. To my surprise it went really well. Shortly after we decided to put the truck up for sale.

For the last four months I have been unable to sell the truck. We had tons of interest, but nobody could secure financing, or sell their other vehicle. It was a real downer not being able to get rid of the burden and move on with life.

Then suddenly everything changed this past Wednesday. I decided to take the truck back to the dealership, where we bought it, and see what I could get for it. To my dismay I could not negotiate the amount that I wanted, but decided to part with the vehicle for what I could bargain out of the sales manager.

End the end  the truck is gone after three good years of service, and I have a little money in my pocket to boot. Of course, now I do not have the payment, CO2 emissions, taxes, gas, or insurance for it either; which is a huge relief.

Now a new adventure begins, truly becoming a one car family in a rural suburban Arkansas city.

September 12th, 2008Random Thoughts

The last several weeks I have had a series of random thoughts and observations. Nothing earth shattering, but interesting nonetheless.

Students and the Mobile Era

It appears that every third college student is now surgically attached to their mobile phone. Riding through campus the other day I noticed that roughly one third of the students were either talking on a mobile or texting their little fingers off. To most people this may be no big deal; to me, it is a definite sign that I am now firmly planted in middle age.

Election 2008

I am throughly fed up with the election talk and coverage. Now that all of the announcements have been made and the platforms defined, the media has nothing to talk about except all of the he said, she saids. I really wish we could streamline the election process in years to come. There are millions of dollars and countless man hours wasted in order to allow the politicians to beat up on each other. I really think we could save ourselves some grief and misery by having a two month election season. In month one do the primaries, skip the conventions, announce running mates, and in month two have the election. There is no need in having this thing so drawn out when information can be obtained in an instance.

Spreading an Idea

If you have an idea about something it is easy to spread at first. The first people you tell are your friends; most of which will probably have a similar mindset, so it is easy. Then you try to spread the idea to people that kind of think like you; they are not as responsive but get the message. Then comes the task of spreading the idea to people that do not care; that is the hardest, and often when an idea fails.

The more the idea questions the status quo, the harder it is to spread. The harder it is to spread, the more work one has to do. If the amount of work is greater than the passion of the believers, the idea dies; else, the idea pushes though and changes the status quo.

Cars and the Oblivious

It is no secret that people completely shut themselves off from the world when they are in their cars. That is why car manufactures produce commercials about how quiet their cars are. That is also why places that do window tinting, and install car audio systems have very profitable businesses. My question is why does it have to be this way? Are we all too good or in too big of a hurry to roll the windows down, drive slow, and enjoy the ride?

Over the last several months I have come to really appreciate riding in a car. I am on my bike most days — which is a choice, and something I enjoy doing — but it has made me notice how much of a privilege a car really is. Riding in a modern vehicle is effortless and comfortable, the ride should be treated like something special not just a means to an end.

August 26th, 2008The Puncuation of Arkansas

It is not everyday that I get to think about Arkansas and punctuation in the same thought. It seems that some of the “smart people” in our state got together and passed a law in defiance of the English language. They voted to change the proper possessive form of the word Arkansas from Arkansas’ to Arkansas’s. Fine, whatever, I am going to continue to use the correct form (Arkansas’) because those are the true rules. The last thing I want to remember is yet another esoteric rule dealing with a special case in the English language.

The problem I have with “the law” is that it fails to fix the true issue; which is a reoccurring trend when it comes to legislation in this state. The true fix would be to completely drop the silent “s” from the end of the word, or change it’s pronunciation to include the silent letter. There, see, the root cause of the issue is fixed and we won’t have to rehash this issue for at least 16 years. Of course, that line of thinking hardly ever works around here.


© 2007 Chad Files | iKon Wordpress Theme | Powered by Wordpress