Archive of posts from 2015

2015 Year in Review

I’m trying to come up with a one-word summary for 2015 and am having some problems. All that pops into my mind is ok, which is sort of a lousy word to sum up a year. Perhaps acceptable would be better? Anyway, there’s no need to dwell on a one-word summary. Let me look at things in a bit more detail.

Declarative Authorization attribute rules

I have a website where I use declarative authorization to determine who is allowed to do what. One thing that I need to allow is for people to change their own passwords. It’s pretty simple, my model/controller is users. Here’s what I needed to do:

It’s Funny

I’m a huge fan of YouTube for learning how to do different things. I’ve been watching tons of YouTube videos for woodworking while I try to build stuff with my reclaimed wood. Last weekend, I decided got a beanbag chair that had no cover. So I decided to make a new cover for it and in the process broke something on my sewing machine. So I was looking around YouTube for some help on fixing it. In the process, I watched a bunch of videos on sewing. It was so funny to me how the genders of the people hosting the videos just changed. For woodworking, I can think of one female who made videos. Everyone else was guys. For sewing, it’s all women. This just struck me as very funny.

Early Gift to Me

Since I had been doing a bit more work in my basement, I was continually using my old workbench and it was annoying me more and more. It’s more of a cheap worktable than workbench. But the big issue is that it was just really too tall for me. It was around 36″ tall and I think that I’d prefer a workbench that was quite a bit lower. It really hit me when I was trying to use a handplane to clean up some old lathe. Along with being too tall, it was also too wobbly, which made planing impossible. So I found a design online that didn’t look too hard. I took apart the old table and made myself a new workbench.

Making a PDF File and Automatically Attaching It

I’m writing a rails site that collects information from an applicant and references from other people that will then be reviewed by a different group of people. For the programmer, it’s easy to present the information from the database on a webpage and then provide links to uploaded documents. However, this is not necessarily the easiest way for the reviewers to read all the information. Based on other sites that do the same type of job, I’ve learned that reviewers want to be able to download a single file with all the information in it. I’ve put together various hacks in the past to do this, but have recently come up with a proper way. The following isn’t complete, but it presents the basics of how to do this.

Final Fun

Before I even think about going back to work tomorrow, I decided to try to do something fun in my basement. My project is to make something to hang coats by my door. I have a couple of boards that I made out of lathe that are around 6″ wide and maybe 30″ long. I sanded them down and painted them red with milk paint. Once they dry, I’m going to pound in some of the original nails to use as hooks. Then I’ll hang one of the boards on the wall by the door. I haven’t yet decided if I’ll hang them both. I think I’ll see if I like the one by itself first to see if I like how it looks. And how the nails work as hooks.

Black Friday

Today is “Black Friday”, which means that I’m spending it relaxing after hosting Thanksgiving yesterday. Thanksgiving is my favorite holiday and I believe yesterday was quite enjoyable for everyone. The wild turkey got deplucked and turned out ok. My turkey breast roast, made out of a bunch of pieces, was good. The roasted sweet potatoes were good. And as always the desserts were finished off without a problem.

Winter Biking

Chicago had it’s first snowfall of the year yesterday. A few inches. But then it got quite cold and while roads were plowed and salted, the remaining water froze to ice. Since I have been biking all year and loving it, I wanted to keep the commute to work for as long as I can. I was a bit nervous about biking in the snow, so I decided to get up early this morning and bike to the grocery store, four blocks away. It was 14 degrees when I left. I was dressed well, so the cold wasn’t a concern at all. All I was worried about was the ice.

Car Repair

My last car repair class at the park was a couple of weeks ago. While I sometimes dreaded getting in the car to drive over when it was already dark out, I enjoyed every single class. And I learned something in every single class. It was easily the best $60 I’ve spent in a long time.

Working with Wood

