Re: Looking for a new distro

2001-01-13 Thread Sean D. Cook

On Sat, 13 Jan 2001, dreamwvr wrote:

 Try ..
 www.linux-mandrake.com
 Jamie Krasnoo wrote:
 

Not to turn this into a distro war but mandrake is not exactly known for
its stability.  Redhat is currently in a .0 release which is not stable at
all.  Debian and Slackware are really your best bet for
stability.  Personally I recommend slackware.  If you really want to stick
with Redhat you can get a copy of 6.2 it is pretty standard.  




 -- 
Sean Cook
Systems Analyst
Edutest.com

Phone: 804.673.22531.888.335.8378
email: [EMAIL PROTECTED]
__
Save the whales.  Collect the whole set.




Re: Very WIRED error msg

2000-10-23 Thread Sean D. Cook

  Argument "OK" isn't numeric.
  Argument "OK" isn't numeric.
  Argument "OK" isn't numeric.
  Argument "OK" isn't numeric.
 

It looks like you are trying to check the return value from a mod_perl
handler.  

my $foo = handler();
if($foo == 1){
   # this won't work :)
}


sub handler {
 ...  

 return OK;
}







Re: Remembering Authentication

2000-10-17 Thread Sean D. Cook


Why not just write the app to use session and store to the db.  It is not
hard to do.  Auth to db/ldap cook up a digest with $$, username, and
remote_ip.  Store all userinfo in Storable object in the db/ldap.  

GET http://some.where.net/?sessionID=md5 digest

POST input type=hidden name=sessionID value=md5 digest

No worrying about browser type, client configuration... you should be all
set.  Stay away from cookies.  Cookies are bad when you have paying
customers!!




Re: Fast DB access

2000-10-11 Thread Sean D. Cook



On Wed, 11 Oct 2000, Differentiated Software Solutions Pvt. Ltd wrote:

 Hi,
 
 We have an application where we will have to service as high as 50 queries a second.
 We've discovered that most database just cannot keep pace.
 
 The only option we know is to service queries out of flat files.
 Can somebody give us pointers o n what modules are available to create flat file 
based database.
 Specically we want a mechanism to be able service queries which can return rows 
where values are greater than specified value.
 We are experiementing currently with dbm and DB::File. These seem to handle hashes 
quite comfortably. How do we handle these inequality queries.
 
Something you may want to consider if you are doing large numbers of
read-only transactions on the DB, build them into a large complex data
structure and load them, pre-fork, into ram.  Store them in a package
variable.  It is extremely fast and scalable.

Sean Cook
Systems Analyst
Edutest.com

Phone: 804.673.22531.888.335.8378
email: [EMAIL PROTECTED]
__
Save the whales.  Collect the whole set.





Re: Forking in mod_perl?

2000-10-05 Thread Sean D. Cook

 On Wed, Oct 04, 2000 at 02:42:50PM -0700, David E. Wheeler wrote:
  Yeah, I was thinking something along these lines. Don't know if I need
  something as complex as IPC. I was thinking of perhaps a second Apache
  server set up just to handle long-term processing. Then the first server
  could send a request to the second with the commands it needs to execute
  in a header. The second server processes those commands independantly of
  the first server, which then returns data to the browser.
 
 In a pinch, I'd just use something like a 'queue' directory. In other
 words, when your mod_perl code gets some info to process, it writes
 this into a file in a certain directory (name it with a timestamp /
 cksum to ensure the filename is unique). Every X seconds, have a

It might be safer to do this in a db rather than the file system.  That
way there is less chance for colision and you don't have to worry about
the file being half written when the daemon comes along and tries to read
the file while mod_perl/apache is trying to write it.  Let the DB do the
storage side and let the damon do a select to gather the info.




Re: redirecting large POSTs

2000-10-05 Thread Sean D. Cook



On Wed, 4 Oct 2000 [EMAIL PROTECTED] wrote:

 I have an authentication scheme which checks every request for a valid
 cookie, and if your session has timed out redirects to a login page. After
 logging in, the request is resubmitted as a GET. This works great except
 when the original post is large--the redirect URL gets way too long (10K
 or more).
 
 I was thinking about saving the posted data to a temporary file and
 reading it back in after the login succeeds, but this seems messy and
 error-prone. Has anyone else had this problem? Are there any modules
 (maybe session mgmt stuff?) that could be easily adapted to handle this?

Writing to the FS is IMHO very dangerous when you are under heavy
traffic.  You end up with lots of file locking issues and such.  Here is a
very simple solution.  Upon authentication store the session and all info
in the db.  Cook up a unique MD5 on the userID / login time and use that
as the primary key. 

use storable to freeze complex data structure and unthaw them when the
session is restored.

/* begin psuedo code */

sub new {
  # duh
}

sub createSession {
   create md5 checksum using login time
   insert into a sessions table
}

sub restoreSession {
   get session from post or get
   select session from db
   thaw the storable   
}

sub updateSession {
  duh
}

sub destroySession {
  delete session or mark for deletion
}




[SOT] mod_perl on IBM s390

2000-10-05 Thread Sean D. Cook

I know that rescently IBM has been successfull in running thousands of
instances of linux on the H30-H70 series machines.  I am wondering if
anyone is using one of these beasts to run mod_perl in a production
environment and what kind of millage you are getting.  

Thanks in advance for you input.

Sean Cook
Systems Analyst
Edutest.com

Phone: 804.673.22531.888.335.8378
email: [EMAIL PROTECTED]
__
Save the whales.  Collect the whole set.




Re: OOP and mod_perl question

2000-09-29 Thread Sean D. Cook



 Andreas Grupp wrote:
  
  Hello
  
  I am trying to develop for the first time a perl module. It should work on a
  server with mod_perl. The objects are not using mod_perl ($r) and are just
  solving some of my work in a nicer way. Since I'm new in OOP on perl (I only
  know C++) I would hear from some experts that the following is allowed in Perl
  OO modules and does not conflict with mod_perl.
  
  The question belongs to the constructor. I have $self as a class reference on
  the brandnew object. Now in the rest of my constructor I do some Querys on a
  MySQL database to get information about the authenticated user (.htaccess with
  AuthenDBI). Afterwards I store the user-data retrieved from the database in a
  hash-variable and put a reference to this hash in the $self object in the
  following way:
  
  $self-{'userdata'}-$hashref
  
  Now I can get the different parts of userdata in other instance-methods with
  code like the following ($po is an object of this class):
  
  my $po = new Peseta;
  print "pThis desk belongs to: " . $po-{'userdata'}-{'ulname'} . "/p";
 
 er ... this may be wrong but ...
 
 Here you are directly referancing the Objects data structure - which in
 OO is a little naughty (you should repsect an Objects privacy, but perl
 will not enforce it).
 
 Hence you would need a method call to return said data, in your Peseta
 package put something thus:
 
 sub get_desk_owner {
 
   my $self = shift;
   my $name = shift;
   return $self-{'userdata'}-{$name};
 
 }
 
here something we have been quite successfull using.  It allows us to
retrieve nested data from all of our object without directly poking insid
e the object.  Very similar to $r-param();

sub getAttr{
  my $self = shift;
  my $req = shift;

  # we generally tend to store data in a second level hash
  $return $self-{'attr'}-{$req} || '';

}

for setting instance data ...

sub setAttr {

  my $self = shift;

  my $i = {@_};

  foreach my $key (keys %{$i}){
$self-{'attr'}-{$key} = $i-{$key};
  }

  return;

}

hope this helps

Sean Cook
Systems Analyst
Edutest.com

Phone: 804.673.22531.888.335.8378
email: [EMAIL PROTECTED]
__
Save the whales.  Collect the whole set.