Hacking Journal [2006/01/13]
Kubuntu and Books
[2006/01/13]
I got another motherboard and CPU from a friend so I now have another box to tinker on. It has taken me about 2-3 days to get Kubuntu installed but that can be tracked down to over half my DDR RAM crapping out. Good thing I had [Memtest86+][] and a few hours to test it all. I now have it booted and running on a AMD 1900+ with 1 GB of DDR400 and a 20GB Hard Drive…. but it is all outside the case, kinda cool looking.
I also got in my shipment of books from Amazon.com. I have started to read The Mythical Man-Month finally, and it is a pretty good read so far. I also got in a hard copy of Time Management for System Administrators This book is definitely a 5-star book, I read it first on Safari and then just had to have it. I will be posting a review of it soon after I re-read it in paper form. I also got a paper copy of Agile Web Development with Rails I have had the PDF since the second Beta book but I needed a paper copy for work.
Tomorrow I will try to hack on my website ideas a bit more.
Eric Davis
[Memtest86+] :http://www.memtest.org/
MacWorld 2006
Well I just visited the annual San Francisco MacWorld Expo. It was ok, I am not a people person so I did not enjoy the crowds. But it was pretty cool, I got to see what a lot of companies are doing and where innovation is (it definatly is not in iPod accessories, about 50% of the booths were touting iPod protectors). A few good booths were the Elgato booth (EyeTV makers (Mac PVR)), the EFF, and the Delicious Monster who were fully decked out in camo garb. While I was there I also entered to win about 6 iPods (I still don’t own one) and a Powerbook.
I think the most disappointing part was Apple’ news. Sure they announced the Macbook and the Intel iMac along with 06 versions of their software but I was really unimpressed. The MacBook really just looks like a Powerbook but is faster. The new software just looks like a version bump, not too much added at all.
I will admit though, I believe I have caught the GNU bug now… so any non-Free software just rubs me the wrong way [In fact I found 2-3 good ideas that would be good to add to the community]. I would post pictures but my camera’s batteries died on the trip there so until the OCR in OSX can scan mental pictures you are out of luck.
Eric Davis
Hacking Journal [2006/01/10]
New Project, Old Hacks
[2006/01/10]
Today was yet another busy day in my Rails world. Between building up the new website for my work to trying to start my own from scratch, I am beat. At work I finally got a full access limits coded in and tested. Over 1200 lines of tests for 400 lines of code, pretty ratio. I think doing a time rake test_all turned out at about 8 seconds on my Dell 700m. I think tomorrow I will be adding in some ActionMailer to send emails when there is new content that needs approval.
On the home-front, I decided to custom code my own website. I have been debating between doing a Ruby on Rails blog (similar to Typo but more lightweight) or a custom Rake generated one (similar to Martin Fowler’s). I am prototyping the Rails one but something is telling me to do the Rake version instead. Heres a quick breakdown chart as of now:
| Rails Version | Rake Version |
| Database backed | html generated files |
| Dynamic pages | Static html |
| Comments allowed | No comments |
| Must run on FCGI | Can run anywhere |
| Good learning experience in Rails | Good learning experience in “Ruby”:http://www.ruby-lang.org |
| nil | Improve yaml skills |
| Could Open Source Project | Too Custom to Open Source |
I dunno what I will go with, I am leaning to the Rails version but I will know in a few days.
Eric Davis
Hacking Journal [2006/01/09]
Day one, raking the leaves
[2006/01/09]
Well this is the beginning of my personal hacking journal. I will use it to track all my progress and thoughts with hacking code.
Today I decided to sit down and make something with rake. Since I have not been good on updating my life graph recently I felt, if I could automate it I would use it more often. After about an hour of work I had a basic working Rakefile that would do the entire process for me.
- By running `rake` in the directory it would first run the task `ask`
- This used simple print and gets to ask me how I felt on each category for the day, which it then appended to my yaml.
- After that, my yaml would be newer than my life.png so it would run my Ruby script to re-generate the life.png image.
- Finally it would ssh that image to my webserver.
By setting this up I cut out a ton of manual work; from opening TextMate to add the day to the yaml, to running the generator, to ssh’ing the file to my server. The hardest part was getting my data to append to the yaml file. first I used puts in the File.open {|x| .. } block without calling x.puts. This meant that the data was just written to the bit bucket. Once I fixed that I found I was overwriting my yaml each time, I guess File.open(“life.yaml”, “a”) is for appending…. not “w”.
So that is about all for today, looks like I will be doing some major has and belongs to many tomorrow at work on our new website so I need to rest up.
Eric Davis
http://rake.rubyforge.org/
dropbox.theadmin.org/media/life.png
My Ruby Cookbook: #2 LugRadio Mirror Add
I have been mirroring the LugRadio broadcast for a while on my server here. For each new episode, I have to download the new files and then add the urls for those files to their mirror database.
Being that I am lazy and I love ruby (and the php script was ok but Eric.like(:php) == false ), I wrote a mirror add script for myself.
The guts of the script:
#!/usr/bin/env ruby
# Fill in the http url to your files here, no trailing '/'
my_address = "http://lugradio.theadmin.org"
ARGV.each { |file| `wget http://www.lugradio.org/addmirror/#{my_address}/#{file}`}
It will basically use WGET to add in each file you use as an argument. For example I added the latest four by doing
lugradio-add.rb lugradio-s03e06-030106-high.mp3 lugradio-s03e06-030106-low.mp3 \ lugradio-s03e06-030106-high.ogg lugradio-s03e06-030106-low.ogg
Next I will try to use NET::HTTP goodness to remove the wget dependency and also make one to fetch the current files from rss.
Eric Davis