Thank You Brasher’s – It Was A Good Ride

Today was my last day at Brasher’s Auto Auctions. It was a great ride. Learned a lot of things. Now I’m moving on.

While I was at Brasher’s I designed a pretty neat auction system using Ruby on Rails. The concept for the lanes in the bid client are very unique. I haven’t seen it done anywhere else. I came up with the idea a long time ago with David Gehring. Finally got to build it while working at Brasher’s.

I also learned Angular.js while working for Brasher’s. Their team was using it for their back-end tools and turned me onto it for my stuff. It worked great for my auction client. So well that I rewrote the app again with Angular front ends and a Rails API back-end. It improved things a lot.

After moving on from the auction app I started working with their team in Windows and ASP.NET. I was actually using Windows 8.1 if you can believe it. Something that you would never see me do in a million years. LOL. Yep, I was using Visual Studio and everything. It was different I can say for sure. It wasn’t really too bad either. After figuring out C# and how everything works it’s just MVC. The syntax wasn’t too bad. Compiling was hard to get used to. The editor was a bear to use.

Tomorrow I ship my monster workstation back to them to be recycled to another employee. It was a really good system. Wish I had the money to keep it. But I have bills to pay.

So now I’m back on my Dell XPS 13 running Debian Linux. Just finished up re-installing everything and getting it ready for development again. I had used it for Netflix for the past few months.

Furnace Blower Cycling On/Off While Heating

fan-control-switchesFor a few years now I’ve had problems with my furnace blower cycling on and off when it’s really cold out. Usually at night it would do it when I have my house set to 64 degrees. When I had it set above 70 it would work fine.

First I replaced the top plenum sensor being the only one I could find. That didn’t fix it. Later I thought it had something to do with my filters being too thick. So I replaced them with thinner ones. It seemed to help but when it got colder outside it started up again.

Finally this year I decided to fix it once and for all. So I opened things up and found the limit switches. There are two of them on my furnace. One is the high limit for shutting down the heat if it gets too hot. The other is to control the blower motor. First I figured that they just needed replacements. So I purchased replacements for them. It didn’t help. In fact it got worse.

This is when I started to really research this problem. The way the limit switch works is that when the flame comes on and heats up the plenum then the switch will turn on the blower. When the flame goes off the plenum cools down and the switch turns the blower off. There are different temperatures for the switches. There is a high temp that is for turning on and a low temp for turning off. My furnace had a 115/20 switch. That means it turns on the blower at 115 and turns it off 20 degrees below that. So 115 on 95 off. The new replacement switch I got was 120/20. 120 on and 100 off. And the new switch made it worse.

This is when I realized what was happening. The heat would build up to 120 then the blower would turn on. My house was 64 and that cold air would enter and cool the plenum down under the turn off temp. What I needed was a lower temp switch.

So I purchased a 100/20 and that was a problem in the other direction. The blower wouldn’t turn off now. I guess it’s too close to 100 degrees in the plenum normally. So then I found an adjustable switch. It was about $15 but it was worth it to save in fuel and electricity.

I put the adjustable switch in and set it for 110/20. That night it still had the problem so I turned it down until it worked. Finally ended up close to 105/20 on the switch and it’s been working out great!

I’m posting this because there wasn’t many answers on the internet when I was searching for this problem. Lots of people have the problem but nobody posted any solutions (other than call a professional). So if you are having the same problem then pick up an adjustable limit switch and go for it. Also, many other furnaces already have an adjustable switch. Mine did not.

Update – 2015-02-12:

My fancy adjustable fan switch stopped working. Lame. Woke up in the morning with the fan cycling over and over. Turned it up and that kinda fixed it but now it’s doing the cycling when it’s cold again. So I ordered another switch that has a 30 degree difference. So it’s a 115/30. I think the problem is the difference span is too small. We will see.

I Love Ruby On Rails

For about six months now I’ve worked in a few other programming languages. Played a little in Go, and a lot in ASP.NET/C# for work.

Go is a pretty neat language. I like how simple it is. I really like that you can compile a binary, deploy it to a server, and run it. Really simple. It also compiles really, really fast. Fantastically fast.

I’ve only done a little bit in Go and I hope to do more in the future. I think it would be really great for an API behind an Angular or other type of JavaScript web app.

Now ASP.NET and C#.

First problem I have with it is that I have to run Windows. As you guys probably know I’m not a fan of the Windows operating system. I used Windows 1, 2, and 3 way back in the day. But soon as OS/2 came out I was done with Windows. After that I went to Linux in 1995. I haven’t looked back at Windows since. Although I did do a 10 year stint on Mac OS X. It was great at first, but that’s a whole other story.