I have written before how I’m trying to reuse the old lathe that I saved when I redid part of my house. The procedure was basically to plane the lathe, glue it together and then plane it to a smooth thickness. This has produced some very nice boards and I’ve made a couple of nice things with them. The problem is that I’m not enjoying the process. First of all, the planer is freakin’ loud. I wear ear-covering sound mufflers and it still sounds loud to me. I tried using a sander and wet-dry vac, but that’s crazy loud too. As I get older, one thing I’ve noticed about myself is that I like quiet. Another problem is that the planer seems to be breaking a lot. I’ve spent a lot of money on a new set of carbide blades, which have worked well, but cost $249. And I’ve replaced the belt twice. It also generates a tremendous amount of sawdust that gets all over the place. But the main problem is the noise. I like working in the mornings…the earlier the better. But I don’t want to make that much noise. I’m sure my neighbors could hear some of it and I don’t want to be a jerk.

Getting Built-in Sound Working with RHEL6

I had a user running RHEL6 who no longer had sound. His computer has an Asus P8H67-M PRO motherboard. This board has a built-in Intel soundcard.

Chicken and Dumplings Soup

I just made this chicken and dumplings soup. It’s ok, but it’s not great. My main problem is with the dumplings. They’re really heavy. And the soup is good, but I think there should have been an onion in the soup. So after thinking about things, this is what I’m going to try the next time I make it.

Bike Travel

The bulk of my vacation time the past few years, has been spent with me driving to a city with my bike and then biking around the city. Sometimes this has been to go on official bike rides with thousands of other people on closed streets and others it’s just me riding around town on bike paths or in the street. I absolutely love doing this. The big rides are fun because the towns usually route the ride through interesting neighborhoods and past important landmarks. And the individual rides are fun because it’s neat to learn your way around a new town. It’s also easy. I can put a destination in google maps and have it tell me directions best for biking.

Could I Live without My Car?

A couple of days ago, I hit 2000 miles of biking for the year. It wasn’t a goal to do this at the start of the year, but I’m rather pleased with myself. I actually thought it was a bit of an accomplishment until I read a blog post somewhere about a woman with MS who rode like 6000 miles for the year. I have a long way to go to reach that. But this got me thinking, do I really need to own my own car?

Oatmeal Update

I had posted my recipe for oatmeal a while back. As it’s getting chilly, I’ve started having it for breakfast again. This time though, I had whole milk in the house because I had been using it for baking. I think this improves the taste a lot. So my new recipe for oatmeal is:

I Love Fall

Autumn is my favorite time of year. My birthday is in October. The weather is usually nicely cool. The leaves on the trees turn giving beautiful colors to both the city and rural landscapes. I also usually start cooking again in earnest as the weather cools. In summer, when it’s hot, I don’t like to use my stove or oven. This limits meals to uncooked food, like salads. As I get older, I am getting better at eating salads regularly. But I have to admit, a salad is, in general, not a meal I’m going to love.

Ruby Iconv to Strings#encode

I wrote a script in Perl, years ago, that lets users update their unix and samba passwords at the same time. This keeps them in sync so that people will have the same password whether they’re logging in via linux or at a windows computer. I thought it would be a good idea to rewrite it in ruby, since that’s the language I’m most comfortable with these days. Along with Google, the book that was most helpful was Programming Ruby 1.9 & 2.0 from the Pragmatic Programmers, which fortunately, I had.

Multiple Authentication Methods with Authlogic

I have a website where users need to login to be able to comment on pictures. For the most part, users will use their university credentials to login. However, I’ve found a few recently retired people who would be able to help us identify people in the pictures. But since they are retired, their university credentials are no longer valid. So for these people, I’d like to be able to make a local account for them to login. My rails app uses authlogic to check credentials. And I’ve been authenticating against the university ldap server for a while without any problems, but mixing in local accounts is going to require a few changes.

Alternative DNS

My internet connection went down today for a few hours. Technically, I guess it didn’t go down, but DNS wasn’t working. So I could ping 216.58.216.68, but I couldn’t ping www.google.com. I had been using the DNS servers from comcast that I got from DNS. I believe they’re 75.75.75.75 and 75.75.76.76. But since these weren’t working for me, I changed to the following:

Car Repair Basics – Charging System

I’ve now had three classes is my Car Repair Basics class. We’ve just been covering the charging system, mainly batteries. I’ve learned a lot. Here are my notes.

Crazy Error

