
Please feel free to find and add veterinarians, associations, clubs and more on http://www.woopets.com/services
Services are using mostly google geokit to manage proximity.
I'm using mpt-statusd on a debian lenny server to monitor raid Status.
However the status of raid is OPTIMAL :
$ sudo mpt-status -i 4
ioc0 vol_id 4 type IM, 2 phy, 698 GB, state OPTIMAL, flags ENABLED
ioc0 phy 1 scsi_id 6 ATA Hitachi HDS72107 AB0A, 698 GB, state ONLINE, flags NONE
ioc0 phy 0 scsi_id 5 ATA Hitachi HDS72107 AB0A, 698 GB, state ONLINE, flags NONE
I keep having messages in syslog "detected non-optimal RAID status" (and sent by mail by logcheck...).
Here's a patch to fix /etc/init.d/mpt-statusd (has been submitted to Debian tracker already) :
--- mpt-statusd 2009-07-30 11:35:21.000000000 +0200
+++ /etc/init.d/mpt-statusd 2009-07-30 11:14:09.000000000 +0200
@@ -55,11 +55,12 @@
# Check ever $PERIOD seconds, send email on every status
# change and repeat ever $REMIND seconds if the raid is still
# bad.
- if (mpt-status -i $ID) |grep -q 'state OPTIMAL' ; then
+ if (/usr/sbin/mpt-status -i $ID) |grep -q 'state OPTIMAL' ; then
BADRAID=false
else
BADRAID=true
- logger -t mpt-statusd "detected non-optimal RAID status"
+ OUTPUT=$(/usr/sbin/mpt-status -i $ID)
+ logger -t mpt-statusd "detected non-optimal RAID status ($OUTPUT)"
fi
STATUSCHANGE=false
if [ true = "$BADRAID" ] ; then
Restart the service, and remember to create /etc/default/mtp-statusd to specify your SCSI ID if needed (mine has ID=4 setted)
[UPDATE] : Unfortunately, I have really odd results with this method. I'll post the right method when I find it ! Sorry !
Recently, I decided to give a chance to Authlogic. Authlogic is a very powerful auth framework. I must admin I miss the simplicity of Clearance, but nevermind.
Authlogic has a lot of doc, including for testing. Anyway, the testing doc is only about Test::Unit, and I mostly use cucumber + shoulda currently.
If you want to test authlogic with cucumber, just add to your step file (features/steps/authentication_steps.rb in my case) :
Before doAnd that's all !
include Authlogic::TestCase
activate_authlogic
end
Now, you can write a step like :
Given /^I am a signed in user$/ doand that's ALL. Don't require anything, config.gem is already loading everything for you.
@user = Factory(:user) # or use fixtures, mocks, whatever !
assert @user_session = UserSession.create(@user)
assert_equal controller.session["user_credentials"], @user.persistence_token
end
Can't understand why this simple wasn't on the net before :)
Happy testing !
This post is related to this lighthouse ticket.
If you want to have some clue about the current RAILS_ENV (because you need some sleep, or like me you have several terminal instances, with severals rails consoles), just add this to your ~/.irbrc file :
# Prompts
IRB.conf[:PROMPT][:CUSTOM] = {
:PROMPT_N => "[#{ENV["RAILS_ENV"].capitalize}]>> ",
:PROMPT_I => "[#{ENV["RAILS_ENV"].capitalize}]>> ",
:PROMPT_S => nil,
:PROMPT_C => "?> ",
:RETURN => "=> %s\n"
}
# Set default prompt
IRB.conf[:PROMPT_MODE] = :CUSTOM
You will end with a console like mine :
[Development]>> 1+1
=> 2
Enjoy !
Yesterday, after upgrading Shoulda to 2.10.0, I had the bad surprise of having undefined methods for my tests. Especially, should_respond_to_xml has purely disappear from the macros.
If, like me, you don't want to change your tests (because they make sense, of course), simple create a file in RAILS_ROOT/test/shoulda_macros and put this gist into it : http://gist.github.com/74287
A must-have if you're using git, and especially through command line, put this in your ~/.gitconfig :
[color]This will put some (very) useful colors in diffs, status, and branches.
diff = auto
status = auto
branch = auto
This is particulary useful when using git status, git log -p and git diff.
If you were using clearance 0.3.X and want to upgrade to 0.4.X, the generator should help a little. Nevertheless, you should use this migration instead :
class CreateOrUpdateUsersWithClearanceColumns < ActiveRecord::Migration
def self.up
change_table(:users) do |t|
t.rename :crypted_password, :encrypted_password
t.rename :confirmed, :email_confirmed
end
remove_index :users, :name => "index_users_on_email_and_crypted_password"
add_index :users, [:email, :encrypted_password], :name => "index_users_on_email_and_encrypted_password"
end
def self.down
change_table(:users) do |t|
t.rename :encrypted_password, :crypted_password
t.rename :email_confirmed, :confirmed
end
remove_index :users, :name => "index_users_on_email_and_encrypted_password"
add_index :users, [:email, :crypted_password], :name => "index_users_on_email_and_crypted_password"
end
end
Be sure to rename all your login* methods to the new sign* naming convention.