Second problem is that I’m working on an old code base that has mutated over the years to its current state. C# isn’t too bad, but learning it while Shaving Yaks isn’t the ideal way to appreciate a language. I love my co-workers (if you’re reading this) and I understand how the cruft builds up when you aren’t given time to go back and tidy up.

I’m starting to understand Visual Studio a little but there is a lot of hidden switches in there. I’m not a fan. I’ve done most of my work in Sublime Text 3 just because I’m more used to how the editor works. Of course it works differently on Windows. And there is Resharper for Visual Studio that gives you a lot of goodness. It’s just too bad the IDE feels so clunky and slow.

Recently I got the chance to do some work in my old pal Ruby on Rails. I have to tell ya it’s a world of difference. It’s so easy to spin up a project. Even easy to spin up an existing project. And the language is so nice to use. It is nice to get back to interpreted vs compiled. No more waiting for the app to compile before I can see stuff in the browser. Although I do wish there was the option to compile Ruby into a binary.

I’m looking forward to doing some more work in Ruby on Rails. I do enjoy it very much.

Crock-Pot Stew

crock-pot-stew

During Christmas the topic of crock-pots came up. It was mentioned that I could have a crock pot and a few days later I picked it up.

I went online to find some beef stew recipes and start my adventures into crock-pot cooking.

I found a few and made a shopping list. Picked up some stew meat, potatoes, onions, celery, carrots, and a few other items.

I was going to start on the stew yesterday but I was invited out so I waited until today. I woke up this morning thinking about stew. Went into the kitchen and started getting things ready. Of course by then I had my morning meeting for work.

After the meeting I went back in to get started. Chopped everything up. Put the meat into a bowl and added some oil, seasonings, flour, mixed it up real good and put it on the griddle to brown. Then I put all my vegetables in the bowl and mixed them up with some seasonings. Once the steak was browned I put that into the bowl and mixed it all up again.

Then I put everything into the crock-pot and poured a can of beef broth in with it all. Turned it on low and put the cover on.

Right away the smell was wonderful. But I had around 8 hours to wait for it to cook. So back to work I went thinking about stew for dinner the rest of the day. ;-)

Every once in a while I would come out of my office and get a whiff of that awesome crock-pot stew smell. Every hour I was getting more and more hungry for stew. While I did my workouts, while I got some water, after I came back in from the mailbox (btw it’s a holiday, no mail). I can’t wait to chow into this stew.

bowl-of-stewThe best thing is that I only used half the ingredients for this batch. So after cooking this pot I’m going to cook another tomorrow. Excellent!

Once the stew was done and I had just finished my work day I went in a dished up a bowl. It was pretty good but needed just a little more salt and a little more spice. That was easy to fix though. Next batch I make I’ll add more ahead of time.

Now I just need to not eat too much! Already had two bowls and there is probably two more bowls left. Got to save it for tomorrow. So…full…

 

 

Working Out – Weights and Fitness

weightsPart of my new years resolutions is to working out consistently. I started to do it last year but stopped after having some elbow issues. Well, I still have the issues and I don’t think there is anything I can do about it. So I’m just going to ignore it and hope it goes away. There is no pain, just strange sounds.

So I’ve started back on the 10x 30 day challenge. This is where you start of doing 10 reps of something. Then the next day do 20, then 30, until the end of the month you are doing 300. It’s was pretty good when we did it last year. I felt really good when I was up to 300 a day. My plan is to settle into around 100 a day and take it all the way to the end of the year.

Last year I did the challenge with friends. We only did sit-ups and push-ups. But this time I’m taking it to the next level and adding weight lifting to it.

  • 10x Bicycle Crunches
  • 10x Dips and/or Skull Crushers
  • 10x Push-Ups and/or Bench Presses
  • 10x Curls with barbel and/or dumbbell
  • 10x Squats with weight and/or another leg exercise

Doing all five exercises each day adding ten for each day. I’m already at 60 today and I’m feeling the burn in my arms and tummy. This is good because I still have the 10lbs from Christmas in my belly. It’s so uncomfortable having belly feel bloated and having a hard time tying my shoes. LOL

 

Still Loving My WASDKeyboard

wasdkeyboard-desk

I’m still loving my WASDKeyboard. There was a little problem with a keycap hitting the side of the case and sticking but after a little light sanding it’s all good now.

I still love the sound and how loud it is. In a way it keeps me focused on typing because I can really hear it typing. It’s really neat.

It totally feels old school to me. Like back in the 80’s when all keyboards felt like this. I feel like I should switch back to terminal mode and only do green screen programming with it.

The only RSI I have these days is from using the mouse. Something that I really need to cut out. I wish that I didn’t even need a mouse. But maybe this year I can cut down on the mouse significantly.

I wish I moved to this type of keyboard years ago. The next one I will build myself. But that will be when I have money to burn. LOL

2015 Resolutions

It’s that time again for new year resolutions. We make them. Sometimes we break them. Sometimes we keep them and we become better people.

