Re: [Boston.pm] Tech Meeting Followup
On Aug 5, 2004, at 10:01 PM, Ted Zlatanov wrote: I meant it in the sense of the Google cache, where you have an alternative in case the main one goes down, but the main link is prominent and obviously the one to follow. Have you ever noticed a google resultset entry that didn't have a cache link? I don't know if it is something that a publisher can set programatically or if it is a business arrangement. Advertising based news sites will probably be even less appreciative of mirroring and caching as more and more of them turn into registration based sites. When I write 'Barbie', am I supposed to add the little R in a circle around it? -- Samantha Langmead, age 7. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Is there a module to access memory usage?
On Jul 15, 2004, at 6:34 AM, Tal Cohen wrote: With regards to portability, it is OK if I end up writing different code for different machines (BAD Tal, BAD!!!). However I do want to keep it as light weight and internal as possible. If you can't use an external infrastructure like SNMP, then you are probably best off using the earlier suggestion to put the system specific code in separate modules and have them provide a common interface. Then you have one module that you can ask for one of these memory reporting objects and it hands back the correct, system specific one. (Perhaps determined via some sort of system configuration, perhaps with code that will probe the system and find the most appropriate one.) Which operating systems do you need to deploy on, initially? We have given a variety of solutions so far for Linux, Windows, Mac OS X, MS-DOS, and recent BSDs. For other Unix systems, I thought of one additional method. You might be able to open /dev/mem, seek to the end, and then use tell() to report its position. When I write 'Barbie', am I supposed to add the little R in a circle around it? -- Samantha Langmead, age 7. When I write 'Barbie', am I supposed to add the little R in a circle around it? -- Samantha Langmead, age 7. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Is there a module to access memory usage?
On Jul 14, 2004, at 3:56 PM, Mike Williams wrote: Tal Cohen wrote: On Wed, Jul 14, 2004 at 02:05:07PM -0400, Tal Cohen wrote: I need to write a script that will return how much memory (RAM) is a system as well as how much of it is being used. Can anyone assist? One question that I have just to clarify things. Are you wondering how much memory the machine has? Or trying to figure out how much you can use? Just because the system has it, doesn't mean that it will give it to you. On BSD-ish Unix systems, http://search.cpan.org/~jhi/BSD-Resource-1.24/ will let your perl program ask the system what might be available to it. Yeah, I thought of that. I was hoping for a platform independent mechanism. If not, then I can use this type of methodology, but how do I account for Windows based machines? You could either use `mem` or the Win32::SystemInfo module on windoze. If you can access /proc/meminfo on the linux (you didn't specify..) boxes you can read that instead of spawning a process. For asking the system how much memory it has in total, the answer is pretty system dependent, and in this sense Unix describes a family of operating systems, and not single implementation. The vmstat, which is common on Unix doesn't even give you quite what you need, because the ordering and spelling of words such as swapped and free differ between implementations. On Solaris, look at /usr/sbin/prtconf and vmstat. On Linux, try /usr/bin/free. On Mac OS X you could use either /usr/bin/vm_stat or /usr/sbin/system_profiler SPHardwareDataType|awk -F: '/Memory/{print $2}' (or /usr/sbin/system_profiler -xml SPHardwareDataType passed through this XSLT stylesheet) ?xml version=1.0 encoding=UTF-8? xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:output media-type=text/plain omit-xml-declaration=yes/ xsl:template match=/ xsl:value-of select=/plist/array/dict/array/dict/key[text() = 'physical_memory']/following-sibling::string[1] / /xsl:template /xsl:stylesheet but I mention that only to show a neat way of getting info out of an OS X plist and a comparison between XML processing tools and traditional unix tools like awk. ) On BSD systems, there is also a sysctl() system call, but I don't see a perl module that interfaces to it. On windows, this sort of information will be in the registry under the HKEY_PERFORMANCE_DATA key. Chris Devers' recommendation elsewhere on using SNMP is something to consider, since it would essentially be taking the platform dependent behavior that someone has already written and accessing it with a common API. -- When I write 'Barbie', am I supposed to add the little R in a circle around it? -- Samantha Langmead, age 7. When I write 'Barbie', am I supposed to add the little R in a circle around it? -- Samantha Langmead, age 7. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Completing processing before SIGHUP
On Jun 2, 2004, at 12:34 AM, Ranga Nathan wrote: I just read the signals section of Programming Perl 2nd edition (my precious book with Larry Walls autograph, camel stamp and TMTOWTDI stamp) which cautions against doing anything worthwhile after handling a signal, Some of the issues are handled in 5.8's signal handling changes. The book also states that you can not IGNORE or trap a A KILL or STOP signal. Is it still the case with Perl 5.8 and Linux kernel 2.4x? Again, my recommendation would be to pick up the Stevens book. Learn about how signals work, and that start figuring out how they work with perl. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] where's the module
On Wed, Apr 28, 2004 at 05:36:51PM -0400, Greg London wrote: is there a quick and dirty way to find out where the heck perl is finding a module being use'ed is located? You mentioned looking in @INC, but I think what you really want is the %INC hash. If you say: use MyModule; There will be a key value pair in %INC that looks like: 'MyModule.pm' = '/Library/Perl/MyModule.pm', If you say: use My::Module; it will say: 'My/Module.pm' = '/Library/Perl/My/Module.pm', -- Maybe the Easter Bunny is just Santa Claus in an rabbit costume. A rabbit can't go to everyone's house in one night. -- Samantha Langmead, age 6. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] OT - cannot SSH into Redhat box
On Apr 20, 2004, at 9:32 PM, Ranga Nathan wrote: I installed Redhat server (Enterprise) on a box but I can not SSH into the box. I'd start with setting LogLevel DEBUG in /etc/sshd_config, restarting sshd, and then running the ssh client on the other machine with the -v flags. the ssh commands logging can be rather verbose, but when you see negative sounding phrases like method disabled or Failed, things are going wrong and there are positive phrases like succeeded or accepted then things are going right. Maybe the Easter Bunny is just Santa Claus in an rabbit costume. A rabbit can't go to everyone's house in one night. -- Samantha Langmead, age 6. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Brain Jog for LWP basic authentication? Please?
On Mar 12, 2004, at 10:55 AM, Law, Mark wrote: Did you ever get a good response to your question? I'm wrestling with the same issue - how to authenticate to an HTTPS server and then pick up some files. The following will request a file from an HTTP authentication protected server. (Tested against Basic Authentication of a zope server. Mostly because I had one handy and they love to throw up HTTP auth boxes) I don't have a machine handy set up for SSL, but as LWP should automatically use Crypt::SSLeay if it is installed. #!/usr/bin/perl -w use LWP::UserAgent; use HTTP::Request; my($url, $realm, $user, $pass) = @ARGV[0 .. 3 ]; my $ua = LWP::UserAgent-new(); my $request = HTTP::Request-new( GET = $url); $ua-credentials($request-uri()-host_port(), $realm, $user, $pass); $response = $ua-request($request); if($response-is_success()) { print $response-content(); } exit 0; ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] CVS output
On Mon, Feb 02, 2004 at 12:03:47PM -0500, [EMAIL PROTECTED] wrote: and I don't want cvs stuff barfing on the screen. The cvs command makes generous use of standard error. Adding the -q global option flag to CVS will quiet most of the output standard eror. Otherwise, if you need to get and keep that information somehow, you can either use the 2 shell redirection syntax or the IPC::Open3 module to fetch it as a separate stream. -- the Magic Eight Ball said 'You can rely on it'. Does rely mean 'Yes',or 'No'? -- Samantha Langmead, age 6. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] CGI problems
On Wed, Jan 21, 2004 at 03:14:26PM -0800, Ranga Nathan wrote: I like to trace all the statements in a function but output on the web. There is one recipe in the perldebug man page that might be helpful to you. If your rc file contains: parse_options(NonStop=1 LineInfo=db.out AutoTrace); then your script will run without human intervention, putting trace information into the file db.out. Just remember that in the instructions for the .perldb file in the context of a web server, home directory means the home directory of the uid that web server runs as and current directory means the current directory of the web server. -- Jumping is a lot like flying, except the sudden fall at the end. -- Samantha Langmead, age 6. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] CGI problems
On Wed, Jan 21, 2004 at 04:24:45PM -0800, Ranga Nathan wrote: Thanks for that. I created a .perldb for 'nobody' in home directory and added the '-d' on the shebang line. The script hung but I could not 'locate' a db.out anyhwere. Perhaps it closes only if the script finishes! (Why does nobody have a home directory? That's odd, and maybe a little scary.) As a quick glance at perl5db.pl, it seems that the LineInfo directive will just make a quick effort to open the file. On failure it will just merrily go its way. The recipe as written will write the db.out file into the current directory, which nobody may not (and probably should not) have write access to. The LineInfo filehandle is set command buffer its output, so it should be able to be used even on a CGI script that just hangs and never completes. Changing the LineInfo directive to a full path to a directory nobody can write to (like /tmp/db.out) might be all that you need. Otherwise, maybe a more complex wrapper script, like the one below, around your CGI might work. #!/usr/local/perl/5.8.1/bin/perl -w chdir('/tmp'); $ENV{PERLDB_OPTS}='NonStop=1 LineInfo=db.out AutoTrace'; system('/usr/local/perl/5.8.1/bin/perl', '-dw', '/home/langmead/public_html/arthur.cgi'); -- Jumping is a lot like flying, except the sudden fall at the end. -- Samantha Langmead, age 6. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Damien's book OOP - OOP?
On Thu, Oct 09, 2003 at 10:55:45AM -0400, Dan Sugalski wrote: I'm pretty sure there's no second edition in the works -- more likely it's just a 4 year old book that distributors are deciding not to stock any more. Even when it is the best book on the subject and all the information in the book is relavent to the current version of the language? I'll never understand the book publishing business. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] mimes!
On Wed, Jan 15, 2003 at 07:50:45PM -0500, Joel Gwynn wrote: I'm working on an email app using use Mail::POP3Client to get emails off a pop server and store the messages in a database. So I get my message body like this: There are headers that you are dropping when you say $pop-Body() that you need in order to correctly decode the body. Can you pull them out and store them in the database as well? I think at the minimum you need MIME-Version, Content-Type, and Content-Transfer-Encoding. For a slightly more robust solution, you might want to look at the MIME encoding/decoding utilities in MIME::Tools. http://search.cpan.org/author/ERYQ/MIME-tools-5.411a/lib/MIME/Tools.pm ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Content management system
On Sat, Sep 21, 2002 at 12:32:51AM -0400, Sherm Pendley wrote: Just to pick nits - only the local Boston-area WGBH site at www.wgbh.org is managed by ArsDigita. The content that's created by WGBH's Interactive department for PBS, and posted to pbs.org and pbskids.org is managed by a diverse collection of ad hoc systems, using an assortment of tools including MySQL, FileMaker Pro, Word, Excel, and (of course!) both Perl and MacPerl. Thanks, for the clarification. The point I was trying to make, and it is somewhat embarrassing that I got through the list and forgot to make it, is that the difference corporations all had different needs and they decided on systems that have nearly no common features, (Except for some peripheral items like templates) and no common general concepts (except a 10,000 ft view of data comes in, data sits, data goes out) When Boston.com was researching content management vendors, there were a few of them that considered the ability to injest MS-Word and Excel documents, and the ability to connect to ODBC resources important feature of a CMS, saying you can't really manage content if you need to convert it before importing it into the system (which then leads to two copies, the one on the authors disk, which they go back to for edits, and the one in the system, which is used by everyone but the author.) For others, all data input is through HTML forms. Now that I've been playing around with zope a bit, I find the WebDAV and external editor support a neat compromise between the two. But this is just showing that once you dip below they 10,000 feet, even the data in step of the three step process above is remarkably different. It was probably the Boston.com requirements process that gave me the tendency to respond to any content management question with what does the term content management mean to you, and what do you want it to do for you? -- I know a grown up word, its Magnetitious. It means when a magnet can stick on something.. -- Samantha Langmead, age 5. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Content management system
On Fri, Sep 20, 2002 at 04:29:23PM -0400, Ranga Nathan wrote: I am looking for a content management system. There are many of them on freshmeat. Wonder if people had experience with them and what the experiences have been. The term Content Management System is vague enough to be nearly meaningless. Some people take it to mean a document workflow system, to make sure documents correctly go through the writing, editing, layout, approval process. Some people take it to mean a collaborative publishing environment. Some people take content management as database backed content delivery system. I'd suggest that try to be a little more descriptive on what sort of problem you want to solve, and then look at package which have features that solve that problem. Once you find it, it will probably call itself a content management system, but that doesn't mean that some other content management system would fufill the same needs. O'Reilly based their O'Reilly Network on a product called Community Server Application Software. Slashdot runs off of slashcode. Activestate uses Zope as a backend production for part of their site. (Which is interesting, since Zope wants to be involved through the web delivery end.) CMSWatch runs on Midgard. WGBH runs ArsDigita Collaberation System, which is now owned by Red Hat. What content do you have to work with, and what do you want to do with it? -- Dreams feel like a cloud inside a bubble inside my head. -- Samantha Langmead, age 5. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm