Categories
Computing FreeBSD Windows

My Ideal Operating System

What would my ideal Operating System look like?

  • Really small minimal installation. You know, like OpenBSD.
  • Thorough and comprehensive help pages. You know, like OpenBSD.
  • The ability to simply administer the OS remotely. You now, like SSH on OpenBSD.
  • Excellent, easy to configure firewall. You know, like pf on OpenBSD.
  • Easy to configure network redundancy. You know, like CARP on OpenBSD.
  • All communications between servers to be on well-determined ports.
  • Easy to manage centralised authentication. You know, like Active Directory on Windows.
  • Redundancy of authentication servers. You know, like Active Directory on Windows.
  • Automatic replication between authentication servers. You know, like Active Directory on Windows.
  • Automatic discovery of authentication servers using a simple system like DNS. You know, like Active Directory on Windows.
  • The ability to configure settings on clients centrally. You know, like Group Policy on Windows.
  • The ability to manage disks in almost any way imaginable. You know, like Veritas Storage Foundation.
  • The ability to replicate disks between systems. You know, like Veritas Volume Replicator.
  • Easy to use clustering. You know, like Veritas Cluster Server.
  • The ability to simply install OS updates. You know, like freebsd-update on FreeBSD.
  • The ability to centrally manage OS updates across the organisation, downloading only once. You know, like WSUS on Windows.
  • Centralised logging.
  • Built-in monitoring of hardware sensors. You know, like sysctl hw.sensors on OpenBSD.
  • Everything monitorable by SNMP.
  • A clear support lifetime policy. You know, like OpenBSD.
  • And finally, I want it Open Source. You know, like BSD-type open.

Is that too much to ask?

Categories
Rails

The problem with renaming a model in Rails

So you’ve decided to rename a model in Rails. What could be simpler than renaming and editing a bunch of files? You make your edits in development, run migrations and so on.
There’s a potential issue you might hit though. Suppose you have model Foo, which you want to modify (e.g. add a column). So you create a migration with:
add_column :foo, :quantity, :integer
…and you run your migration.
Then you decide you want to rename the model to Bar. So you use rename_table in your migration, and rename and edit the appropriate files. All works beautifully.
Now you come to deploy, and it all goes wrong when you migrate the database, saying it can’t find the model. The reason? Well your first migration now refers to a model that doesn’t exist, because the new model file is in place.
The messy solution is to perform the migration yourself, by renaming the database table directly in the database.
The clean solution is to avoid making changes like this in the first place. I guess it’s an example of where “deploy often” can reap benefits.