I just updated some rails webpages to 4.2.4. On one system, I didn’t have any trouble. But on the other one, things worked fine on my laptop, but gave all sorts of random errors on my production system. I started keeping a list to see if I could figure out what was going on. Here are some of the errors that I was seeing.

Fun with Google Calendars

We’ve started using Google Calendars at work to keep track of different seminars, colloquia, etc. However, we also like to keep our regular html calendars because they’re just easier to read and to get a quick view of all talks for a quarter. So what we want to do is have the + Google Calendar button appear on webpages, but not show the actual calendar. We’ll have all the information in our own html calendar. Yes, this requires us to update two calendars, but it makes it easier to read.

George’s Challenge

My 10 (about to be 11) year old nephew George told me that he has to read 40 books this school year. Each book needs to be at least 200 pages long. He was not looking forward to this and thought that nothing could possibly be worse. Since we are a very competitive family, I told him that it was easy and I could do it no problem. Not only that I could read 40 books twice as long as the ones he was reading. Result of my boast is that I now have to read 40 books by the end of the school year. Each of my books has to be at least 400 pages long. Stupidly, I didn’t get the details of his assignment before I agreed to this. After we shook on it, I found out that I don’t necessarily get to choose all the books, but that they have to be in some specific genres. So, here’s what I have to read this year:

Links vs Buttons

Now that I’m writing more websites, I’m trying to make them better. A lot of it has to do with making them look better so that people have a better (UX) user experience. I’ve been using bootstrap more, which is nice. But now I need to get into more nuts and bolts stuff.

I Prefer Fixes

I bought parts for some new computers for our engineers at work. Everything arrived yesterday, so I started assembling them. When I opened up the video card that I bought (PNY NVIDIA Quadro K1200), I noticed that the bracket was shorter than the standard bracket. I’ve purchased many video cards over the years and normally, the box will include another bracket so that it can be used in a regular sized case. However, I quickly found that there was not another bracket in the box. I looked a bit online and found that this particular card was designed for a small form factor case. My first issue is that that information should have been much more visible on the webpages where I bought it. Anyway, since I bought the cards from our campus vendor with a purchase order, I really didn’t want to try to return them because it’s a big hassle. So my first solution was to simply take the brackets off. I could put the card in and use it without a bracket without a problem. The next step was to see if I could make a new bracket, which quickly sounded like a bit more work than I wanted to do. I returned to Google and found someone who said that they had an older NVIDIA NVS 510 card. He said the bracket from that card fit the K1200 perfectly. I didn’t have any NVS 510 cards around, but more googling led me to a local place that sold that bracket for $20. I ordered them and got them in two days. They fit perfectly.

Full Circle

Lathe are strips of wood that are nailed to studs when building a wall. Before drywall was invented, plaster and lathe were how walls were put up in houses. My house had all plaster and lathe walls on the first floor. Here is a picture of the back of a plaster and lathe wall, as I was gutting the room that is currently my bedroom.

My Ting Test

Last month, I switched cellphone providers from T-Mobile to Ting. In looking at past reports, I had been paying T-Mobile around $63 per month (including taxes). This didn’t seem bad to me, but I thought I could do better. A couple of days ago, I got my first bill from Ting. The total is $39.81 (including taxes). I’m happy with this. The image below shows the breakdown of all the fees.

Not Casa Loma

My friend Ellen came to town for a vacation. Before coming, she had mentioned that she had a friend in Toronto that she wanted to see and I proposed a road trip to Toronto. I also suggested (strongly) that we take bikes and ride around while there, since this was my favorite activity when I was in New York.

Financial Independence

The past couple of weeks, I have been obsessing about becoming financially independent. When I was a kid, I would have thought of this as being rich. But now, all I want to do is be able to do what I want, without having to think about money. I’d like to have the option to do things for people or not, based on whether I think it’s interesting or not, taking money out of the equation entirely.

Poppyseed Dressing

There are few salads that I like. However, the poppyseed fruit and chicken salad at Portillo’s is one I love. I’ve tried poppyseed dressing at other places and have bought different brands. They just aren’t as good. I found a couple of recipes online that I’ve tried. The first one I tried used a grated shallot. I grated a pretty small one, but the result tasted way too much like onions, so that one didn’t work at all. This one though sounded better. Though since I had just had the failure with the shallot, I left the onion powder out of it. I also left out the lemon juice because I didn’t have any. The result though was great! So, since this is my repository of all things I want to save, here is the recipe I followed:

Capistrano 3 Issues

I decided to give capistrano 3 a try with one of my projects. For the most part, I prefer version 2 to version 3. Mainly this is because I never have a staging server. I only have my development stuff and then I deploy to production. So having to specify the deployment server is just additional work that I always forget.

Counting Comma-Separated Values in Excel

We have a bunch of spreadsheets where which have cells with values like this, R1, R2, R3, R4 or C45, C87, C22. It would be very helpful to have another column that could tell us how many values on in these cells (4 and 3 in my example). The way to do it is to use this function, which would tell us how many values are in cell H8.

Openssl Update Breaks Pine

There was an openssl update recently that caused people who were using alpine to not be able to send mail. When they tried to send, they got this message:

Vacation!

It’s rare, but every so often I take a real vacation. By this I mean, I take off at least a week from work, go someplace and just relax. In my case, that means riding my bike around and reading. This time, I spent just over a week in New York City. I went for the Five Boro Bike Tour and stayed to go to a friend’s reading of his play. During my trip, I ended up biking over 130 miles and read six books. I could have done more of both. It was one of the best vacations I’ve ever taken.

incompatible character encodings: UTF-8 and ASCII-8BIT) in Rails App

I got this error after I updated a website from rails3 to rails4. I spent a few days going over character sets and collations in MariaDB. It turns out that all I needed to do was to use the mysql2 gem instead of the mysql gem. I am writing this so I hopefully will remember when I do this again.

Ruby Lambdas

I’ve used ruby lambdas a few times, but I have to admit that I never really understood them. However, I’ve now come across a case where I have to figure them out. Here’s what I’ve found:

Authlogic Error