Last year was bad. This year I resolve to have a better year. There have been a lot of changes for me in 2014. Not all of them good but I’ll make the best of them going forward to the new year.

This year I resolve to put as much money as I can towards paying off my debt. I’ve ended up this year backwards to where I was a few years ago. And this year I resolve to spend only what I need to live. In the last few months I have my food spending below $200 a month. I have cut my electricity bill to $60/mo. I hope that my gas bill is much lower but it’s harder with that. I will go out a lot less. I will cut out buying alcohol, candy, and anything else that I don’t absolutely need. I really hope I have no emergency spending this year as well.

I resolve to become a 10x programmer. Or at least 10x from where I am now. If I can increase my productivity only 50% I would be happy. But I want to go all the way to where I was 10 years ago. Cranking out hundreds of lines of production code every day. Deploying code every day.

But I want to go further with this. I want at least 80% of my code to have tests. 100% of all business logic should have tests. I want to strive for bug free code. I don’t want to have to stop new features to fix problems with old features. I want to keep moving forward.

One of the biggest hurdles of getting my productivity back up is lack of interest in what I’m building for people. I don’t feel like they even care about what I’m doing. I get almost no feedback and the little I do get isn’t very enthusiastic. I need to overcome this personal issue and generate the excitement within myself to create motivation to continue to write 10x code.

Get into really good shape both mentally and physically. I have put off keeping in shape for the past few months. I started having problems with my elbow and thought I should stop to not cause any harm. But it doesn’t seem like there is any real problem in there. It’s still making the noises and it still doesn’t hurt. So I’m going to get back to weight training. I’m also going to add in some cardio to get my stamina back up.

Part of getting back into shape is to start standing at my desk instead of sitting. I feel really comfortable sitting while programming so this is going to be really hard. I’ve done this for over 30 years. And I don’t much like standing all day. I remember having a job where I stood all day and I was so sore when I finally got to sit. But I guess we will see how that goes. I want to at least do a year. That should give me some results to measure and see if I want to continue.

I resolve to cut out time wasters. TV is a huge time sink. So is Facebook, Twitter, Instagram, and all that other stuff. It just sucks me in and I do nothing for hours. As a buddy use to say, “bad brain food.”

I will continue to use social media but it will mostly be output only. I will cut back my consumption to once per day. This is going to be struggle. It’s so ingrained within me now. But stopping cold turkey is going to be the best way.

I will also use my blog more for my output. I can send my posts to all the social systems from here. This way I can cut my usage of the services. I hope I don’t miss too much but once I train my friends and family to contact me directly I think it will be fine.

So to recap my resolutions (TL;DR).

  • Pay off debt as fast as possible.
  • Be a 10x programmer.
  • Become healthy and strong.
  • Cut out time wasters.

It doesn’t seem like these four items will be too hard to do within one year. Good luck to myself.

Now if I can just find someone with a sharp stick to keep me inline I’ll be set.

Moving on from 2014

2014 has been a rough year for me. I wish this posting wasn’t so negative but I just want to write this all down.

My dad passed away in May. He was getting pretty sick at the beginning of the year. I really wanted to go to Florida and see him but I just could not afford it. I should have done it anyway.

I loved my dad. Before he passed he was talking about coming back here for the summer. I really wished it could have happened.

Once I have my 4×4 running we are going to spread his ashes here in Silver Springs. He loved it here. Him and his dog Sophie will be spread on a windy day from our favorite mountain top.

The project at work I have worked on for years was canceled in August. It was almost ready to launch. I was so close to having it usable.

After another total rewrite of the system I was finally happy with how it was working. I split it all up into small chunks with an API to link them all together. It had a Ruby on Rails API backend and all the front end parts were Angular.js. It was working pretty good and I just needed to put back the last of the features. Mostly small things. A few tweaks here and there. It was probably my best programming ever.

But work thought it would be better to go with another system from a 3rd party due to having more support staff. I really do hope it turns out well.

I was put on some other things to do. Mainly working on an ASP.NET project written in C#. That means I have to use MS Windows and Visual Studio.

I have been against using Windows for most of my life. I have spent many years evangelizing Linux. Not to mention that I’ve never used .NET or worked in C#.

But here I am. Working on technology that I don’t like because I really need the job. It’s been really hard getting over my prejudice of Microsoft and working on this stuff. I’m forcing myself not to rewrite the thing because I really want to not have to use Windows.

My wife left me in September. Her allergies were getting worse and she had moved out of the house in June. On top of that she was really drinking a lot. It was getting pretty bad but I had no idea what was to come.

She told me in September that she no longer loved me and was going to move to the bay area. She had a friend that was setting her up with a house, an art career, everything she needed to succeed in life as a painter.

