[Boston.pm] What language does God use?
http://www.xkcd.com/c224.html No surprises for this list, of course. ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Beefier User::Simple
I'm looking to develop a community web site and I'm investigating perl modules, including User::Simple. Seems like a good start, but I'm wondering if there are similar modules out there that would do things like: given a username and password, create the user in the user table for me, deactivate users, etc. ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Regex warning
On 3/12/06, Uri Guttman [EMAIL PROTECTED] wrote: JG == Joel Gwynn [EMAIL PROTECTED] writes: JG I know I've done this before, but I'm not sure what I'm doing JG differently today. I'm trying to capture a simple command-line JG option like so: JG my $debug = 0; JG if(grep(/--debug=(\d+)/, @ARGV)){ JG $debug = $1; JG print debug: $debug\n; # Error here JG } other have covered the $1 and scoping issues but i have to ask why you are doing option handling like that? i can't recall seeing grep used for a boolean detection of an option (i have seen it used to filter out selected options). in fact grep for boolean test bothers me for both efficiency and esthetic reasons. both bothers can be cure by using first() from List::Util which is in the perl core. also using any one of the many option parsers, some of which will need no more code than the above to handle all the options. so my suggestion is to change how you parse (even simple) options and use a more typical solution then a boolean grep. uri Of course you are correct. This was supposed to be a quick and dirty solution to getting a single option. But in the time/bandwidth that's been spent on this, I could've easily learned one of the above-mentioned modules. Thanks Joel ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Regex warning
I know I've done this before, but I'm not sure what I'm doing differently today. I'm trying to capture a simple command-line option like so: my $debug = 0; if(grep(/--debug=(\d+)/, @ARGV)){ $debug = $1; print debug: $debug\n; # Error here } But I keep getting Use of uninitialized value in concatenation (.) or string when I try to do something with the debug variable. How can $1 not be initialized? If it's matching, then it should have a value, no? TIA Joel ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Regex warning
Correcting myself, I don't think it is a bug. $1 is dynamically scoped. In your construct above, that means that when grep ends, $1 is cleaned up. while(grep(/--debug=(\d+)/, @ARGV)){ $debug = $1; print debug: $debug\n; last; } And I think this works because the inner part of the while loop executes while the grep is still executing. Which is a Perl optimization to avoid generating a long temporary list in this situation. Cheers, Ben Did you test this? I get the same error with this construct. ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Regex warning
On 3/11/06, Ben Tilly [EMAIL PROTECTED] wrote: On 3/11/06, Joel Gwynn [EMAIL PROTECTED] wrote: Correcting myself, I don't think it is a bug. $1 is dynamically scoped. In your construct above, that means that when grep ends, $1 is cleaned up. while(grep(/--debug=(\d+)/, @ARGV)){ $debug = $1; print debug: $debug\n; last; } And I think this works because the inner part of the while loop executes while the grep is still executing. Which is a Perl optimization to avoid generating a long temporary list in this situation. Cheers, Ben Did you test this? I get the same error with this construct. Nope. :-( I thought I had, but I was testing something slightly different. So disregard that bit of idiocy. However I did test this: for (@ARGV) { if (/--debug=(\d+)/) { $debug = $1; print debug: $1\n; } } and it works because you're looking at $1 in the right scope. Cheers, Ben No problem, dude. Thanks for the help! ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Stock Quotes
I'd like to play around with some NASDAQ numbers and I'm wondering if people have a preferred/reliable stock quote CPAN module that they like? Anyone? ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Stock Quotes
Is there a way to get historic data? I'm skimming the docs but I don't see one. On 3/2/06, Chris Devers [EMAIL PROTECTED] wrote: On Thu, 2 Mar 2006, Joel Gwynn wrote: Thanks. That's just the kind of recommendation I was looking for. Question: is this just a collection of screen-scrapers? What happens if Yahoo or Motley Fool, for example, overhaul their web site, or just adds/removes somthing that breaks it? It depends on HTML::TableExtract, so it seems to be screen-scraping. Note though that the Sourceforge home page http://finance-quote.sf.net/ suggests that it is actively maintained, with releases from as recently as January and going back as early as 2000, so presumably the module is being patched as needed to keep it working with Yahoo's site. -- Chris Devers DO NOT LEAVE IT IS NOT REAL ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Best Gmail module
I'm realizing how crucial gmail has become to my life, and it's a little scary. I need to back up at least the important emails. There seem to be quite a few CPAN modules for accessing gmail. I don't need anything fancy. Just something to retrieve emails and save them locally. Any recommendations? ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Virtual Private Hosting
Speaking of VPS, or VDS, or whatever, does anybody have any experience with these beasts? I've got a website which will probably have moderate traffic, but I need more control than I can get with a shared host, and I like mod_perl. Does anybody have any recommendations? How would I go about deciding how much horsepower I'd need? Do they say, Here, you can use 5% of this server's CPU cycles, or something? ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Virtual Private Hosting
On 10/27/05, Joel Gwynn [EMAIL PROTECTED] wrote: Speaking of VPS, or VDS, or whatever, does anybody have any experience with these beasts? I've got a website which will probably have moderate traffic, but I need more control than I can get with a shared host, and I like mod_perl. Does anybody have any recommendations? How would I go about deciding how much horsepower I'd need? Do they say, Here, you can use 5% of this server's CPU cycles, or something? Oh, and I prefer Debian-flavored boxen. ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Escaping variable regular expressions
Hopefully a simple question. Not sure if the subject line gets across what I'm trying to do. I'm trying to match one string with another, using a regex, like so: my $string = abc; my $match = ab(c; if($string =~ m/$match/){ print MATCH!\n; } This gives me an error because it's treating the paren as a regex grouping character, which (in this case) is not what I want. I want it to match paren. This leads me to consider the many other characters that would need escaping. What's the right way to do this without escaping every non-alpha character? ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Escaping variable regular expressions
Thanks! On 9/22/05, Andy Lester [EMAIL PROTECTED] wrote: On Thu, Sep 22, 2005 at 11:50:07AM -0400, Joel Gwynn ([EMAIL PROTECTED]) wrote: This leads me to consider the many other characters that would need escaping. What's the right way to do this without escaping every non-alpha character? First, you don't have to escape every non-alpha character. Just the ones that have meta-meaning. Second, you want the \Q sequence, as in /\Qlong(parenthesized)string./ -- Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] google map hacking...
The embedding how-to is here: http://stuff.rancidbacon.com/google-maps-embed-how-to/ My Geocoding perl module is here: http://joelman.com/cgi-bin/GoogleGeoCode.cgi And while we're at it, it looks like GoogleEarth is here! http://earth.google.com/ On 6/28/05, Vinny Murphy [EMAIL PROTECTED] wrote: Hi, I know we discussed this a week or two ago, but I deleted the messages ;-) Anyway, where do I get the information about using perl to generate maps using perl? -- Vinny ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Geo::Coder::US RE: GoogleGeoCoder
Thanks for the kudos. I actually started out with Geo::Coder::US, which is very good, especially for the price ;) But it wasn't quite good enough. For example, a search for 69 prince st boston, ma should return two matches, one in Boston, and one in JP, but neither GCU (or rather the TIGER data I'd guess) nor Eagle, know the difference between Boston and JP. Instead, they both return two Boston matches. This is fine for many purposes, but my clients wanted something better. This may not work for bulk geocoding, but for bulk geocoding you probably wouldn't care about such a fine grain of detail. Of course, given Google's volume of traffic, how many addresses/second would you have to be doing for them to notice ;) Of course, until Google Maps is officially released, and until the get more specific about their TOS, this is all just having fun. On 6/16/05, Ricker, William [EMAIL PROTECTED] wrote: Joel, Neat demo of Google MAPS API! And wicked elegant, pulling the hidden XML reply packet out for data. I like it. For occasional use, this is awesome. For serious bulk geocoding (anything beyond Eagle's free 50 samples, anything worth automating), using Google is both overkill and way too chatty on the network. A local Geo::Coder::US TIGER/DB would handle bulk geocoding all in-house. And I suspect the GoogleMaps API terms of service will crack down on excessive commercial use ... and unclear if Google Maps will be updating their Geocoding data with exception reports as assiduously as the commercial providers are. http://geocoder.us/ is available both online and offline, free*, using Geo::Coder::US and TIGER/Line DB. * The Geocoder.US WebService and on-line data is under a **NonCommercial-ShareAlike** license, so not considered Free Software under the Debian definition, not useable for business/commercial purposes w/o paying. (But their prices are a bargain for commercial use compared to the competition.) The http://search.cpan.org/~sderle/Geo-Coder-US/ module however has the Perl license, specified as 5.8.3 or later. And the data is USGovt Copyright, which is both Free and Libre as well. So if you download the data and PMs and build your own DB, it's apparently FLOSS usable commercially ... even under the Debian definition ... w/o need for webservice connection. Which is a win if you have enough of it to do, and don't need to pay someone to update the database with corrections. I make extensive use of geocoder.us in cleaning the data for my (very non-commercial) Perl+PHP+MySQL mapping project at http://ema.arrl.org/fd/fd_dir.php (which charts the sites you can see Ham Radio in action in Easter Mass in a little over a week, June 25-26, Field Day weekend). Cheers, Bill Ricker Not speaking for The Firm aka N1VUX ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Geo::Coder::US RE: GoogleGeoCoder
According to the Post Office, all of Boston is OK to be called Boston, differentiated by Zip Code. The parts of JP that are served by the JP postoffice can be called JP. (Allston neighborhood in Brighton was named by realtors since PO would deliver by the name of the post-office named for a war-hero general, and they wanted to upscale it compared to Brighton ...) My house can be Boston, Fields Corner, or Dorchester, according to the USPO.Even your tool won't understand Fields Corner, MA unless I give it the Zip Code. The USPO.gov address fixer can do that, though. Bill When you get right down to it, this Boston neighborhood thing is just confusing. I work in Dorchester but management likes to put Boston on the stationary, which is confusing because there's an identical address in Boston proper, just with a different zip code. Are there any other cities that have similar naming schizophrenia? ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Geo::Coder::US RE: GoogleGeoCoder
On 6/16/05, Drew Taylor [EMAIL PROTECTED] wrote: On Jun 16, 2005, at 7:51 PM, Joel Gwynn wrote: Of course, until Google Maps is officially released, and until the get more specific about their TOS, this is all just having fun. Not to nitpick, but the Maps TOS basically says, See our primary TOS - which explicitly forbids commercial usage. *sigh* ... picky, picky :) It's funny you mentioned this, because at $WORK I'm faced with the problem of geocoding a whole bunch of addresses for our database. And since most searches on the database are radius searches, lat/long is rather important. In our case, a lot of the addresses already have lat/long. But many of them are incorrect, which is worse than missing! So I have about 75k addresses that need to be redone. The few commercial services I've looked at would be quite expensive. One option we've used in the past is just doing zipcode centroid matching. You can get this information for ~$100. But obviously this is less accurate. In my case, I'm not sure if the hit in accuracy is too much. I need to do more checking. Has anyone used commercial services and been happy with the price/results? In the case of using the TIGER/Line dataset, how accurate is it? Drew I'm not working on commision for Eagle, or anything, but their prices seem pretty reasonable: 100k addresses for $1535.00 https://www.etakcentral.com/EZ_Locate/ez_subscribe.html Of course, in the handful of test cases I used, Geo::Coder::US was just as good, for free. In a couple of days you could set up your own geocoder and be all set. Note, Geo::Coder::US requires perl 5.8.x, which I did NOT have when I first installed it. The key is to realize that all data is bad, it's just a question of how much time/money you're willing to spend to make sure it's good. ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] GoogleGeoCoder
Allow me to add the latest Me Too! to the Google Maps frenzy. I cooked up a simple wrapper around GoogleMaps to provide a geocoding function. http://joelman.com/cgi-bin/GoogleGeoCode.cgi Given an address, it returns either: 1. A hashref containing the lat/long of the address or in the case of multiple matches: 2. An arrayref of hashrefs of lat/longs Comments are welcome; this is my first time releasing a module into the wild, so be nice ;) Joel ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Empty radio and checkboxes not passed to perl scr ipt
Forgive my ignorance, but why would it be a problem not to have these? On 5/26/05, Philipp Hanes [EMAIL PROTECTED] wrote: The following ideas are options I would _not_ like to follow if possible: - set a default checkbox or redio button (so something is always filled in). - use a hidden field to list of all the fields in the form. - have the perl script read the HTML code from the page and make its own list. - javascript I kinda understand why the browser doesn't send this information (no value to hold onto), but there HAS to be a solution for this. Seems frightfully stupid not to have an easy option out there for something like this. No solution other than the ones you mentioned, that I'm aware of. What we've done is generally a hidden field that gets fiddled with via JavaScript when the checkbox is changed. Then the back-end code just looks at the hidden field, and can be totally oblivious to what's really going on in the HTML. Yup, seems stupid to me, each time I run into it again, too. I'd be curious if someone has come up with something better. Doubtful, though. good luck philipp ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] Empty radio and checkboxes not passed to perl scr ipt
Sounds like a data validation issue to me. What happens when a mischevious user adds a field that you weren't expecting, but the field name conforms to your convention? Does that get written to the file as well? Generally, I have some sort of array or hash of fields that I'm expecting. If it's empty on the form, that doesn't matter because I don't trust the user anyway. The array of fields is what's used to decide what to save, not user form input. On 5/26/05, Alex Brelsfoard [EMAIL PROTECTED] wrote: Forgive my ignorance, but why would it be a problem not to have these? Picture a web form that is some sort of a survey. When that survey is submit the perl script writes out the answers onto a file. That file is tab delimited. Now picture the first person going to the form and filling everything out, including all checkboxes and radio buttons. Now the second person comes along and chooses not to fill in a radio button. When that form's information is sent to the script it is missing that radio buttons field name and therefore misses that tab, and all the results get skewed. Information becomes invalid, people get unhappy, heads are lost, cats and dogs start getting married, and all the worlds wine turns into bags of turnips. In other words, not terribly fun. --Alex On 5/26/05, Philipp Hanes [EMAIL PROTECTED] wrote: The following ideas are options I would _not_ like to follow if possible: - set a default checkbox or redio button (so something is always filled in). - use a hidden field to list of all the fields in the form. - have the perl script read the HTML code from the page and make its own list. - javascript I kinda understand why the browser doesn't send this information (no value to hold onto), but there HAS to be a solution for this. Seems frightfully stupid not to have an easy option out there for something like this. No solution other than the ones you mentioned, that I'm aware of. What we've done is generally a hidden field that gets fiddled with via JavaScript when the checkbox is changed. Then the back-end code just looks at the hidden field, and can be totally oblivious to what's really going on in the HTML. Yup, seems stupid to me, each time I run into it again, too. I'd be curious if someone has come up with something better. Doubtful, though. good luck philipp ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] email this page pitfalls
First off, thanks to all the help from my last post about CPAN failing tests, and the very informative CPAN on Debian thread that followed. It turned out that dh-make-perl went a long way toward helping me. The other interesting thing was that the module required named capture groups, a feature of 5.8.x, not 5.6.1, which is what I'm stuck with, for now. Now on to my next question. I have a client who wants an email this page link on the web site. It seems to me that there must be security/spamming risks to this that I might miss, and thought if others had done this already, they might be able to warn me of some potential gotchas, and tricks to avoid them. TIA Joel ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] HTML Renderer
I'm looking for a server-based object that will do a virtual screen capture of a web page and save the result as a jpg. Sort of like http://bettersearch.g-blog.net/ ideally, it would take a url as an argument, and return a jpg. Is there such a beast? ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Array of regex matches
Most other languages which have regex engines create an array of matches. I've been scouring the perl documentation, but can't find anything similar. The only way I know how to do it is by the perlvars $1, $2 ... etc. Anyone? ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Install problems
I've got a perl 5.6.1 installation on debian 2.4.23 that seems to fail many many tests when I try to install packages. The current packages I'm trying to install are Geo::Code::US and Bundle::CPAN. Both are failing all kinds of tests, an I'm not sure where to start troubleshooting. What's the best way to find out why it's failing so many tests, and what's the best course of action to fix this? TIA. ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Web Development Contract Templates
I may have a small project coming up and I need a good web site development contract template. The site will be about 20 static pages, a couple of user registration/preference scripts, and a fairly simple query script. Does anybody have any recommendations? I don't mind paying, but I'd like to know that I was buying the right one. ___ 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?
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Devers Sent: Wednesday, July 14, 2004 4:33 PM To: Tal Cohen Cc: 'Boston.PM' Subject: RE: [Boston.pm] Is there a module to access memory usage? On Wed, 14 Jul 2004, Tal Cohen wrote: 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? Set up SNMP on each client and write generic, cross-platform scripts that can make SNMP queries to find out such things (or better still, install a package like Mon or MRTG that does such things for you). O'Reilly's _Perl for System Administration_ gives a quick overview of such things; chapter 10 appendix E have the material you need here. The _Essential SNMP_ book gets into much more detail, and has chapters on MRTG setup use and using Perl to script SNMP work. Setting up an SNMP architecture may be more overhead than you have in mind, but once you have it in place, monitoring all kinds of things, for all kinds of devices (computers with about any operating system, as well as things like printers, network hardware, etc) gets really easy. How does one brew a cup of tea? First one must create the universe... -- Chris Devers ___ I asked him where he had it made, he said he made it himself, and when I asked him where he got his tools said he made them himself and laughing added if I had staid for other people to make my tools and things for me, I had never made anything... http://www.physics.mq.edu.au/units/phys242/pryortext/c4.html ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] [OT] Job Posting
Hey guys, we're looking for a Perl/DBI contractor for a 3-6 month projeect. Job description below. Please respond to Vincent Myles ([EMAIL PROTECTED]) Programmer to work on a variety of different web/database projects. Most projects are web to print systems, all projects are print related. This job requires the ability to self start in a loose, fast moving environment. It also requires the ability to find the best way to use/reuse existingcode. Required Technical Skills: In depth knowledge of perl and perl DBI in a Windows/SQL Server environment Experience with SQL Server Stored procedures Experience with Windows 2000 and IIS Nice to haves: ASP - vbscript- vba experience Experience with Microsoft Access Database development Any knowledge of the print industry, especially digital print. -- Vincent Myles Director of IT Spire 617-832-1952 [EMAIL PROTECTED] ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
RE: [Boston.pm] Boston.pm Job Posting Policy
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Uri Guttman Sent: Wednesday, January 07, 2004 3:13 PM To: Ronald J Kimball Cc: Boston Perl Mongers Subject: Re: [Boston.pm] Boston.pm Job Posting Policy RJK == Ronald J Kimball [EMAIL PROTECTED] writes: RJK A quick reminder on the current Job Posting Policy for the Boston.pm RJK mailing list. This is the policy that was discussed and agreed upon by RJK members of the list. RJK While we're on the subject, do people still feel that this policy is RJK relevant? Are there changes that should be made to the policy? with the perl jobs list, why would people want/need to post jobs only to boston.pm? you could just state boston as the location and onsite and probably get a larger number of applicants. i would expect any boston.pm members looking for work (or interested in keeping tabs on the market) to be subscribed to that list or peruse the web site regularly. uri I'm not arguing for or against the policy, of which I was ignorant (well, now that I've been reprimanded, I do vaguely recall others being reprimanded in the past). My rationale, though, was to target a more select bunch of folks, some of whom I've interacted with. If somebody from this list responds to the job post, one thing I can do is go through my inbox to see if/what that person has posted to the list. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] My IP
Hey all. I connect from work via ssh to my home computer, which is Comcast broadband. My IP rarely changes, but I'm worried about the one day I'm at work and need something from home, and my IP has changed. I'm thinking the best thing would be some sort of script that runs every hour, and sends me an email if the IP changes. Has anyone done anything like this? I'm sure I could whip something up in an hour, but I don't want to re-invent the wheel. Also, since I'm behind a router, what's the best way to find my IP in Perl? Thanks. Joel Gwynn Variable Data Spire 617 832-1957 ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
RE: [Boston.pm] My IP
Thanks for all the suggestions. For now I'm going the wimpy route, and trying dyndns.org, with the DNSer client service (http://www.access.si/DNSer/DNSer.htm) installed. We'll see how it goes. I have to say, that the 3-line perl solution is tempting. Maybe when I get some free time ... Joel Gwynn Variable Data Spire 617 832-1957 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Uri Guttman Sent: Tuesday, December 30, 2003 2:09 PM To: Joel Gwynn Cc: [EMAIL PROTECTED] Subject: Re: [Boston.pm] My IP JG == Joel Gwynn [EMAIL PROTECTED] writes: JG Hey all. I connect from work via ssh to my home computer, which is JG Comcast broadband. My IP rarely changes, but I'm worried about the one JG day I'm at work and need something from home, and my IP has changed. JG I'm thinking the best thing would be some sort of script that runs every JG hour, and sends me an email if the IP changes. JG Has anyone done anything like this? I'm sure I could whip something up JG in an hour, but I don't want to re-invent the wheel. JG Also, since I'm behind a router, what's the best way to find my IP in JG Perl? asd others have said, dyndns is a good choice. i have a virtual host out there so i rolled my own version of this. i just fetch (with lwp of course) the status page of my nat box and parse out my leased IP address (trivial and in this case it is the first IP on that page). i then ssh it over to my virtual host. from the outside i first login to the virtual host, copy the ip to the laptop or local box, and use that to ssh into my home net. #!/usr/local/bin/perl $link_text = `/usr/local/bin/lwp-request -CNAME:PASSWORD http://192.168.0.100/Status.htm` ; @ips = $link_text =~ /(\d+\.\d+\.\d+\.\d+)/g ; system /bin/echo $ips[2] | /usr/local/bin/ssh -q cell 'cat m1_ip' ; i think 3 lines of perl is considered simple (even if it forks out twice :). this runs under crontab every 15 minutes. i haven't had a problem with it in a long time. note that i don't need a password for the ssh as i put my public (or private, i forget) keys on the virtual host. and a critical thing is to configure your nat box to map the incoming ssh port to the box you want. this can vary depending on the brand and model. one feature (which i wish i had) is that the map can also switch the port number so you could ssh to another port and then be connected to a different box. you could run ssh on a different port on that box and just use the standard map as well. but once you login to a box, you should be able to login to any other box behind your nat. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
RE: [Boston.pm] Need help getting modules installed
In the same vein, take a look here http://cpan.org/misc/cpan-faq.html#How_install_private Also, you should look into using the CPAN module http://search.cpan.org/author/JHI/perl-5.8.0/lib/CPAN.pm You'll need to use the o conf command to set your PREFIX (or whatever) Here's a good example http://www.serverwatch.com/tutorials/article.php/10825_1127471_7 Joel Gwynn Variable Data Spire 617 832-1957 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabor Szabo Sent: Tuesday, September 16, 2003 1:53 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [Boston.pm] Need help getting modules installed If no one answers this then let me give it a try: set the PERLLIB environment variable to ~/foo before running installation. Then the subsequent operations (either manual installation or using CPAN.pm) will have ~/foo in their @INC so they will look for your installed modules in that location too. Gabor http://www.pti.co.il/ http://www.perl.org.il/ ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Simple box-packing
Hello all. I'm working on a fulfillment system that needs to figure out how to pack a box so I can get a shipping estimate from UPS. After some research, I've found that I've stumbled onto a fairly sophisticated NP-Complete math problem called the Knapsack Problem, which is way over my head. Given that any particular order is going to be fairly small, ie 10 pieces, and the variety of container is fairly small ( 3), and all I really need is an estimate, what's the best way to attack this? I found this on CPAN: Algorithm::Bucketizer - Distribute sized items to buckets with limited size http://search.cpan.org/author/MSCHILLI/Algorithm-Bucketizer-0.10/Bucketi zer.pm Using it to get a volumetric approximation, and adding a fudge factor may be good enough. Any thoughts? Joel Gwynn Variable Data Spire 617 832-1957 ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Crypt::SSLeay permissions
I'm trying to use Crypt::SSLeay via LWP::UserAgent in a CGI on Win2k IIS. Of course, it works fine from the prompt, but when in cgi mode, I get this: Could not find 501 (Not Implemented) Can't load 'C:/Perl/site/lib/auto/Crypt/SSLeay/SSLeay.dll' for module Crypt::SSLeay: load_file:Access is denied After some scrounging around, it seems that this is a permissions problem. I tried the suggestion in this note: http://aspn.activestate.com/ASPN/Mail/Message/perl-win32-web/1619674 And I also gave execute permissions to the SSLeay folder referenced above, to no avail. What am I missing? Joel Gwynn Variable Data Spire 617 832-1957 ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] BostonSweeper on the auction block
Hey Guys. Sorry for the OT post, but it is of regional interest, and the site is built in Perl :) This is sort of an informal press release to let you know that I've put bostonsweeper.com up for sale on ebay. I've enjoyed running the service, but I think it's time to give someone else a chance. Besides, I've got a kid on the way, and I could use the cash. It's a fine advertising and customer-relations opportunity. You're reaching your subscribers 2-4 times/month, you know where they live, and in some cases, where they work. So if you know anybody who would be interested in adding the service to their website (like boston.com, hint hint!) send them on over to http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItemitem=2552647024category=4 6689 Or to http://tinyurl.com/klhf if the ebay link got cut off. Joel Gwynn joelman.com BostonSweeper.com ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] Postal address De-duping
Hey, all. We do lots of (snail) mailings, and we're looking for a fast, customizable de-duping solution. We're currently taking a look at doubletake from http://peoplesmith.com/, which is not too expensive, but I was thinking there might be some perl stuff out there, given perl's text-processing powers. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] bogofilter db files
I've been using bogofilter to build up a Berkeley database of spam and non-spam phrases. I'm trying to inspect the files (goodlist.db and spamlist.db) using dbmopen, and basically nothing happens, except that two very small files are created, in this case, spamlist.dir and spamlist.pag. Code is below. What am I missing? use warnings; use strict; my %h; my $file = '/usr/home/qtikd/bogo_test/spamlist'; dbmopen(%h, $file, 0666); while (my ($key,$val) = each %h) { print $key, ' = ', unpack('L',$val), \n; } dbmclose(%h); ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
RE: [Boston.pm] Komodo vs. emacs
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ronald J Kimball Sent: Monday, June 30, 2003 5:53 PM To: Sherm Pendley Cc: Joel Gwynn; [EMAIL PROTECTED] Subject: Re: [Boston.pm] Komodo vs. emacs On Mon, Jun 30, 2003 at 05:37:53PM -0400, Sherm Pendley wrote: On Monday, June 30, 2003, at 04:46 PM, Joel Gwynn wrote: I don't want to start a war, but has anyone found a program with auto-indent performance comparable to emacs? If you're using a Mac, BBEdit is really sweet - and just a bit over half the price of Komodo. BBEdit is great, but it has very simplistic auto-indenting, nothing like what is available in emacs. (I haven't upgraded to 7 yet; is it improved in the latest version?) BBEdit does have other killer features, however, including Perl Compatible Regular Expressions for Find/Replace. Ronald ditto emacs, except you have to escape grouping symbols. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
RE: [Boston.pm] DBI question
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of darren chamberlain Sent: Wednesday, June 18, 2003 9:38 AM To: [EMAIL PROTECTED] Subject: Re: [Boston.pm] DBI question -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * Joel Gwynn joel.gwynn at digipress.net [2003-06-18 09:28]: The problem is not so much that I can't connect, the problem is that if I can't, I don't want to return the db credentials to the browser. How can I turn this off? I assume you're wrapping this in an eval, and the error message is in [EMAIL PROTECTED] $@ is just a string, so you can run it through a s/// to get rid of the credentials before displaying the error message. Maybe something like: my $err = $@; for (qw( PROVIDER SERVER UID PWD DATABASE )) { $err =~ s/($_=)(.+?)([;'])/$1 . '*' x length($2) . $3/ge; } # Now, use $err instead of $@ With your example, $err will hold something like: DBI-connect(PROVIDER=;SERVER=;UID=***;PWD=*** ;DATABASE= mydb) failed: Can't connect to 'PROVIDER=;SERVER=;UID=***;PWD=***;DATABASE=': Lasterror: -2147217843: OLE exception from Microsoft OLE DB Provider for SQL Server: (Although this still has a security hole -- it betrays the lengths of the elements you are hiding.) (darren) eval. Excellent. Now I don't have to return anything except Error connecting, if that. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
RE: [Boston.pm] Mail::POP3Client problems
After turning on debug mode (duh!) it turns out that the problem accounts need the 'AUTH_MODE' to be set explicitly. Thanks all. -Original Message- From: Bob Rogers [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 9:39 PM To: Joel Gwynn Cc: Boston-Pm Subject: [Boston.pm] Mail::POP3Client problems From: Joel Gwynn [EMAIL PROTECTED] Date: Thu, 27 Mar 2003 20:53:45 -0500 I'm developing an online email app and it logs into some accounts just fine, but it seems to be having trouble logging into some users' accounts, and not giving me very much info . . . This gives me the output: USER failed: What does this mean? Pre-authentication error messages tend to be uninformative, by design. After all, if the server distinguished between bad user and bad password, spammers could fish for valid addresses. If I were you, I'd check the POP server logs, and see if there's a way to enable verbose logging. -- Bob Rogers http://rgrjr.dyndns.org/ ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] cgi file permissions
Yet another opportunity to display my ignorance :) I've got a script which reads a config file to get a database username and password, among other things. What should the permissions be so that the cgi script running on the web server can read the file, but random users on the system can't? Is this the best way for the script to get sensitive info like that? This is on pair.com, where the script runs as user nobody and group www. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
RE: [Boston.pm] cgi file permissions
I'm more concerned about other pair users being able to access the file. Currently, the file is stored above the document root, but it has to be readable by the cgi script, hence the user nobody in group www. -Original Message- From: Wizard [mailto:[EMAIL PROTECTED] Sent: Sunday, March 02, 2003 9:19 AM To: Joel Gwynn; Boston-Pm Subject: RE: [Boston.pm] cgi file permissions I've got a script which reads a config file to get a database username and password, among other things. What should the permissions be so that the cgi script running on the web server can read the file, but random users on the system can't? Is this the best way for the script to get sensitive info like that? I'd suggest that you store the password encrypted using crypt, and then when the user enters the password, encrypt it and then compare the two. That way you don't have any cleartext passwords lying around. If this is to store some generic every-user password to log onto the database, then I'd suggest you use a true authentication mechanism like Apache authentication between the user and the config file (like htaccess). You could also store the password outside of the document_root, and have the script read it there. That way the webserver shouldn't be able to retrieve it using GET. This is on pair.com, where the script runs as user nobody and group www. ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] mimes again
Thanks to everybody who helped me out last week. I'm now successfully parsing mimes with MIME::Tools. Now, suppose I have an image attachment, and I want to output it to the browser: my $parser = new MIME::Parser; $parser-output_under($$config{mimeall}/mimemail); my $entity = $parser-parse_data( $mtext ) or return parse failed\n; # This is the part that has the image my $e = $entity-parts($section); I'm trying to use MIME::Decoder like so: my $decoder = new MIME::Decoder $e-effective_type; $decoder-decode( \*STDIN, \*STDOUT); which I got from http://www.nysaes.cornell.edu/cc/programming/perl/perldoc/MIME/Decoder.html but I'm just not sure what to do next. Should I be trying to use $e-print_body as a stream to STDIN? TIA (again) ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] DBI Practics
Hello all. I have a general dbi question. In the past, I've done something like this: my $sql = select id, sku, description from widgets; my $gw = $dbh-prepare($sql) $gw-execute; While (my $r = $gw-fetchrow_hashref){ my $sql = select sum(available) from inventory where widget_id=$$r{id}; my $ga = $dbh-prepare($sql); $ga-execute; $$r{available} = $ga-fetchrow_hashref; $ga-finish; push(@widgets, $r); # for an HTML::Template loop } $gw-finish; I was doing this using DBI ADO on a machine that had sql-server and IIS installed, and it worked just fine. But now I'm running the script on a different box than the sql-server, and I get the error: Cannot create new connection because in manual or distributed transaction mode. This seems to be a result of trying to execute a second command while the first is open. If I separate them out, it works fine. I'm just wondering, is it terrible to use the above method when I can get away with it, portability issues aside? Should I be hanging my head in shame for having lived this way so long? What are some other issues? ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm