Centennial Trail in Romeoville

I decided to go for a ride after work today since the weather was so nice. I also thought that I'd try a new trail, since I was doing a solo ride. After a little research, I decided to do part of the Centennial Trail in the Lemont/Romeoville area. I think this is part of the I & M trails, but I'm not sure. Anyway, my intention was to part at Schneider's Passage and ride from there. My first bust was that there were only four parking spaces there and they were all taken. So I drove back to something called the Isle a la Cache Museum. No idea what this is, but there was plenty of parking and it was only about a two block ride to the first place I was going to park. The only drawback was that I had to cross Romeo Road, which is a pretty busy street where people drive pretty fast. Fortunately, it was around 7pm and traffic wasn't that bad.

The start of the ride looked really cool because you go over this very old bridge. I didn't like that there were these pieces of steel on each end of the bridge that was incredibly loud when you rode over it. I know that's a minor thing, but for some reason, it really bugged me. Anyway, the trail is in pretty nice shape. It goes right next to the Des Plaines River, which is sort of pretty. Though there are lots of trees, so you really don't see that much of the river. And the other side of the trail is pretty much all industrial stuff because it's the Chicago Sanitary and Ship Canal. Nothing pretty to look at there.

I ended up going out eight miles and then coming back. Very few people were on the trail. And, of course, one deer crossed it in front of me. I'm happy I rode it, but it's unlikely that I'll do it again. And I can sum up the reason why in one word: bugs. I'm pretty sure I ate a good number of gnats. And I was really happy that I brought my sunglasses with me because I needed them to keep the bugs out of my eyes. As I was riding pretty much in the shade for most of the ride, I would have taken the sunglasses off. But the bugs around my face were just bothering me a lot, so I rode with them on. This lead to a dark ride for a bit.

It's funny, but now I'm going to be a little leery of riding anything that goes near or along water. I'm not sure if that's why all the bugs were there, but it's something I'm going to think about. Possibly it's due to the Sanitary and Ship Canal, but I don't know.


Rails Program Upgrades

I had a computer that was hosting a number of simple rails programs that I needed to upgrade. So, I updated everything and reloaded the mysql data and everything was good. That is, until I tried to login. I had a number of unsuccessful attempts and just assumed it was because I forgot the password. There were actually three programs that I had to reinstall and after the third one, I realized that I hadn't forgotten the password but that something had changed.

I use authlogic to handle authentication and that also takes care of storing the encrypted password. I honestly never really thought about this much, aside from checking the database that the password was stored encrypted. Since I'm not a mathematician, I never really concerned myself with how this was done. And I still don't think that I could explain in detail how this works, but I think I have enough of an understanding to be able to use it.

The basic idea is we don't want to store a password in plaintext because if the system was compromised, the bad guy would get all the passwords. Then that person could log into our system whenever they wanted or to people's other accounts, since many people use the same password in different places. So we want to store the password in a way that it would be meaningless if it were stolen. How do we do this? We do some mathematical shenanigans (technically called hashing functions) on the password to make it look like a random collection of characters. Are then we able to unscramble this collection to get the original password back? No, because even we as the owners of the website, should not be able to read someone's password. This is called one-way encryption, I think. So then, how will we know if a person enters in their correct password? We run whatever they enter through the same hashing function and compare the output to what we have stored. If it's the same, they entered the correct password, if different, they didn't.

Now the issue I had with my programs is that when I updated the system, I also updated the version of authlogic that I was using. In my specific case, I think I went from 3.2.0 to 3.4.2. I should have realized immediately that something had changed since I'm sure I couldn't login when I was testing. But since I only had two accounts, an admin one and a regular user, it was simple for me to just add another admin user. Then I could use that admin user to change the passwords on the other two accounts. And I could get back to seeing if the rest of the program worked. If I had more users, I would have been in a ton of trouble. This is where (if I were a better programmer) I would have read up on differences between the two versions of authlogic to see what had changed. As I'm still basically a beginner, I'm not exactly sure where I would find this info. But I'll try to figure that out later.

After a bit of googling, I found this webpage, which solves the exact problem that I had. The guy who wrote authlogic is a much better programmer than me and knew this would be a problem, so he has a fix. My only concern is that I didn't know which hashing algorithm I had been using nor what the new version was using. A bit more googling led me to the file that tells me this. (It's probably in release notes somewhere, but I didn't find it.)

In the authlogic gem directory, there's a file, lib/authlogic/acts_as_authentic/passwd.rb. In this file, I found this, from the 3.2.0 version.

# The class you want to use to encrypt and verify your encrypted passwords. See the Authlogic::CryptoProviders module for more info
        # on the available methods and how to create your own.
        # * Default: CryptoProviders::Sha512
        # * Accepts: Class
        def crypto_provider(value = nil)
          rw_config(:crypto_provider, value, CryptoProviders::Sha512)
        alias_method :crypto_provider=, :crypto_provider

And if I look at the same file in the 3.4.2 version, I see:

# The class you want to use to encrypt and verify your encrypted passwords. See the Authlogic::CryptoProviders module for more info
        # on the available methods and how to create your own.
        # * Default: CryptoProviders::SCrypt
        # * Accepts: Class
        def crypto_provider(value = nil)
          if value.nil? and !acts_as_authentic_config.include?(:crypto_provider)
            rw_config(:crypto_provider, CryptoProviders::SCrypt)
            rw_config(:crypto_provider, value)
        alias_method :crypto_provider=, :crypto_provider

So it appears that the default hashing algorithm changed from Sha512 to SCrypt. Thus, in my user model, I should have done something like this:

class User < ActiveRecord::Base
  acts_as_authentic do |c|
    c.transition_from_crypto_providers = Authlogic::CryptoProviders::Sha512,
    c.crypto_provider = Authlogic::CryptoProviders::SCrypt

Unfortunately, I've already manually changed both my passwords. But I'll try to load the old version of my database somewhere and see if this works as I think it's supposed to.

Happy I learned something, but just more evidence to me that I'm still a very inexperienced programmer. I won't go looking for a programming job anytime soon.

Update: I had another site that I upgraded and I followed these instructions. Worked perfectly.

Oven Hood

Spent the last weekend working on the installation of the hood over the oven. This turned out to be much more difficult than I anticipated. First off, I wasn't sure exactly how high it should have been installed. There seem to be a number of different opinions out there. I thought I had measured this all out before the drywall went up, but I stupidly didn't write this information down. In the (very poorly written) instructions for the hood, there was no mention of how high it should go. All I found was on a sticker inside the hood that said it should be more than 24" from the cooktop. So I put it in a little higher than that.

I should have realized I'd made a mistake when I tried to screw in the lower two screws. They clearly didn't go into any of the wood that I had added for this purpose. So I should have known that it needed to go a little higher. But, that didn't occur to me and I proceeded to finish hanging the oven.

The next step was to hook up the electricity and make sure that it still worked. Once I was ok with that, I needed to connect the vent. This proved to be problematic due to poor design. There were two screws that I needed to use to attach an adapter to the vent. Stupidly, one of the screws was like 1/4" away from the wall. So it was very difficult for me to get a screwdriver in there. Eventually I got it in and the whip attached.


At this point, my problems began. First of all, it took a number of attempts to get the bend in the vent so that it would fit beneath the cover. Below you can see how close it ended up.


Then, I found that the silver cover I had for the box was underneath the cover for the vent. So I had to cut a small section out of the cover so that it would fit flush with the wall.


With all that done, I found the huge mistake that I made, where I hung the entire hood too low. The cover for the vent was too short to get to the ceiling.


I now had two options, either take everything down and rehang it a few inches higher. Or just not have the vent cover go all the way to the ceiling. My sister came over and let me know that it looked ok to her, even though it didn't go all the way to the ceiling. It was such a hassle hanging it, that I didn't really want to move it either. So I decided to just leave it as it was.


That's how it looks with my old stove back in place. Not too bad.

Fixing Carriage Return/New Line Problems

Sometimes if I open a text file in vi, the text shows up like this:

Title,Firstname,Lastname^MDr.,George,Washginton^MMr. ,John,Adams^MSenor,Thomas,Jefferson^MMr.,James,Monroe^MSenator,James,Madison^MSir,John Q,Adams

Those ^M characters should actually be returns. To fix this, run:


The ^M in the command above is actually typed by pressing Control-V, Control-M.

After running the command, the text file looks as it should.

Mr. ,John,Adams
Sir,John Q,Adams

If I don't want to open the file in vi to fix it, I can fix it on the command line with:

$ tr '\r' '\n' < test.csv > x

Must Plan or It Won’t Happen

I've been doing really good this summer with biking. The 30daysofbiking in April started things off well and my trips have been tons of fun. Unfortunately, Bike the Drive at the end of the month is my last planned ride I have. I am old enough to know that if I don't plan things, they aren't going to happen. So here is a list of rides I'd like to do this summer. They're just about all in the midwest, so I should have no problem getting to them.

Indiana Dunes - 9 mile gravel trail - 30 August 2014, was submerged in places and not a very nice trail. Will not revisit.
Dayton OH, home of Wright Cycle Company Building - Dayton looks to be a nice place to ride
Iowa High Trestle Trail - 25-mile trail
Wisconsin, Elroy Sparta State Bike Trail - 32 miles (requires a Wisconsin State Trail pass)
Iowa, Trout Run Trail - 11-mile trail
Michigan Kal-Haven Bike Trail - 34 miles gravel and blacktop
Indiana Pumpkinvine Nature Trail - 25-mile trail
Missouri Katy Trail - Runs from St. Louis to Kansas City
Illinois Prairie Path - 61 miles
Indiana Monon Rail Trail - 8-mile trail
South Dakota Mickelson Trail - 114 miles (A tad further than I'd probably go for a weekend)
Ohio Little Miami Bike Trail - 80 miles

I probably won't get to all of these this summer, but I'll try to do, at least one of them each month.

And it’s over

So much for saying that I was having a good month. I thought I'd finish off the electrical work today and hook up the last outlets. All was going well until I turned the power back on. I've set things up so that in each box, the outlets on the left were on one circuit and the outlets on the right were in another. I have gcfi outlets in the first box where the power comes up through the basement. So it's easy for me to turn off one circuit or another.

After hooking everything up, I turned the outlets on and all seemed good. However, then, I turned off one of the gcfi outlets. When I went to check the power, both outlets were on. Not good. I then switched the outlets that were on and off and had the same problem. Then, I turned off both outlets and found that I still read a little over a volt in each outlet. That seemed really strange to me. So then, I turned off all the breakers that I put in and didn't read any voltage anywhere. So, I screwed something up. Now I just need to find out what. Since it's somewhat late, I've decided to turn off all my breakers and relax for tonight. I'll try attacking the problem again tomorrow.

Update: This is apparently a common issue when using a multimeter to take readings. They're far too sensitive and detect phantom voltage. If you plug a load into these outlets that supposedly have no power, the voltage drops to zero. I still don't quite understand why this happens, but it's apparently quite common and not something I need to worry about.

Good Month!

I started this month with my trip to New York City for the Five Boro Bike Tour. I posted the pictures that I took here:

Five Boro Bike Tour Pictures

Took my Mom's car for the trip because it could carry four bikes on the rack, after I got a hitch installed on it. The rack (a Thule Apex 4 9025) performed flawlessly. It took a little messing around, but once I got all four bikes on, there were no problems. The rack and hitches are one of the best purchases I've made of late. I've already gotten a lot of use from them this summer.

I drove out with my cousin Mary, while the other two members of our team flew out. We didn't feel the need to do a marathon drive all the way to New York, so we stopped in Pittsburgh for the first night. We got there somewhat early, so we went out for a bike ride in Pittsburgh, along the river. The weather was great and the ride was fun. I'm looking forward to going back to Pittsburgh this summer for a game and another ride.

The drive to New York was amazing. As in, we couldn't believe how easy it was for us to drive into Manhattan. We didn't hit any traffic until we got to the Hudson Tunnel. And then, our hotel was about two miles from there. I'm still amazed at how easy it was. Part of me is tempted to try to drive into Manhattan again on a Friday afternoon (around 4) and see if it's always that easy to get in.

After we checked into the hotel and quickly unloaded the bikes to get them in, we headed up toward Times Square. Mary and I figured that we'd see a show. Then my sister Julie's flight landed right on time and said that she should be able to join us. We bought tickets for Matilda, which turned out to be a great show.

Saturday was spent in going to the Bike NY Expo to pick up our packets for the ride. We biked over and had a pretty good time. Afterwards, Shadla and I headed back to the hotel to get lunch, while Julie and Mary did a little riding around the area. After lunch, we head up to see the Highline Park, which was pretty cool. Then we head back to the hotel to hang out and watch the Kentucky Derby. Lots of relaxing since we were saving up our energy for the big ride.

Sunday morning brought some nice weather for the ride. We head out around 8am and were in a swarm of people with a 9:15am start time. The start was way more chaotic than last year and we didn't get to the start until around 9:45am. By that time, we had split into our two teams, Juile and Mary were team A and Shadla and I were team B. Team A jumped right in the swarm and took off. Team B waited a bit for a slightly less busy time to jump in.

The ride up Sixth Avenue was pretty nice and Central Park was great. We then head into the Bronx which was great as well. Coming back into Manhattan we found the first bit of some heavy traffic, which happened a lot more this year than last year. We also came across a pretty bad accident, but we were still going strong. There was a big backup in the area right before the Queensboro Bridge. I remembered that this was the same place where there was a backup last year. We walked quite a bit and then had to start pedaling again on the entrance to the bridge. We were going ok, though working hard, until about the last bit of incline up the bridge. At that point, we got off the bikes and walked the rest of the way to the top. At the top, we could get back on our bikes and keep moving on. The ride over and down the bridge was great, until the very bottom. At that point, my team B partner got clipped by an idiot and almost (but didn't!) go down. Once we regrouped at the bottom and took a rest at the rest stop, we got ready to head toward Brooklyn. Unfortunately, there was a huge delay as soon as we got out of the rest area. So we decided to end our tour there, right around 20 miles. We head over to the subway and took our bikes back to Manhattan and the hotel. Team A had a much longer day, since they finished the ride and had to wait for the ferry to bring them back to Manhattan. All in all, everyone was tired and pretty happy with their rides.

The rest of Sunday was pretty low-key as everyone was tired. Mary caught a second wind, so we went to Chinatown so she could do a little shopping. She was happy as she scored some good deals.

Monday was departure day. We loaded up the bikes and head back to the Pittsburgh area, leaving around 11am. Once again, we were astonished at how easy it was for us to get out of Manhattan this time. The weather was beautiful and the drive to a suburb of Pittsburgh was lovely. As we were still a bit tired from the ride on the previous day, our goal was to eat dinner and then chill at the hotel, which we achieved. We left early the next morning and had a nice drive back to Illinois.

It was a lot of driving, but I think I enjoyed it far more than the train ride that I took last year. The ride was definitely more fun this year, as I didn't do it by myself. Not sure if any of us will do it again next year, but I'd definitely consider it. I'd also be happy to take trips to other rides, as it's definitely a lot of fun.