We agreed to get divorced in October and that didn’t happen. We agreed that I would take all the debt and I would get the house in Silver Springs. She would take her stuff and the car. It would have been a great deal for her. She would have walked away from this totally burden free and able to start her life over.

I guess she got greedy, reneged on her word, and would not sign for the divorce. We could not agree and she then started maxing out all the credit cards putting us $75k in debt.  At one point spending $4,800 at one store.

She was getting put in hospitals by the police for being drunk. She lost her house and career due to getting drunk. She is trying to burn bridges with her friends and family.

It has been awful and I was forced to sue her for divorce. It’s probably going to put me a $100k in debt when it’s all over. It’s going to take months to complete. So much pain, heartbreak, and disappointment.

You could think that it’s been a bad year. It has been, but there were a few good points.

I finally made it to the Born Free Motorcycle show in LA. Road down with friends on our bikes and had a pretty good time. Celebrated my birthday there.

I was able to do a few more motorcycle rides this last summer. I was able to put almost 6,000 miles on my Yamaha chopper this year. Had a lot of fun riding.

Spent quality time with friends. Planned more time for next year.

Collected a few more parts for my new rock crawler that I’m building. Just need a few more things to finish it off. I also have my 1970 Sportster almost finished up. Just need to fix the clutch and make sure all the bolts are lock-tighted.

I hope that going into 2015 will be a good year. I have many plans and resolutions for next year that I will write in my next post.

Best wishes for a new year to everyone reading.

My Grid Based CMS – The Stack

I’ve been doing a lot of research on what I’m going to use for my Grid CMS system tonight. Here is what I’ve come up with so far.

  • Apache CouchDB
    • I can run CouchApps in CouchDB unlike CouchBase and other DB’s.
    • Deployment is as simple as replicating the DB.
    • BigCouch for redundancy.
  • Kanso
    • Easy deployment
    • Packages
  • CoffeeScript
  • HAML/SASS
  • Material Design (Google)
  • Angular.js (maybe)

I think that’s all I need for this project (I hope). I want to keep it as simple as I can. Less is more right?

Now it’s time to start working on the feature set.

WASDkeyboards v2 – Yep, I got one

new-keyboard

I’ve talked about getting a mechanical keyboard for a while now. The keyboard is a pretty important part of my job and life. It’s important to have a good one.

My $15 keyboard finally started to wear out. The enter key was sticking and that was the most annoying part of it. It was a good keyboard really, but could not stand up to the thousands of lines of code I put on it.

So I finally broke down and got a real keyboard. Something that will last for years. Something that will fit with what I do.

I purchased the WASDkeyboard v2 with a custom key cap set.

This keyboard feels like I went back in time to the 80’s except it’s a lot smaller than keyboards from back then. It feels pretty good. I went with the blue key switches so it’s pretty loud when typing on it. I like the sound a lot. It feels like I’m really typing on this thing.

The keyboard makes me want to use 80 column console with a green screen. LOL

Time To Build A Replacement For WordPress

For years I’ve been talking about building my own CMS system to replace my WordPress hosting service. It’s time for me to quit procrastinating and get to it.

WordPress is a great system for simple website/blog. But almost every one of my customers has problems using it for their commercial web sites. It’s just too hard for them to understand. Once they figure out the basics of WordPress they run into the visual editor problems. You just can’t make good-looking web pages using the WordPress visual editor. So you have to switch to text mode and learn HTML. My customers really don’t want to learn that. They just want to update their web sites and for the updates to look good.

Another problem with WordPress is that it’s horribly slow. Sure you can add caching plugins and build custom themes, but it’s still not as fast as serving static pages and assets. It’s doing too much rewriting and processing. 99% of my customers don’t even need dynamic pages. Static sites would be just fine if I didn’t want the customer to edit their own content. I’m looking to do less work, not more.

I have looked into a great deal of other CMS systems and have not found anything that fits. They all are the same UI that doesn’t really match what the end-user wants to do. Then others are way too complicated for the job they are doing.

I came up with an idea while working at DealerTrend many years ago when we started using grid layouts. If there was just a grid that my customers could add text, graphics, and widgets to that’s all they need. Excel for web sites really.

Not only will it make it easier for my customers it will also make it easier for me to build out web sites. I won’t have to mess with customization to themes just to put a menu above the header or below it. I don’t have to use complicated CSS overrides to tile info blocks. In fact overriding CSS won’t even need to happen.

A few years back I wanted to build this new CMS as a CouchDB app. Just HTML, JavaScript, and CSS in a CouchDB. To install it you just replicate it from the main server. Then you can host it across 100 CouchDB nodes if you wanted. CouchDB serves assets and everything. It works well. But it seems that CouchDB apps never really took off. Especially now that CouchBase is around. I should at least give it a try.