I put up a new website that wouldn’t allow me to login and kept giving me an error that said something like undefined method `save_without_session_maintenance’. I double-checked all my controllers and models against another site that was working fine and they all matched up. I didn’t find any bug reports for the version of Authlogic that I was using. The solution was to just deploy the app again. After that, I was able to login successfully. Weird.

Remote Desktop Services with a Samba PDC

We’ve been using a linux computer running samba and openldap as our primary domain controller for a windows domain for years. I absolutely love the fact that I don’t have to deal with windows and their crazy licensing. More importantly, this setup makes it easy for me to create accounts to give people access to everything in our shop. This includes windows accounts, linux accounts and website accounts.

Serving SVG Files

I updated a website and changed to using svg files for our header. On our test setup, we were running RHEL7, which had a newer version of httpd than what’ on our production server, which is running RHEL5. I had to add the following to our httpd.conf file to tell it to specifically serve svg files.

Sendmail on Centos 7.1

I’m running a server that I recently upgraded to Centos 7. For a few months, it wouldn’t send mail and today I finally decided to do something about it. I was getting an error AUTH warning: no mechanisms. After messing around for a while, I saw this in /etc/mail/access:

Make a Bootable USB Drive with Yosemite Installer

I wanted to completely reformat and reinstall Yosemite on an old iMac. To do this, I needed to make something I could boot from. I got an 8gb usb flash drive and used Disk Utility to reformat it to a Mac filesystem that I called Yosemite. This disk was then mounted at /Volumes/Yosemite. I then went to the App Store and downloaded Yosemite, but cancelled the installation. This left the installer in /Applications/Install OS X Yosemite.app. Then, to make the bootable drive, I ran the following command:

Back Issues

About a week and a half ago, I pulled a muscle in my back. I don’t know exactly what I did, but I do remember that I was putting on a sock. I don’t remember doing anything odd, but I do remember the sharp pain. I thought it might be something bad, but I proceeded through the day as usual. I had this same injury (though much worse) about 15 years ago, if not more. At that point, it hurt so badly that I had a hard time standing up. Now, I’m pretty much ok if I keep my back bent a little, but it hurts quite a bit when trying to straighten it. This leads to the odd situation where riding my bike feels really good, but going for a walk can be painful.

Biking

Went for a nice bike ride this morning because it’s lovely out. Decided to ride to the bank to deposit a check and then take a ride along the lakefront. Did about 13 miles and felt pretty good. I just noticed on my Cyclemeter app that it tells me how many miles I biked overall last year. It’s close but I know that I don’t always remember to turn it on and I only got the app in April. So it’s probably a bit low. Anyway it says I rode 1131 miles last year. So far this year, I’ve ridden 102 miles. That’s pretty good. I didn’t think that I already rode that much this year. I think I now have a goal for the year. I need to do more than 1131 miles.

Production Gems

I’m not sure how I didn’t notice this before, but my deployment on an app was suddenly taking much longer that it had in the past. While I was watching it run, I noticed that when bundle install was running, it was saying installing each gem. I don’t know why I didn’t notice this before. I looked on my server and noticed that each release was about 177mb in size and the vendor/bundle directory was 173mb in size. I was reading the Bundler website when I saw this bit:

Lots to Learn about Assets

I upgraded a new app to use Rails 4.2 and bootstrap and I thought things were fine. However, when I went to the page today, css wasn’t working. It just never created the css files. Turns out that I needed to add the ‘sprockets-rails’ gem to my Gemfile because the asset pipeline is no longer a feature of rails 4. Once I ran bundle and commit this change to the repo, I could deploy and things worked fine.

Still Learning About Rails and Deployment

I had been feeling pretty good about my Rails skills and had been able to create and deploy a number of simple applications. Since simple applications are just about all I’m going to write, I was ok with things. But I was hanging on to earlier versions of things and it was starting to bug me. One big one was the capistrano gem. I knew there were big changes between version 2 and 3, and I had a pretty good setup using version 2. However, I know that things constantly change so I decided to dive in and start using capistrano version 3, 3.4.0 to be exact.

A Splendid Torch

This is the true joy of life, the being used up for a purpose recognized by yourself as a mighty one; being a force of nature instead of a feverish, selfish little clod of ailments and grievances, complaining that the world will not devote itself to making you happy.

Spring is Coming

I don’t know if it’s because I’m getting older or if we had a particularly snowy winter, but I cannot wait for spring to come. Today makes me happy because spring training starts and I can watch a game on tv and see the outdoors not covered in snow. Something that makes me even happier is that today signups open for 30 Days of Biking. This is a group that asks people to pledge to ride their bike every day in April. That’s it. The idea is that if you ride every day at the start of biking season, you’ll be more inclined to think to use the bike for small errands and things during the rest of the summer. It’s brilliant in its simplicity. It doesn’t cost a thing. The idea is just to get you out biking. And as an added bonus, they’ll donate a bike to a kid in need for every 30 riders who sign up. I did it last year with my sister and a friend and it was fun. On the day that we spent 15 hours in the car on the way back from Boston, I did have to borrow my nephew’s bike at 10:30pm to ride to the corner, but I’m happy to say that I rode every day. And it’s a great reason to get together a group and go for a group ride. So I just pledged again this morning and am looking forward to it. I’ve already ridden a bit this winter, but spring riding is so much more fun. So if anyone else wants to pledge, I say go for it! And if you’re looking for someone to go for a ride with in April (or quite frankly anytime), let me know. I’m in!

Changing Rails Boolean with a Button

I suddenly realized how to change a boolean with a button in a much easier way that the post I did yesterday. All I did was make a form with one hidden field (the boolean that I want to change) and just show the submit button.

Change a Boolean in Rails with a Button

There’s a much easier way to do this, which I show in this post.

Rails Rewrite

I have a website that I’ve been using to track timesheets for a number of people. It’s one of the first websites I wrote in rails, written about four years ago. The only person who really uses it is me, but a few other people also login to view the information. Anyway, the site was written in rails 3.2.11 and now the latest version is 4.2. I’ve decided that since I know a bit more rails now (I wouldn’t say I’m a good programmer), I’d rewrite the program. It’s not that elaborate, but it does work really well for me.

The Secret Life of Machines

I’m very grateful to someone for posting all the episodes of The Secret Life of Machines online. I LOVED this show when it was first on. A while back I actually looked to buy a dvd of the shows and couldn’t find it. This makes me so happy!

Macs and Linux

At work, we have a bunch of computers running linux and hosting disks that are shared using NFS. Of late, many people have been switching to Macs as their primary computer. Usually, they then just ssh into one of the linux machines and work as before. However, now I think they’d like to be able to stay on their Mac and still access the files in linux. Macs are unix-based, so mounting NFS drives isn’t that much of a problem. However, the default user ID and group ID used on the Mac does not match up with our uids and gids in linux. The default (first) user on a mac, is give UserId = 501 and GroupID = 20. This group id corresponds to the group named staff. I wanted to change these ids so they match up with the ids we use in linux. Then, when the user creates a file on an NFS drive, they’ll have the correct owner and group. How to do this? The dscl command on the mac is the one to use.

Unexpected Time Off

We had a bit of a storm here yesterday.

Clamps, clamps and more clamps

One thing I have learned is that you can’t have too many clamps. I basically had enough to work on one board at a time, which means I’d have to wait for one board to dry before doing another one. Since I’m hoping to eventually build something in my lifetime, that was too slow. So I went to the store and bought another eight clamps. I seem to need 7-8 clamps per board. Now I can work on two at a time. Pictured below are the boards that I’d like to use for the sides of the bookcase I want to build. One is basically done and the other needs some more lathe. I’m out of what I’ve already sanded, so it will have to wait until I prep more boards.

Board Repairs

I thought I should try to fix the holes in the one board I made the other day. My idea was to mix up a bunch of glue and sawdust. Then try to fill and cover all the holes with this mixture. Here’s how the board looked after I filled them all in. I wasn’t too careful about making it smooth because I knew that I’d have to run it through the planer again to smooth it.

Board #3

Here are all the boards I’ve made. The first is at the top, second in the middle and the last one at the bottom.

Early Lesson

I’ve now completed two boards out of old lathe. The picture below shows part of both of them.

Recycling Begins

I saved a ton of wood (mainly lathe) when remodeling my house and finally decided to get started on doing something with it. My first issue came last week when I tried to run both my planer and wet/dry vac on the same circuit. I kept blowing it. So on Friday, I ran a new 20 amp circuit to right above the planer. After that, things ran smoothly.

The Magic of Thinking Big

The title of this blog post is the name of a book that I just finished reading. It was recommended by a blog I read, though I no longer remember which one. It’s a basic self-help book by David Schwartz about believing in yourself. However, it’s clearly written for people in business and especially for salespeople. Note how I said salespeople there. One of the first things I noticed in the book was how it was pretty much geared toward men. In reading the first few chapters, I noticed that women were only talked about as wives for business men. This made me look at the publication date and unsurprisingly, it was 1959. I decided to continue to read and just made a mental note remember that date when I found little things that bugged me.

Alpine on a Mac

I have just installed alpine on two different macs. On one, I used macports and on the other homebrew. Both seem to work just fine. I was also able to set up imap to our mail server without any problems. I did run into a couple of issues, but fortunately, have been able to find solutions to all of them.

Time Machine Transfer Issues with Office

I bought a new imac and wanted to transfer an account from an old imac. I created a new admin account and then used the migration assistant to transfer the old account. The old imac was running office 2008. We now are using office 2011. I installed office 2011 using the admin account and it seemed to work fine. When the user logged in to her account and tried to start Excel, it would just continually crash. I tried reinstalling Office 2011 as the user, but that didn’t help.

Starting Off

My 2015 has started pretty well. I’ve already built myself a new workbench, which makes me very happy. And since I was about to buy one, I saved myself a couple hundred dollars as well. This has also inspired me to get started on another cabinet for my kitchen and the kitchen table.

To 2015

Happy New Year!

A Closer Look at Finances

As part of my year in review and upcoming year plans, I like to take a hard look at my finances and see how things are going. This year, instead of just looking at the past year, I’ve decided to take a look at the past decade…really the past eight years or so. Why? Because that’s when I started doing all my finances on my computer and they’re all in my banking software. And, of late, I’ve discovered the Mr. Money Mustache blog that does a really good job of talking about the way I’ve been trying to live my life.