A recent upgrade of my server to Ubuntu 8.04 beta forced me to solve an issue I have been having with the integrated MCP55 ethernet and recent Linux kernels. At boot the network interface appears to come up and shows as up in ifconfg. However, it just will not work. Eventually I found a fix on the Gentoo Wiki. However, adding the forcedeth module options specified to /etc/modprobe.d/options did not fix the problem. I think that the kernel is loading the module from initramfs and that needs to be updated as well. This is what fixed things for me.
Add the following line to /etc/modprobe.d/options
options forcedeth msi=0 msix=0
Then rebuild initramfs like this
sudo update-initramfs -u
BTW - this was the only issue I came across doing the upgrade over ssh. Everything else worked perfectly.
This weekend I thought I would have a go at throwing together a Rails front end to my mythtv database. I thought this would be easy but it seemed to highlight one difficulty after another with using Rails with a so called “legacy” application (one that already exists and not designed for Rails).
To start with I used the Rails install that comes with OS X. I did something like
rails mythrails
cd mythrails
#edit database.yml
ruby script/generate scaffold Program program
Since this is a so called legacy application you need to edit config environment.rb to tell rails not to pluralize table names
ActiveRecord::Base.pluralize_table_names = false
and edit the model to tell it what the table is actually called
class Program < ActiveRecord::Base
set_table_name "capturecard"
end
then starting the web server gives you a web interface to the program table. It’s really simple. But …
If you try to edit the data or create a new entry it will complain because (I think) there is no id field in the program table. This lead me to discover that you can add something like
class Program < ActiveRecord::Base
set_table_name "capturecard"
set_primary_key "the_id_field"
end
This raises the next problem. Rails can not cope with composite primary keys. You need to install composite_primary_keys. However, this leads to the next issue - composite_primary_keys needs Rails 2. This then has the side effect that generating the scaffold no longer works. In Rails 2 you need to specify the fields and types for all the fields in the table. In the case of a legacy system the table already exists so why can’t the scaffold generator just read the fields from the database?
At this point I gave up. I am sure this is not too hard to work around but I only wanted to play and this all seemed like it was getting harder than I ever intended.
I was playing with styles in the K2 theme I am using. I came across blackboard which I think looks quite nice. Everything worked fine except the sidebar (to the right) that kept appearing at the bottom of the page (but still over to the right) below the last post. I was able to fix it by changing the blackboard css so that the margin property in the following
.secondary {
font-size: 1em;
line-height: 1.5em;
padding: 10px 0;
margin: 0 0 20px 71%;
width: 26%;
color: #666;
position: relative;
}
looked like this
margin: 0 0 20px 0%;
Now this is the first time that I have played with CSS so apart from the fact that this is changing the margin-left value I don’t really understand what I did.