So each page will be a document in WordPress. It will just be served as a static web page with a bit of rendering. This way every page can be different if you want. You can clone a page or create a whole new page. The UI will just be a menu bar at the time and a grid that you can add stuff to below that. It’s just so simple.

Widgets will be just that. Plugins that you install and add to your pages. A widget could be a calendar, text cloud, menu bar, side-show, or whatever. I’m not sure how I’m going to implement widgets yet. I’m guessing they will be HTML/JavaScript/CSS that is embedded in a document page. I guess it could really be just that simple.

I will really need to brush up on my JavaScript skills now. Time to start learning.

My New Linux Workstation – Pure Awesome

XignuxFinally after a months of hacking I have my workstation running great. There were a few problems that I had to addressed, but I got through them and came out triumphant.

I received the Xigmatek case on a Monday night and I started to tear into it as soon as I got it in the house. I like the case. It’s pretty nice. It has a huge fan in the front and some nice styling lines. The ports on the side are in the wrong place because they will be up against the wall where I’m putting it but that’s OK. I don’t need to use them often.

no-room-power-supplyAfter admiring the case for a while I take the power supply and shove it into the bay only to find out that it’s too big. It fits in but the modular cables don’t have room to plug-in. Oops. This isn’t going to work.

I figure that I’m probably never going to use the drive bays in front of the power supply so I took out my cut off wheel and went to work. I sliced it open so I could feed the wires through and plug them in. Not too bad. This will be fine.

asus-rage-ivThe motherboard is beautiful. I haven’t been in the game for about 10 years. I haven’t looked at any custom systems recently and all the computer’s I’ve bought up to now have been Mac. I was expecting the same ol of this motherboard as I saw 10 years ago. I put my 32GB of ram in and my i7 4930 CPU on. Then time for a test fit.

I place the motherboard in to find they shorted me one stand-off. No big deal I can work around that. I dig through my boxes for another stand-off that fits. Nothing. Well, I’m not playing football with it. Motherboard mounted.

You should see this CPU cooler! It’s HUGE! The Noctua NH-D14 is highly recommended by many vloggers in the tubes. And no kidding. This thing has great specs. This will keep everything nice and cool for a long time. If I can keep it from filling up with dirt/dust.

lots-of-coolingSo I put my gigantic CPU cooler on the board and slip the board into the case. It hits the CD-ROM tray! No problem. Who still uses CD-ROM’s? I’m not using that bay so out it comes. No more space issue. Mounted cooler and fans no problem.

I then get everything plugged in and ready to go live. I can finally press that shiny silver button on this really cool case…

Nothing.

No status, no beeps, nothing. I think I spent two days trying to debug why the MB would not boot or even light up. Finally after reading the entire Internet I found out that the board is not compatible with my CPU with the current BIOS installed.

This is no problem because you can flash the BIOS on this board even without a CPU in it. Awesome. So I dig out a USB key, put the software on it. Plug it into the port on the back. Do the magic and….nothing.

I try, and I try all night. As a last-ditch effort I find another, old, USB key and put the software on. Boom! It works perfectly. Now I have the new firmware loaded. I’m keeping this key around for when I need it later. Tape it to the inside of the chassis.

At this point I have the motherboard stripped all down to nothing. So I build it all back up. This time I just build up enough to do a test. It boots! Then I put it all back together and jam it all back into the case.

Crucial-Ballistic-RamNext problem. It only shows 24GB of my 32GB of RAM. Not sure why. After messing around with BIOS and software for a while I ended up finding the problem. I removed all the RAM and tested each one. They all worked. I put them all back in and there was all my 32GB of RAM. So I guess I didn’t have one seated all the way.

I booted the system and started installing the software. Right away I noticed that the Video Card fan was super loud. After a few days of really loud fan I found a way to silence it. I wrote a short Ruby program to check the temp and set the fan speed. At 20% speed it was pretty quiet. It would never need to get above 30% and that wasn’t too loud either. Not sure why this isn’t something built into the card.

bad-video-cardAfter a while the card would bite me again. I had constant issues with bad video performance. When I scrolled web pages it was awful screen tearing. Turning on the feature to help with that only gave me other problems with the card. Flickering screens when anything was moving. Running out of on-board RAM. Not a good experience with it.

nvidia-nvs-510Finally I broke down and got another Video card. This time a Nvidia card. 100 times better. The default open source drivers almost work perfect. But I opted for the tested proprietary drivers to get a little better performance. The fan is silent and auto-adjusting. No more problems.

dell-ips-22So far I’m not super happy with my screens. I purchased three of the Dell IPS 22″ monitors. I really like them but I wish the resolution was just a bit bigger. I’m super happy with the actual size of them. 22″ was a good call. I’m running them in portrait mode so I have really tall screens. I wanted this because I deal with web pages and code. So tall is better than wide. But at only 1080 wide I’m running into not enough pixels to show a lot of sites well. I might have to reconsider this in a year or so.

