openid RoR woes

So…you download the RoR openid plugin, install it, and…

nothing seems to work?  The reason may be that you need edge rails installed (apparently).

The error I would run into is that open_id? method was not defined, or what not (etc., etc.)

So go and get it instead from  http://www.bencurtis.com/archives/2007/05/openid-sample-application/ where there is a baked sample. Otherwise you might get stuck after gem install ruby-openid --include-dependencies
ruby script\plugin install open_id_authentication
. GL!

php mail

So…you want to send php using the mail function, you load it up and…nothing?  First check if sendmail works mailx -s “subject” recipient@recipeinthost.com (type, then Ctrl+d, then enter, to end).  If that works then you may be getting the following error:

“Recipient names must be specified”

This actually originates from sendmail.  What it meant for me is that you *must* include a “from header” for mail, at least on Oracle Linux.  Oh BTW installing php4 on oracle linux seems impossible.  You can edit the config file all you want to try and include those /usr/lib64 includes, then it ends up saying “-lxml” on the command line and then doesn’t compile. Nuts. 🙂

Using mysql in oracle Linux

Turns out that mysql IS by default installed in oracle Linux. How to set it up:

First let’s turn it on
go to /etc/rc.d/rc5.d and copy K36mysqld to S36mysqld [i.e. set it to start it up, too]. then run it sudo s36mysqld start Mysql is officially running.
Next setup root (stolen shamelessly from http://homepage.mac.com/kelleherk/iblog/C711669388/E20060917185253/index.html):
run mysql -u root
grant all on *.* to root@localhost identified by 'insert_pass_here' with grant option;
exit

(password above is your root pw)
and test the login again with the password

./mysql -u root -p

and enter your password.

opt and blank php pages

So…if you go to a php page and it’s blank…do not fear!  This may not mean php is broken.  Go to the top of that php page and put “hello” or what not to see if it actually php or apache that is broken, or if php is coughing on something you are running later (and returning nothing). GL!

RoR scaling

So most people complain about Rails not scaling (well, rather, fear it).  It seems that with 10 servers you can host about 45 million hits a day.  And hardware load balancers.  So…that’s kind of expensive, but hey 🙂

http://www.ruby-forum.com/topic/108421#247177  lists the post.  Also at http://blog.innerewut.de/articles/2006/04/21/scaling-rails-with-apache-2-2-mod_proxy_balancer-and-mongrel they list how they scale using mongrel and “only 5 machines” — ok so it scales, but with tons of machines?  How well do other protocols scale like that?  I would like to see a list of ‘scaling’ on each protocol, with the best of practice.  That would be cool.  How about a ‘scaling cook-off’?

http byte range requests

Here are some example of http byte-range requests–they request a piece of a file at a time. Very useful for downloading files piece-wise 🙂

----Header Sent----
GET /sounds/WAV/Rafiki.zip HTTP/1.1
Host: www.lionking.org
Range: bytes=60527-
User-Agent: GetRight/3.02
Accept: *.*, */*
Range-If: Fri, 25 Apr 1997 20:28:04 GMT

----Header Recv----
HTTP/1.1 206 Partial Content
Date: Sun, 23 Nov 1997 21:20:17 GMT
Server: Apache/1.3b3 mod_perl/1.06
Last-Modified: Fri, 25 Apr 1997 20:28:04 GMT
ETag: "4b46f-1a80fb-336113d4"
Content-Length: 1676428
Content-Range: bytes 60527-1736954/1736955
Content-Type: application/zip

Note that the final number of “content-range” is the file size -1 (I believe)
Note that this is also valid

Range: bytes=500-999
range=bytes=15105006-

RoR hidden fields

How to use a hidden field

<%= hidden_field 'filter', "id", :value => filter.id %>

This generates filter[id] = value yeesh!
To use it:

@filter = Filter.find(params[:filter_to_use][:id]) # retarded

How to use an “interior” field to specify another DB entry

<%= text_field 'filter_assignment', 'parameter1_setting', "size" => 10, :value => 61 %>

now in the “receiving” model of the post…

@filter = Filter.find(params[:filter_to_use][:id]) # retarded

newFilterLink = FilterAssignment.new(params[:filter_assignment])

Roger's meanderings, notes to himself, bug reports, and other things