Archive for April, 2011

Had a problem with downloading a spreadsheet when some of the entries had characters with accents or other symbols. Fix:

csv << ["#{user.username}", "#{user.fullname.force_encoding("utf-8")}", "#{user.institution}", "#{user.day1}", "#{user.day2}", "#{user.lunch}", "#{user.dinner}", "#{user.created_at.to_s(:month_and_day)}"]

Just add .force_encoding("utf-8") to the field causing the problems. Might have to do this in a bunch of places, but luckily for us, it was just in one.

I have a problem with a rails app that I thought would have been fixed by switching from the mysql gem to the ruby-mysql gem. Unfortunately, after deploying this change, the entire app crashed. And due to my unfamiliarity with git, I screwed that up as well. Here is how I fixed things:

yo$  rm -rf .bundle && bundle install && git add Gemfile.lock && git commit -m "Added Gemfile.lock"
yo$ git push --all
yo$ cap deploy

After installing a new copy of alpine, use the previously saved remote_pinerc file to set everything up. To do this, open a command window and start alpine from the command line and add the remote config file to the command line. If our username is arthur and the remote_pinerc file is on server.example.com, it will look something like this:

"c:\Program Files\Alpine\alpine.exe" -p {server.example.com/ssl/novalidate-cert/user=arthur}remote_pinerc

This one was easy.

[root@cdfs tw_cli]# ./tw_cli
//cdfs> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1396.95   ON     OFF      OFF      
u1    RAID-5    OK             -      64K     1396.95   ON     OFF      ON       

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WMASY6064174     
p1     OK               u0     465.76 GB   976773168     WD-WCANU1090078     
p2     OK               u0     465.76 GB   976773168     WD-WCANU1119743     
p3     OK               u0     465.76 GB   976773168     WD-WCANU1089924     
p4     OK               u1     465.76 GB   976773168     WD-WMASY8103731     
p5     SMART-FAILURE    u1     465.76 GB   976773168     WD-WCANU1109927     
p6     OK               u1     465.76 GB   976773168     WD-WCAPW5103756     
p7     OK               u1     465.76 GB   976773168     WD-WCANU1125288     

//cdfs> maint remove c0 p5
Exporting port /c0/p5 ... Done.


//cdfs> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1396.95   ON     OFF      OFF      
u1    RAID-5    DEGRADED       -      64K     1396.95   OFF    OFF      ON       

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WMASY6064174     
p1     OK               u0     465.76 GB   976773168     WD-WCANU1090078     
p2     OK               u0     465.76 GB   976773168     WD-WCANU1119743     
p3     OK               u0     465.76 GB   976773168     WD-WCANU1089924     
p4     OK               u1     465.76 GB   976773168     WD-WMASY8103731     
p5     NOT-PRESENT      -      -           -             -
p6     OK               u1     465.76 GB   976773168     WD-WCAPW5103756     
p7     OK               u1     465.76 GB   976773168     WD-WCANU1125288     

//cdfs> rescan
Rescanning controller /c0 for units and drives ...Done.
Found the following unit(s): [none].
Found the following drive(s): [none].

//cdfs> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1396.95   ON     OFF      OFF      
u1    RAID-5    DEGRADED       -      64K     1396.95   OFF    OFF      ON       

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WMASY6064174     
p1     OK               u0     465.76 GB   976773168     WD-WCANU1090078     
p2     OK               u0     465.76 GB   976773168     WD-WCANU1119743     
p3     OK               u0     465.76 GB   976773168     WD-WCANU1089924     
p4     OK               u1     465.76 GB   976773168     WD-WMASY8103731     
p5     OK               -      465.76 GB   976773168     WD-WCAPW2252807     
p6     OK               u1     465.76 GB   976773168     WD-WCAPW5103756     
p7     OK               u1     465.76 GB   976773168     WD-WCANU1125288     

//cdfs> /c0/u1 start rebuild disk=5 ignoreecc
Sending rebuild start request to /c0/u1 on 1 disk(s) [5] ... Done.


//cdfs> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1396.95   ON     OFF      OFF      
u1    RAID-5    REBUILDING     0      64K     1396.95   OFF    OFF      ON       

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WMASY6064174     
p1     OK               u0     465.76 GB   976773168     WD-WCANU1090078     
p2     OK               u0     465.76 GB   976773168     WD-WCANU1119743     
p3     OK               u0     465.76 GB   976773168     WD-WCANU1089924     
p4     OK               u1     465.76 GB   976773168     WD-WMASY8103731     
p5     DEGRADED         u1     465.76 GB   976773168     WD-WCAPW2252807     
p6     OK               u1     465.76 GB   976773168     WD-WCAPW5103756     
p7     OK               u1     465.76 GB   976773168     WD-WCANU1125288     

//cdfs>