Screenshot from 2014-04-11 16:58:35I also need to get a better keyboard. This keyboard was super cheap. Like $10. It’s a good keyboard for the price. But I can feel that I’m starting to wear it out. I do really love the full size keyboard though. After being on a notebook/ultra-portable keyboard for so many years its super nice to stretch out my fingers. Having all the keys without having to monkey with Fn key combos is super nice. The next keyboard I get will either be a kit or the WASD Keyboards 87 key bare bones with a custom key caps package. Since I spend about 8 hours a day typing, I should spend the money on a good keyboard.

Overall the system is really, really fast. I can load everything up and only get to 75% RAM usage. The CPU is over-clocked to 3.9GHz and I could take it up to 4.5GHz if I wanted. During the summer I think I’ll keep it low and maybe run it a bit faster in the winter.

I’ve been working on this post for about 3 months. It’s finally time to just press Publish on it.

Auto Video Card Fan Control For AMD Radeon 7770

xfx_r7770_core_editionWhen I got my new PC I wasn’t very happy with how loud the fan was on the video card. I picked up the XFX R7770. It was about $100 on Amazon. It’s an all right video card save a few small issues. One of the biggest issues is that the fan is so loud by default.

After searching and trying to figure it out I came across a tool that could set the fan speed (and over-clock the board). After figuring out the controls I was able to set the board to 20% fan. Perfect!

But there is a problem. It’s a hard number and not dynamic. I needed the fan to change depending on the temp of the card. The same tool that sets the fan can also report the temp. So I created a daemon for it.

#!/usr/bin/env ruby
# encoding: utf-8

#
# Required Gems
#
# gem install fallen clap
#

require 'fallen'
require 'fallen/cli'

def get_temp
  temp_str = `aticonfig --adapter=0 --od-gettemperature`
  temp_str.scan(/Sensor 0: Temperature - (\d+\.\d+) C/)[0][0].to_i
end

def get_speed
  speed_str = `aticonfig --pplib-cmd "get fanspeed 0"`
  speed_str.scan(/Fan Speed: (\d+)/)[0][0].to_i
end

def set_speed(speed)
  `aticonfig --pplib-cmd "set fanspeed 0 #{speed}"`
end

module Azazel
  extend Fallen
  extend Fallen::CLI

  def self.run
    @thresholds = [ 40, 60, 65, 70, 80, 85 ]
    @speeds     = [ 10, 20, 25, 30, 45, 50 ]
    @speed  = 100 # default speed

    pid_file "/var/run/quiet-fan.pid"
    stdout "/var/log/quiet-fan.log"

    puts "#{Time.now} Started."

    while running?
      temp = get_temp

      @thresholds.each_with_index do |threshold, index|
        @speed = @speeds[index] and break if temp < threshold
      end

      set_speed(@speed) if @speed != get_speed

      puts "#{Time.now} Temperature: #{temp}°C / Fan speed: #{@speed}%"
      sleep 10
    end

    puts "#{Time.now} Ended."
  end

  def self.usage
    puts "Quiet-Fan Usage:\n"
    puts "  quiet-fan.rb [ start | stop ]\n\n"
    puts "start: starts quiet-fan in the background"
    puts " stop: stops the background running quiet-fan"
  end
end

case Clap.run(ARGV, Azazel.cli).first
when "start"
  Azazel.daemonize!
  Azazel.start!
when "stop"
  Azazel.stop!
else
  Azazel.usage
end

I run this daemon from init.d and all is good. It can possible work for other cards and you can tweak it to fit even more.

It’s also possible that the card has something built-in but I haven’t found it yet. This works for me.

Mechanical Keyboards

Screenshot from 2014-04-11 16:58:35I find myself longing for a Mechanical Keyboard.

I know, I know. I just got a new keyboard with my new system. It’s a fine keyboard. I was $15 on Amazon. I do actually like it for the most part. But I keep looking at a fancy pants Mechanical Cherry MX Red switch expensive keyboard.

After all, I do spend 8 hours a day typing in the codes to make the interwebs work. I should probably have the best keyboard I can find, right?

WASD Keyboards has a nice one. I’m looking at the 87 key bare bones with Cherry MX Blues and a key caps package. $150!!!

It’s a great keyboard.

I should have a great keyboard.

So I’m saving up.

Ubuntu Gnome 14.04 Beta 2

trustyI’m sitting here waiting for my backup to finish so I can install Ubuntu Gnome 14.04 Beta 2. I’m actually booted into it and testing it out while I’m doing my backup. So far I really want it on my system. I want to really put it through the test with all my daily software.

The main reason I want to use it is the improvements for high DPI screens. My laptop is somewhere around 350 DPI. 13.10 was awful at this resolution and I kept trying to figure out how to get everything to look right. I use my system mostly for work and I don’t do much if any gaming or graphics. I spend most of my time in a text editor and web browser.

The web browser is where it all goes wrong. I have to zoom up to 150% so I can read most web sites. If you are one of those web developers that force 10 point font on everyone then get stuffed. The problem with zooming is that borders and columns stop lining up right. Pixels from one element to another are out of whack. Padding is different. So before I push the web sites out I have to set my zoom to 100% so I can see if the pixels are lining up right. Then I tweak for an hour before I can ship it.

So far with the improved resolution of 14.04 I haven’t had that issue. I am zooming sites to see if I can find any issues with the alignments and so far it’s been fine. By the way, Google Chrome is the worst offender of the problem.

Squirrel… Why is Google Chrome getting worse at rendering sites? Chrome was the best for a long time. I’ve been using Firefox to test things, because people have reported rendering bugs in Firefox, and I’m finding a lot of sites just work better in Firefox. eBay is one of them. Try to post an item on eBay in Chrome. I don’t know if it’s just my setup but it’s impossible. Half the posting screen doesn’t render. Works great in Firefox. Same problems with the BofA home banking site. There are things that just don’t work in Chrome anymore, and I’m using the latest “stable” version. Digress…

I really like the new version with the high res screen improvements. It was one of the few things that bugged me about Gnome Shell. I can’t think of anything else that I would change at the moment.

Thumbs up to the Gnome dev team!

My New Rosewill Keyboard

rosewill-keyboardThe keyboard that I ordered for my new workstation is the cheap Rosewill $14.00 slim low profile full size keyboard in black. It’s actually not too bad. I like the look of the keys. They are square and low profile as well, but not as low profile as laptop keyboards. I wanted something with a little bit more travel and a better sound. This keyboard hits those marks.

I wish it was a bit lower on the table though. It’s about twice as high as my laptop keyboard. I was expecting something a bit more “low profile”. It’s pretty wide too. I haven’t been on a full size keyboard for probably 8 years. I’m going to have to get used to the mouse being way far away. I might just switch to my left for mousing.

I’m typing 58 words per minute on it so far. That’s pretty good. I didn’t check my speed on my old keyboard, but that Dell has a horrible keyboard. The space bar doesn’t always work and you have to mash the arrow keys (I know I shouldn’t use the arrows, lol). The thing that really bugs me about most laptop keyboards is the left CTRL key is too far away. I use that key a lot.

I’m not fully sure if I like it yet, but it was only $14 so it’s OK if I don’t. I would love to try out a Das Keyboard someday. I would have to really, really like it to justify the price. Those keyboards are pricey. But they are suppose to be the best thing out there. I’m not sure. But typing in a all black term would bring back some memories. Late night coding sessions might be a bit noisy when Jane is sleeping.

Thinking About a Linux Workstation

Xigmatek-AquilaI’ve been playing around with the idea of building a new Linux workstation PC. My XPS13 is starting to feel a little cramped and I’d really like to have a bit more speed. Also the screen on my WindowsQA testing system died a few weeks ago and I can’t use it now. It is pretty weak anyway. It was like $250 from Best Buy.

I stayed up late last night checking out reviews and searching for components. I found some pretty cool boards and cards. Things sure are faster than they used to be 15 years ago when I last built a PC. My goal was to get something that compares to the new Apple Mac Pro. I think I’ve found something that’s pretty good.

Here is what I have so far:

So this package is $2,220 and is pretty nice. I can clock it to 4.8GHz, has 32GB RAM and nice SSD. It has a pretty good graphics card.

I think I would be pretty happy with this setup. And with this much power I could get rid of my WindowsQA desktop and just run everything in VM’s. It should also be great for compiling Go code. I’m kinda looking forward to it.

Update: I decided to go with a slightly bigger option of the Micro-ATX that can go up to 32GB of ram. Had to go to a bigger case. Don’t really like the case but it’s the best I can find so far.

Update 2: I added the 6 port video card because it was the same price as the 4 port and has twice the memory. Might as well.

Update 3: When NewEgg says “With Power Supply: Yes” that really means “No, it doesn’t have a power supply inside.” So I added a power supply to the mix.

Guard – Why Won’t You Auto-Run My Tests! (Fixed!)

I’ve been having this problem recently. I can’t figure out why Guard will not auto-run my tests when I change a file. On old projects I could edit a file, save it, and Guard would run tests on that file. Worked great. Jump forward to my recent projects. I have to manually run my tests and it’s a PITA.

I’m running Ruby 2.1, Ruby 2.1.1, Rails 4.0.3.

New Rails project

rails new test-project

Gemfile:

  source 'https://rubygems.org'
  gem 'rails', '4.0.3'
  gem 'sqlite3'
  gem 'guard'
  gem 'guard-minitest'

Guardfile:

  guard :minitest do
    # with Minitest::Unit
    watch(%r{^test/(.*)\/?test_(.*)\.rb$})
    watch(%r{^lib/(.*/)?([^/]+)\.rb$})     { |m| "test/#{m[1]}test_#{m[2]}.rb" }
    watch(%r{^test/test_helper\.rb$})      { 'test' }

    # Rails 4
    watch(%r{^app/(.+)\.rb$})                               { |m| "test/#{m[1]}_test.rb" }
    watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
    watch(%r{^app/controllers/(.+)_controller\.rb$})        { |m| "test/integration/#{m[1]}_test.rb" }
    watch(%r{^app/views/(.+)_mailer/.+})                   { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
    watch(%r{^lib/(.+)\.rb$})                               { |m| "test/lib/#{m[1]}_test.rb" }
    watch(%r{^test/.+_test\.rb$})
    watch(%r{^test/test_helper\.rb$}) { 'test' }
  end

Output when I change a file:

  11:23:26 - DEBUG - Stop interactor
  11:23:26 - DEBUG - Hook :run_on_additions_begin executed for Guard::Minitest
  11:23:26 - DEBUG - Hook :run_on_additions_end executed for Guard::Minitest
  11:23:26 - DEBUG - Start interactor

Output when I press [ENTER]:

  11:31:27 - INFO - Run all
  11:31:27 - DEBUG - Hook :run_all_begin executed for Guard::Minitest
  11:31:27 - INFO - Running: all tests
  11:31:27 - DEBUG - Command execution: bundle exec ruby -I"test" -I"spec" -r bundler/setup -r minitest/autorun -r ./test/controllers/thisisatest_controller_test.rb -r ./test/helpers/thisisatest_helper_test.rb -r ./test/test_helper.rb -r /home/phill/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/guard-minitest-2.2.0/lib/guard/minitest/runners/old_runner.rb -e "" -- 
  Run options: --seed 3898

  # Running tests:

  .

  Finished tests in 0.047909s, 20.8730 tests/s, 20.8730 assertions/s.

  1 tests, 1 assertions, 0 failures, 0 errors, 0 skips

  11:31:28 - DEBUG - Hook :run_all_end executed for Guard::Minitest

Here is my GIST of the problem: https://gist.github.com/Phill/9215877

Update!

I found this thread https://github.com/guard/listen/issues/155 that solved my problem. It had nothing to do with Guard/Listen. It was my text editor. I’m using Sublime Text 3 and with Atomic Saves turned on it would not trigger Listen for changes. Turning it off in the config fixed the problems.

"atomic_save": false

Minitest and CouchDB

I ran into a problem recently where I needed to reset the DB when I ran my tests to avoid duplicate inserts. There are plenty of tools out there for other databases including MongoDB. But nothing for CouchDB using CouchRestModel. But it’s easy enough to just build something. After all, it’s just a DELETE/PUT http call to the db server.

In my test_helper.rb I added this:

def reset_test_db!
  puts "\n*** Reset Database\n\n"

  @host = 'localhost'
  @port = '5984'
  @path = "/[mydb]_test"

  # Delete database
  request = Net::HTTP::Delete.new(@path)
  response = Net::HTTP.new(@host, @port).start {|http| http.request(request) }

  # Create database
  request = Net::HTTP::Put.new(@path)
  response = Net::HTTP.new(@host, @port).start {|http| http.request(request) }
end

reset_test_db!

That’s all I needed.

Yeah, I know, I need to abstract out the database name. I’ll figure that out the next time.

Firefox v30 (Nightly Build)

FireFox

I’m really enjoying Firefox v30. The new interface is pretty nice. And I’m finding that it is a lot faster than Chrome for a lot of sites. I’m going to try to switch over, but there are a few sites that just work better in Chrome (Google sites).

I’m also finding that Chrome isn’t working for a lot of sites recently. Like BofA and AT&T. Not the greatest examples, but I use them enough that it’s annoying. Like sometimes when I click things nothing happens or it reloads the same page. Might be a JavaScript bug but I don’t know. Another tid-bit is that Firefox passes the Acid test 100% and Chrome does not. Not sure if that means anything though.

What brings me to Firefox recently was reported bugs viewing some of the web sites I’ve build. Easy fixes usually but strange they display fine in Chrome/IE but not in Firefox. So I need to use it more anyway.

I think I’ll use it as my non-work browser for a few weeks. Time to find all the extensions I use and get them installed. The default theme is pretty good, but could be a tiny bit better. Fits my use case better than Chrome. I need to find a good ad blocker. FireFoxAdKiller doesn’t really seem to work all that well so far. Probably just me.

Anyway, I think I’ve typed enough words to be a decent size blog post. Back to my Chef server scripts…