Re: OT: WebDav won't allow put...
Write this down folks... I changed DAVLockDB "/Library/WebServer/DAVlock" to DAVLockDB "/Library/WebServer/DAVlock/" And I can now execute the 'put' command Jerry PS: Sorry for spamming the list but I was getting desperate. On Apr 14, 2006, at 10:08 AM, Christian Huldt wrote: 14 apr 2006 kl. 14.16 skrev Jerry LeVan: Hi, I decided I want to muck around with webdav on my Mac 10.4.6 client Apache 1.3x stock install. I enabled the loading of the mod_dav module in the httpd.conf and added: DAVLockDB "/Library/WebServer/DAVlock" DAV On AuthType basic AuthName "WEBDAV" AuthUserFile /etc/httpd/passwd Require valid-user The lock file has rw perms for www/www I can authenticate and access the webdav page and from my linux box do ls and gets but the PUT operation always fails. If I do a connect to server locally with the finder "Connect to server..." any attempt to drag a file to the webdav window fails with a bizarre message about file name possibly too long or invalid characters. Any PUT operation leaves the following in error_log [Thu Apr 13 23:34:46 2006] [notice] Apache/1.3.33 (Darwin) DAV/ 1.0.3 configured -- resuming normal operations [Thu Apr 13 23:34:46 2006] [notice] Accept mutex: flock (Default: flock) [Thu Apr 13 23:37:20 2006] [error] [client 192.168.1.70] The locks could not be queried for verification against a possible "If:" header. [500, #0] [Thu Apr 13 23:37:20 2006] [error] [client 192.168.1.70] Could not open the lock database. [500, #400] [Thu Apr 13 23:37:20 2006] [error] [client 192.168.1.70] (13) Permission denied: I/O error occurred. [500, #1] Judging from the lack of info "out there" I am either the first person to try this or the most unlucky... Has anyone been successful in getting the webdav stuff to work with the stock apache? The error messages are usually correct, I got this on a SuSe box a couple of days ago after some update changed DAVLockDB path... The lock file is actually two files file.pag and file.dir so I would suggest you try DAVLockDB "/Library/WebServer/Locks/DAVlock" and chown www:www /Library/WebServer/Locks to allow apache to create files as needed
OT: WebDav won't allow put...
Hi, I decided I want to muck around with webdav on my Mac 10.4.6 client Apache 1.3x stock install. I enabled the loading of the mod_dav module in the httpd.conf and added: DAVLockDB "/Library/WebServer/DAVlock" DAV On AuthType basic AuthName "WEBDAV" AuthUserFile /etc/httpd/passwd Require valid-user The lock file has rw perms for www/www I can authenticate and access the webdav page and from my linux box do ls and gets but the PUT operation always fails. If I do a connect to server locally with the finder "Connect to server..." any attempt to drag a file to the webdav window fails with a bizarre message about file name possibly too long or invalid characters. Any PUT operation leaves the following in error_log [Thu Apr 13 23:34:46 2006] [notice] Apache/1.3.33 (Darwin) DAV/1.0.3 configured -- resuming normal operations [Thu Apr 13 23:34:46 2006] [notice] Accept mutex: flock (Default: flock) [Thu Apr 13 23:37:20 2006] [error] [client 192.168.1.70] The locks could not be queried for verification against a possible "If:" header. [500, #0] [Thu Apr 13 23:37:20 2006] [error] [client 192.168.1.70] Could not open the lock database. [500, #400] [Thu Apr 13 23:37:20 2006] [error] [client 192.168.1.70] (13) Permission denied: I/O error occurred. [500, #1] Judging from the lack of info "out there" I am either the first person to try this or the most unlucky... Has anyone been successful in getting the webdav stuff to work with the stock apache? Jerry
Re: Authentication woes...
For what it is worth the answer to the question below is located here: On 28/08/05, Jerry LeVan <[EMAIL PROTECTED]> wrote: I think that I somehow need to use the Directory Services to answer the question (programatically) : Is "foo" the password of user "faz"? <http://developer.apple.com/samplecode/CryptNoMore/CryptNoMore.html> -- x The program is about 600 lines of C code Jerry On Aug 28, 2005, at 9:44 AM, Jerry LeVan wrote: Hmmm, After burying myself in Apples Documentation it appears that the question: Is "foo" the password for user "baz"? Can only be answered by digging into the Directory Services framework. It does not appear to be a task for the faint hearted... The NetInfo utility shows me that my authentication authority is : ;ShadowHash;HASHLIST: I think mucking around with the SMB login stuff caused the "traditional" unix style authentication to break. It does not look like fixing qpopper is in the near future ;( Jerry On Aug 27, 2005, at 8:42 PM, Jerry LeVan wrote: Hi, I just added a PC to my home network and was playing with trying to access directories on my Mac OS X system and suddenly my pop server quit working (qpopper). It had been working fine for at least a year! Not a single user could connect to the server via telnet ( I can connect ok but sending the password *always* fails). I hopped into perl as root and tried: macjerry:~ root# perl -de0 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> print getpwnam "jerry" jerry501200Jerry LeVan/Users/jerry/bin/bash0 note the *'s where the password should be...I suspect this is why qpopper is failing. I think mucking around with enabling Mac OSX to allow Windows Networking connections has mucked up how passwords are handled. I can still log on ok and the only thing that I have found so far that is broken is the pop3 server I am running. How can I programatically determine if user "x" has password "z"? A cursory exam of the qpopper code "seems" to indicate that the getpw family of functions seem to be used. I have spent the better part of the day trying to run down how to do user authentication on Mac OS X (10.4.2) but I have not made any headway Thanks for any pointers. Jerry
Re: Authentication woes...
Hmmm, After burying myself in Apples Documentation it appears that the question: Is "foo" the password for user "baz"? Can only be answered by digging into the Directory Services framework. It does not appear to be a task for the faint hearted... The NetInfo utility shows me that my authentication authority is : ;ShadowHash;HASHLIST: I think mucking around with the SMB login stuff caused the "traditional" unix style authentication to break. It does not look like fixing qpopper is in the near future ;( Jerry On Aug 27, 2005, at 8:42 PM, Jerry LeVan wrote: Hi, I just added a PC to my home network and was playing with trying to access directories on my Mac OS X system and suddenly my pop server quit working (qpopper). It had been working fine for at least a year! Not a single user could connect to the server via telnet ( I can connect ok but sending the password *always* fails). I hopped into perl as root and tried: macjerry:~ root# perl -de0 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> print getpwnam "jerry" jerry501200Jerry LeVan/Users/jerry/bin/bash0 note the *'s where the password should be...I suspect this is why qpopper is failing. I think mucking around with enabling Mac OSX to allow Windows Networking connections has mucked up how passwords are handled. I can still log on ok and the only thing that I have found so far that is broken is the pop3 server I am running. How can I programatically determine if user "x" has password "z"? A cursory exam of the qpopper code "seems" to indicate that the getpw family of functions seem to be used. I have spent the better part of the day trying to run down how to do user authentication on Mac OS X (10.4.2) but I have not made any headway Thanks for any pointers. Jerry
Authentication woes...
Hi, I just added a PC to my home network and was playing with trying to access directories on my Mac OS X system and suddenly my pop server quit working (qpopper). It had been working fine for at least a year! Not a single user could connect to the server via telnet ( I can connect ok but sending the password *always* fails). I hopped into perl as root and tried: macjerry:~ root# perl -de0 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> print getpwnam "jerry" jerry501200Jerry LeVan/Users/jerry/bin/bash0 note the *'s where the password should be...I suspect this is why qpopper is failing. I think mucking around with enabling Mac OSX to allow Windows Networking connections has mucked up how passwords are handled. I can still log on ok and the only thing that I have found so far that is broken is the pop3 server I am running. How can I programatically determine if user "x" has password "z"? A cursory exam of the qpopper code "seems" to indicate that the getpw family of functions seem to be used. I have spent the better part of the day trying to run down how to do user authentication on Mac OS X (10.4.2) but I have not made any headway Thanks for any pointers. Jerry
Re: Using my Perl installation after installing Tiger
If you did an Archive and Install then the previous /usr/local hierarchy is in the /Previous folder and you can just "mv" the folder back to the proper location. Jerry On May 18, 2005, at 2:58 PM, John Delacour wrote: At 14:51 -0400 18/5/05, Sherm Pendley wrote: If you installed it under the default location /usr/local, then your old Perl 5.8.6 will still be there - if you made /usr/bin/ perl a symlink to /usr/local/bin/perl, then the symlink would have been wiped out, but that's easy to fix. Thanks for the lightning-fast reply, Sherm! I'm glad to say I did install in /usr/local, so I look forward to hearing how to carry out the easy fix. JD
Re: GD installation issue
Hmm, I guess the source I used must have been a bit dated. I copied the files config.guess and config.sub but I still had to copy /usr/bin/glibtool over the generated libtool in order to get a link. Jerry On Jan 4, 2005, at 12:27 PM, Sherm Pendley wrote: On Jan 4, 2005, at 7:37 AM, Jan Eden wrote: The idea is to produce libtool by configuring gd first, then copy the new libtool to my jpeg-6b directory It's easier than that. Just update config.guess and config.sub by copying them from /usr/share/libtool/. Like I said though - make sure you have the latest source. You shouldn't need to update it at all. sherm-- Cocoa programming in Perl: http://camelbones.sourceforge.net Hire me! My resume: http://www.dot-app.org
Re: Forking & Signals
See http://homepage.mac.com/levanj/LinkSys and grab linksys.pl. It has a trap handler prints a message to a log file closes the log file and then exits. (it does some other interesting stuff if you have a linksys router :) Jerry On Aug 19, 2004, at 3:49 PM, wren argetlahm wrote: I have a perl script (modified from one of Chris Nandor's) that I run as a background-process/daemon via fork(). Now I know I can use kill to end it, but I was wondering if there was a way that I can catch the SIGTERM to do one last thing before quitting? It looks like it should already do this, the relevant code goes like: $SIG{CHLD} = 'IGNORE'; my $pid; if (1) { $pid = fork; if ($pid) { print "Running background process ($pid)\n"; exit; } } END { &output() unless $pid; } ... which I interperate as when the parent quits (exit) nothing happens, but when the child quits (kill) it should run &output(). This doesn't happen though. Is there another way? ~wren (Perl 5.8.3, OSX 10.2.8) __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail
Re: pSync/Panther how?
I am running Deju Vu which runs psync under the hood, works fine for me... Jerry On Aug 3, 2004, at 4:06 PM, Ingo Weiss wrote: Hi all, I would like to use pSync for backups. I used it in Jaguar, but it seems that it's not compatible with Panther currenlty. The Author recommended to install a newer Perl which should fix the problem. Here are some questions: - What is the latest stable Perl version that runs under Panther? - Are there a really foolproof instructions anywhere for how to build and install Perl from source? - This all seems a bit much for running one small program - is there another way to make pSync run? - Or, is there a good alternative to pSync? Thanks! Ingo
Re: Interface advice needed
Well, there is the Perl/Tk toolkit that can provide a gui. The only drawback is that it requires the (free) X11 server to be running. Another slicker choice would be Aqua Tcl/Tk. It comes with a "native" gui interface. but it requires downloading the (free) Aqua Tcl/Tk system. Cocoa has a nontrivial learning curve... Jerry On Jun 15, 2004, at 9:30 PM, Alan Olsen wrote: I have a program that I am writing on Mac OS X. It might need to run on OS 9, but I can probably avoid that. I will state up front that i prefer Linux, mainly because I know it better. (And I find the way the Mac does things to be totally alien to what i am used to.) I need a very simple set of interface elements. I need a file selection dialog. I need a dialog that supports multiple (more than three) buttons. A selection list dialog that returns an index. That is pretty much it. The rest of the code is pretty much done. all I need is the GUI code. Suggestions? All the examples I am finding are not giving primitives, they are giving "talk to this app over there and tell it do do something". Maybe i need to break down and learn Cocoa and Objective-C.
Re: Perl droplet how?
Try "Drop Script" or "Platypus". Jerry On Jun 6, 2004, at 3:06 PM, Ingo Weiss wrote: Hi all, how can i make a Perl droplet (A Perl script that processes files or folders dropped onto it) fast and easily? Thanks for any help! Ingo
Re: (sips?) Re: Converting PDF to JPEG
There evidently is not a man page. sips -h appears to be the extend of the documentation. I found that sips -g all prints some interesting info. Jerry On May 18, 2004, at 1:46 PM, Vic Norton wrote: This sips application sounds interesting. Where do you get it? I'm running OS X 10.3.3, but "man sips" produces nothing. I looked at http://www.apple.com/applescript/imageevents/ but I couldn't find anything to download. A search for "sips" at Apple Developer Connection returned nothing. Regards, Vic
Re: Converting PDF to JPEG
I have been browsing some Python code from the Image package. It appears that they offer a variety of scaling algorithms. Seems like I remember that one of the examples produced thumbnails and you could control sharpness, brightness, contrast and color However I don't think Python does PDF so I guess you could go big pdf-->big jpg via sips then big jpg -->thumbnail via python Seems like it might be a hassle ;( Is this a one-off thingee or is it part of an application? I have a simple Tcl/Tk image browser at http://homepage.mac.com/levanj/TclTk that thumbnails whole directories using select one out of n scaling, it produces semi passable results. I have not had the chance to look at ImageMagic seems like there ought to be a nice perl module(s) that can do a good job... Jerry On May 17, 2004, at 10:03 PM, Rich Morin wrote: Although sips is working well for me, the JPEG format doesn't seem to be optimized well for line drawings. Any opinions as to which of the supported formats might work better? -r -- email: [EMAIL PROTECTED]; phone: +1 650-873-7841 http://www.cfcl.com- Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
Re: Converting PDF to JPEG
Hmmm, what am I doing wrong... [macjerry:~/Desktop]$ sips -s format pdf FixedColor.jpg --out FixedColor.pdf /Users/jerry/Desktop/FixedColor.jpg Error: Not a valid format value /Users/jerry/Desktop/FixedColor.pdf [macjerry:~/Desktop]$ sips -s format "pdf" FixedColor.jpg --out FixedColor.pdf /Users/jerry/Desktop/FixedColor.jpg Error: Not a valid format value /Users/jerry/Desktop/FixedColor.pdf On May 17, 2004, at 10:34 AM, Daniel Staal wrote: --As of Saturday, May 15, 2004 8:35 AM -0700, Rich Morin is alleged to have said: I suspect that there are Cocoa frameworks that would let me import PDF and export JPEG, but I'd rather not go that way if I can help it. Question: What's the simplest way to solve this (ie, mechanically convert PDF files to JPEG (or GIF or ...) format? --As for the rest, it is mine. If you are using Panther, you can use Apple's 'sips' commandline program to do this. It is seriously under-documented, but it works well. (Though it doesn't handle transparencies. Not a problem if you are converting to JPEG, which doesn't support them.) I've successfully used this line in a Perl script to convert images: `sips -s format $ext $imagefile --out $imagedir 2>&1` where $ext is the extension of the file type you want to convert to, $imagefile is the name of the file to be converted, and $imagedir is the directory or output image name. The only documentation available is from the commandline: type 'sips -h' for usage help and 'sips -H' for lists of properties that are supported. Daniel T. Staal (Note: if anyone wants to help *me* use the Cocoa frameworks to do this, I would be grateful. I need to be able to convert tiff/jpeg/gif/pdf/pict/png to a common file format (png or gif), preserving transparency and color balance. So far I've not had luck on Mac. I think I could convert pure Cocoa code to Perl...) --- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---
Re: Converting PDF to JPEG
This seems to work for me tell application "GraphicConverter" activate open alias "Macintosh HD:Users:jerry:Pictures:tiger.pdf" repeat until exists first window end repeat save first window in "Macintosh HD:Users:jerry:Desktop:tigger.jpg" as JPEG quit end tell I had to put the delay in or the script errored with a "can't find window 1" message Jerry On May 15, 2004, at 2:51 PM, Rich Morin wrote: At 2:25 PM -0400 5/15/04, Jerry LeVan wrote: Seems like Graphic Converter might fill the bill... Nope; it doesn't import PDFs. -r -- email: [EMAIL PROTECTED]; phone: +1 650-873-7841 http://www.cfcl.com- Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
Re: Converting PDF to JPEG
Mine does :) If I drag a pdf document to the icon it opens... So does the following: tell application "GraphicConverter" open alias "Macintosh HD:Users:jerry:Pictures:tiger.pdf" end tell What version are you using ( mine is 5.1) Jerry On May 15, 2004, at 2:51 PM, Rich Morin wrote: At 2:25 PM -0400 5/15/04, Jerry LeVan wrote: Seems like Graphic Converter might fill the bill... Nope; it doesn't import PDFs. -r -- email: [EMAIL PROTECTED]; phone: +1 650-873-7841 http://www.cfcl.com- Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
Re: Converting PDF to JPEG
Seems like Graphic Converter might fill the bill... Jerry On May 15, 2004, at 11:35 AM, Rich Morin wrote: Background: I'm using grap(1) and pic(1) to generate some graphs and diagrams. Using groff(1) and ps2pdf(1), I'm getting nice-looking results on paper and in PDF viewers such as Preview. Unfortunately, I don't have an automated way to produce nice-looking results on the web. I have played with some Open Source tool chains, including: grap -> groff -> gs -> pnmcrop -> ppmtogif grap -> pic2plot but they produce smearing and crummy-looking text. gs(1) is the culprit in the first case; I suspect that pic2plot is using the same rendering code as gs does. Both Preview and Acrobat Pro do nice jobs of converting these graphs to JPEG format. So, I thought of using AppleScript to make them do the conversions in batch mode. Unfortunately, neither app seems to have a published Dictionary for AppleScript (and the workarounds for getting past this seem uniformly difficult). I suspect that there are Cocoa frameworks that would let me import PDF and export JPEG, but I'd rather not go that way if I can help it. Question: What's the simplest way to solve this (ie, mechanically convert PDF files to JPEG (or GIF or ...) format? -r -- email: [EMAIL PROTECTED]; phone: +1 650-873-7841 http://www.cfcl.com- Canta Forda Computer Laboratory http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc. http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
Re: backing up using DejaVu
Heh, Heh, I was hoping someone would answer that question, my totally uninformed guess is that something bad *could* happen...but I don't know... Let us know :) Jerry On May 3, 2004, at 5:18 PM, Joseph Alotta wrote: Hi Jerry, I used "sudo psync -d / /Volumes/backup" and it worked real nice. I kind of like watching it work while I do other things. If my powerbook were to sleep in the middle of it, would it break something or would it just pick up where it left off? Joe. On May 3, 2004, at 6:54 AM, Jerry LeVan wrote: I can't think of any reason why not :), If you examine the source to psync you will find the documentation embedded near the end. If you installed DejaVu, look in /usr/local/bin for psync. I think the help even gives a command for copying an entire volume. Let us know how it turns out... Jerry On May 2, 2004, at 9:50 PM, Joseph Alotta wrote: Jerry, On May 1, 2004, at 2:58 PM, Jerry LeVan wrote: You might try one more time, the first time takes the longest, subsequent invocations just looks at differences... I can't think of any reason why the program is chewing cpu after the task is finished. It works by calling psync ( a perl program to do the copying and adjusting permissions). If DejaVu calls psync to do the work, then why do I need DejaVu. Why can't I just put the psync command in cron? I believe that while it is running it might put a menu in the menu bar (on the right hand side), you might try looking there... It puts a horseshoe shaped logo up by the battery level indicator. But all it says is "backup in progess" no indication of how much it has done or what remains. Joe. I seems like I recall a program "RsyncX" that is put out by a consortium of educational users, you might take a look at that. Jerry On May 1, 2004, at 1:38 PM, Joseph Alotta wrote: Greetings, Taking Jerry's recommendation, I downloaded DejaVu and ran it last night. It started about 10pm and at 12:30pm it was still running and I went to bed, (my energy savings preferences were set to dvd playback). I couldn't see any progress bar, although it said it had one. When I awoke this morning it was finished. However, now it is still using 94% of my cpu time and I don't know what it could be doing, preference panel says it is disabled. Also, I was looking at the files it wrote, and though they are all there, the file sizes are different. This is the original: [Abba:~/Desktop] josephal% ls -la total 256 drwx--12 josephal staff 408 30 Apr 22:10 . drwxr-xr-x37 josephal staff1258 29 Apr 10:42 .. -rwx-- 1 josephal staff 21508 30 Apr 22:10 .DS_Store -rw-r--r-- 1 josephal staff 0 2 Oct 2002 .localized drwxr-xr-x 7 josephal staff 238 30 Apr 22:10 DejaVu drwxr-xr-x 334 josephal staff 11356 30 Apr 22:10 bankers box drwxr-xr-x 130 josephal staff4420 29 Apr 11:44 charts drwxrwxrwx 142 josephal staff4828 1 Mar 15:09 contact letters -rw-r--r-- 1 josephal staff 102557 27 Apr 15:25 google.pdf drwxr-xr-x 4080 josephal staff 138720 29 Apr 10:44 historical_data drwxr-xr-x 123 josephal staff4182 29 Apr 10:46 reports drwxr-xr-x30 josephal staff1020 12 Mar 17:30 trifold brochure [Abba:~/Desktop] josephal% This is the copy: [Abba:Users/josephalotta/Desktop] josephal% ls -la total 208 drwx--11 josephal unknown 374 30 Apr 22:10 . drwxr-xr-x36 josephal unknown1224 29 Apr 10:42 .. -rw-r--r-- 1 josephal unknown 0 2 Oct 2002 .localized drwxr-xr-x 6 josephal unknown 204 30 Apr 22:10 DejaVu drwxr-xr-x 333 josephal unknown 11322 30 Apr 22:10 bankers box drwxr-xr-x 129 josephal unknown4386 29 Apr 11:44 charts drwxrwxrwx 141 josephal unknown4794 1 Mar 15:09 contact letters -rw-r--r-- 1 josephal unknown 102557 27 Apr 15:25 google.pdf drwxr-xr-x 4079 josephal unknown 138686 29 Apr 10:44 historical_data drwxr-xr-x 122 josephal unknown4148 29 Apr 10:46 reports drwxr-xr-x29 josephal unknown 986 12 Mar 17:30 trifold brochure [Abba:Users/josephalotta/Desktop] josephal% So, I guess I need to reboot to get my CPU time back. What do you think? Is DejaVu a tested product or is it alpha/beta? Seems it has four strikes against it: 1. Slow, 2. No progress Bar, 3. File sizes, 4. high CPU usage while doing nothing. Also, I do not like the fact it is a preference panel as I can't kill it, in times like this. Joe.
Re: backing up using DejaVu
Hmmm, maybe it will work... I started the following shell script #!/bin/sh i=1 while true do echo $i i=`expr $i + 1 ` done I forced the system to sleep for a few seconds, woke it up and the script kept on trucking... Jerry On May 3, 2004, at 5:18 PM, Joseph Alotta wrote: Hi Jerry, I used "sudo psync -d / /Volumes/backup" and it worked real nice. I kind of like watching it work while I do other things. If my powerbook were to sleep in the middle of it, would it break something or would it just pick up where it left off? Joe. On May 3, 2004, at 6:54 AM, Jerry LeVan wrote: I can't think of any reason why not :), If you examine the source to psync you will find the documentation embedded near the end. If you installed DejaVu, look in /usr/local/bin for psync. I think the help even gives a command for copying an entire volume. Let us know how it turns out... Jerry On May 2, 2004, at 9:50 PM, Joseph Alotta wrote: Jerry, On May 1, 2004, at 2:58 PM, Jerry LeVan wrote: You might try one more time, the first time takes the longest, subsequent invocations just looks at differences... I can't think of any reason why the program is chewing cpu after the task is finished. It works by calling psync ( a perl program to do the copying and adjusting permissions). If DejaVu calls psync to do the work, then why do I need DejaVu. Why can't I just put the psync command in cron? I believe that while it is running it might put a menu in the menu bar (on the right hand side), you might try looking there... It puts a horseshoe shaped logo up by the battery level indicator. But all it says is "backup in progess" no indication of how much it has done or what remains. Joe. I seems like I recall a program "RsyncX" that is put out by a consortium of educational users, you might take a look at that. Jerry On May 1, 2004, at 1:38 PM, Joseph Alotta wrote: Greetings, Taking Jerry's recommendation, I downloaded DejaVu and ran it last night. It started about 10pm and at 12:30pm it was still running and I went to bed, (my energy savings preferences were set to dvd playback). I couldn't see any progress bar, although it said it had one. When I awoke this morning it was finished. However, now it is still using 94% of my cpu time and I don't know what it could be doing, preference panel says it is disabled. Also, I was looking at the files it wrote, and though they are all there, the file sizes are different. This is the original: [Abba:~/Desktop] josephal% ls -la total 256 drwx--12 josephal staff 408 30 Apr 22:10 . drwxr-xr-x37 josephal staff1258 29 Apr 10:42 .. -rwx-- 1 josephal staff 21508 30 Apr 22:10 .DS_Store -rw-r--r-- 1 josephal staff 0 2 Oct 2002 .localized drwxr-xr-x 7 josephal staff 238 30 Apr 22:10 DejaVu drwxr-xr-x 334 josephal staff 11356 30 Apr 22:10 bankers box drwxr-xr-x 130 josephal staff4420 29 Apr 11:44 charts drwxrwxrwx 142 josephal staff4828 1 Mar 15:09 contact letters -rw-r--r-- 1 josephal staff 102557 27 Apr 15:25 google.pdf drwxr-xr-x 4080 josephal staff 138720 29 Apr 10:44 historical_data drwxr-xr-x 123 josephal staff4182 29 Apr 10:46 reports drwxr-xr-x30 josephal staff1020 12 Mar 17:30 trifold brochure [Abba:~/Desktop] josephal% This is the copy: [Abba:Users/josephalotta/Desktop] josephal% ls -la total 208 drwx--11 josephal unknown 374 30 Apr 22:10 . drwxr-xr-x36 josephal unknown1224 29 Apr 10:42 .. -rw-r--r-- 1 josephal unknown 0 2 Oct 2002 .localized drwxr-xr-x 6 josephal unknown 204 30 Apr 22:10 DejaVu drwxr-xr-x 333 josephal unknown 11322 30 Apr 22:10 bankers box drwxr-xr-x 129 josephal unknown4386 29 Apr 11:44 charts drwxrwxrwx 141 josephal unknown4794 1 Mar 15:09 contact letters -rw-r--r-- 1 josephal unknown 102557 27 Apr 15:25 google.pdf drwxr-xr-x 4079 josephal unknown 138686 29 Apr 10:44 historical_data drwxr-xr-x 122 josephal unknown4148 29 Apr 10:46 reports drwxr-xr-x29 josephal unknown 986 12 Mar 17:30 trifold brochure [Abba:Users/josephalotta/Desktop] josephal% So, I guess I need to reboot to get my CPU time back. What do you think? Is DejaVu a tested product or is it alpha/beta? Seems it has four strikes against it: 1. Slow, 2. No progress Bar, 3. File sizes, 4. high CPU usage while doing nothing. Also, I do not like the fact it is a preference panel as I can't kill it, in times like this. Joe.
Re: backing up using DejaVu
I can't think of any reason why not :), If you examine the source to psync you will find the documentation embedded near the end. If you installed DejaVu, look in /usr/local/bin for psync. I think the help even gives a command for copying an entire volume. Let us know how it turns out... Jerry On May 2, 2004, at 9:50 PM, Joseph Alotta wrote: Jerry, On May 1, 2004, at 2:58 PM, Jerry LeVan wrote: You might try one more time, the first time takes the longest, subsequent invocations just looks at differences... I can't think of any reason why the program is chewing cpu after the task is finished. It works by calling psync ( a perl program to do the copying and adjusting permissions). If DejaVu calls psync to do the work, then why do I need DejaVu. Why can't I just put the psync command in cron? I believe that while it is running it might put a menu in the menu bar (on the right hand side), you might try looking there... It puts a horseshoe shaped logo up by the battery level indicator. But all it says is "backup in progess" no indication of how much it has done or what remains. Joe. I seems like I recall a program "RsyncX" that is put out by a consortium of educational users, you might take a look at that. Jerry On May 1, 2004, at 1:38 PM, Joseph Alotta wrote: Greetings, Taking Jerry's recommendation, I downloaded DejaVu and ran it last night. It started about 10pm and at 12:30pm it was still running and I went to bed, (my energy savings preferences were set to dvd playback). I couldn't see any progress bar, although it said it had one. When I awoke this morning it was finished. However, now it is still using 94% of my cpu time and I don't know what it could be doing, preference panel says it is disabled. Also, I was looking at the files it wrote, and though they are all there, the file sizes are different. This is the original: [Abba:~/Desktop] josephal% ls -la total 256 drwx--12 josephal staff 408 30 Apr 22:10 . drwxr-xr-x37 josephal staff1258 29 Apr 10:42 .. -rwx-- 1 josephal staff 21508 30 Apr 22:10 .DS_Store -rw-r--r-- 1 josephal staff 0 2 Oct 2002 .localized drwxr-xr-x 7 josephal staff 238 30 Apr 22:10 DejaVu drwxr-xr-x 334 josephal staff 11356 30 Apr 22:10 bankers box drwxr-xr-x 130 josephal staff4420 29 Apr 11:44 charts drwxrwxrwx 142 josephal staff4828 1 Mar 15:09 contact letters -rw-r--r-- 1 josephal staff 102557 27 Apr 15:25 google.pdf drwxr-xr-x 4080 josephal staff 138720 29 Apr 10:44 historical_data drwxr-xr-x 123 josephal staff4182 29 Apr 10:46 reports drwxr-xr-x30 josephal staff1020 12 Mar 17:30 trifold brochure [Abba:~/Desktop] josephal% This is the copy: [Abba:Users/josephalotta/Desktop] josephal% ls -la total 208 drwx--11 josephal unknown 374 30 Apr 22:10 . drwxr-xr-x36 josephal unknown1224 29 Apr 10:42 .. -rw-r--r-- 1 josephal unknown 0 2 Oct 2002 .localized drwxr-xr-x 6 josephal unknown 204 30 Apr 22:10 DejaVu drwxr-xr-x 333 josephal unknown 11322 30 Apr 22:10 bankers box drwxr-xr-x 129 josephal unknown4386 29 Apr 11:44 charts drwxrwxrwx 141 josephal unknown4794 1 Mar 15:09 contact letters -rw-r--r-- 1 josephal unknown 102557 27 Apr 15:25 google.pdf drwxr-xr-x 4079 josephal unknown 138686 29 Apr 10:44 historical_data drwxr-xr-x 122 josephal unknown4148 29 Apr 10:46 reports drwxr-xr-x29 josephal unknown 986 12 Mar 17:30 trifold brochure [Abba:Users/josephalotta/Desktop] josephal% So, I guess I need to reboot to get my CPU time back. What do you think? Is DejaVu a tested product or is it alpha/beta? Seems it has four strikes against it: 1. Slow, 2. No progress Bar, 3. File sizes, 4. high CPU usage while doing nothing. Also, I do not like the fact it is a preference panel as I can't kill it, in times like this. Joe.
Re: backing up using DejaVu
You might try one more time, the first time takes the longest, subsequent invocations just looks at differences... I can't think of any reason why the program is chewing cpu after the task is finished. It works by calling psync ( a perl program to do the copying and adjusting permissions). I believe that while it is running it might put a menu in the menu bar (on the right hand side), you might try looking there... I seems like I recall a program "RsyncX" that is put out by a consortium of educational users, you might take a look at that. Jerry On May 1, 2004, at 1:38 PM, Joseph Alotta wrote: Greetings, Taking Jerry's recommendation, I downloaded DejaVu and ran it last night. It started about 10pm and at 12:30pm it was still running and I went to bed, (my energy savings preferences were set to dvd playback). I couldn't see any progress bar, although it said it had one. When I awoke this morning it was finished. However, now it is still using 94% of my cpu time and I don't know what it could be doing, preference panel says it is disabled. Also, I was looking at the files it wrote, and though they are all there, the file sizes are different. This is the original: [Abba:~/Desktop] josephal% ls -la total 256 drwx--12 josephal staff 408 30 Apr 22:10 . drwxr-xr-x37 josephal staff1258 29 Apr 10:42 .. -rwx-- 1 josephal staff 21508 30 Apr 22:10 .DS_Store -rw-r--r-- 1 josephal staff 0 2 Oct 2002 .localized drwxr-xr-x 7 josephal staff 238 30 Apr 22:10 DejaVu drwxr-xr-x 334 josephal staff 11356 30 Apr 22:10 bankers box drwxr-xr-x 130 josephal staff4420 29 Apr 11:44 charts drwxrwxrwx 142 josephal staff4828 1 Mar 15:09 contact letters -rw-r--r-- 1 josephal staff 102557 27 Apr 15:25 google.pdf drwxr-xr-x 4080 josephal staff 138720 29 Apr 10:44 historical_data drwxr-xr-x 123 josephal staff4182 29 Apr 10:46 reports drwxr-xr-x30 josephal staff1020 12 Mar 17:30 trifold brochure [Abba:~/Desktop] josephal% This is the copy: [Abba:Users/josephalotta/Desktop] josephal% ls -la total 208 drwx--11 josephal unknown 374 30 Apr 22:10 . drwxr-xr-x36 josephal unknown1224 29 Apr 10:42 .. -rw-r--r-- 1 josephal unknown 0 2 Oct 2002 .localized drwxr-xr-x 6 josephal unknown 204 30 Apr 22:10 DejaVu drwxr-xr-x 333 josephal unknown 11322 30 Apr 22:10 bankers box drwxr-xr-x 129 josephal unknown4386 29 Apr 11:44 charts drwxrwxrwx 141 josephal unknown4794 1 Mar 15:09 contact letters -rw-r--r-- 1 josephal unknown 102557 27 Apr 15:25 google.pdf drwxr-xr-x 4079 josephal unknown 138686 29 Apr 10:44 historical_data drwxr-xr-x 122 josephal unknown4148 29 Apr 10:46 reports drwxr-xr-x29 josephal unknown 986 12 Mar 17:30 trifold brochure [Abba:Users/josephalotta/Desktop] josephal% So, I guess I need to reboot to get my CPU time back. What do you think? Is DejaVu a tested product or is it alpha/beta? Seems it has four strikes against it: 1. Slow, 2. No progress Bar, 3. File sizes, 4. high CPU usage while doing nothing. Also, I do not like the fact it is a preference panel as I can't kill it, in times like this. Joe.
Re: backing up system
Yeah, but the person requesting advice say that he wanted the job to run at an off time since it tied the machine up for 40 minutes... I guess whatever "floats your boat" is ok. My last job experience was a sysadm for a big AIX box. Scheduling cron jobs was part of my 'job experience' I think we had more stuff running during the night than regular work hours... Jerry On Apr 30, 2004, at 5:46 PM, Chris Devers wrote: On Fri, 30 Apr 2004, Jerry LeVan wrote: Anacron does not appear to run cron jobs at at particular time Yeah, that's the whole point. The emphasis shifts from "I want this maintainence script to run at 3:47 am every Sunday night" to "this maintainence script needs run once a week, preferably when you're not doing anything else." More often than not, the latter is all that's really required. Anacron considers the problem from a different point of view, and for a lot of people's needs, this may be more appropriate than the traditional approach. They come right out and say on their home page that this isn't meant to replace the traditional Cron system, but rather to supplement it for people with different usage patterns (laptops, people who turn their machine off at night, etc). -- Chris Devers
Re: backing up system
Anacron does not appear to run cron jobs at at particular time, the dailyWakeup/keypress/cron combination can insure that the cron job is run on time. If you want, dailyWakeup can even restart the system to get going :) If you want a hands on approach PMQueueManager will allow you to schedule any many PM events as you want. Jerry On Apr 30, 2004, at 4:57 PM, Sherm Pendley wrote: On Apr 30, 2004, at 4:36 PM, Jerry LeVan wrote: If you want to use cron and let your system go to sleep then you might want to take a look some of the stuff I have at http://homepage.mac.com/levanj/Cocoa. It turns out you have to do a little song and dance to make sure the mac is awake (for a long enough period) when cron fires. Or you could use anacron: <http://anacron.sourceforge.net/> <http://sourceforge.net/projects/anacron> There's a Fink package too. sherm--
Re: backing up system
I use DejaVu for periodic backing up of important folders. It runs as a preference panel, uses cron and psync. If you want to use cron and let your system go to sleep then you might want to take a look some of the stuff I have at http://homepage.mac.com/levanj/Cocoa. It turns out you have to do a little song and dance to make sure the mac is awake (for a long enough period) when cron fires. Jerry On Apr 30, 2004, at 4:22 PM, Joseph Alotta wrote: Greetings, I try to back up my system once a week. I have a firewire disk drive that I use for this purpose. I have been using the Lacie software that came with it. Before Panther, I used to be able just to plug it in and run it under my own id. Now I need to log in as root to run it. Which means I can't do anything else until it finishes, and it takes about 40 minutes. I am looking to do something more automatic. Questions: 1. Can iSync be used for backups? I'm not sure if I have iSync unless it is standard in Panther. 2. Otherwise, has someone wrote a perl program to do this that I can run in cron. Thank you so much, Joe.
Re: Simple perl script send email
My daily.local file looks like: /usr/bin/mail -s Crontab jerry < No need for perl if you have Postfix set up :) Cron runs the daily.local file if it exists in periodic daily I requeue a wakeup request for the next morning... see http://homepage.mac.com/levanj/Cocoa for a way to make sure your cron jobs get run on time. Jerry On Apr 25, 2004, at 5:16 PM, Bill Stephenson wrote: Just curious, did you run the crontab command? I know I sometimes just forget the simple stuff... Kindest Regards, Bill Stephenson On Apr 25, 2004, at 4:28 AM, Mark Wheeler wrote: Hi, I just installed 10.3 and am trying to get a cron job to fire off a perl script which will send an email saying the cron job was completed. crontab listing * * * * * /Users/blah/Library/Scripts/test.pl Here is the script: test.pl #!/usr/bin/perl -w use strict; my $from = '[EMAIL PROTECTED]'; my $to = '[EMAIL PROTECTED]'; my $body = "Success."; open (SENDMAIL, "| mail -t"); print SENDMAIL "Subject: Backup Email Test\n"; print SENDMAIL "From: $from\n"; print SENDMAIL "To: $to\n\n"; print SENDMAIL $body; close (SENDMAIL); exit; -- I have enabled Postfix to be running and have sent and received an email from the command line. I've also executed the script run from the command line. But the script doesn't seem to be sending an email. Do I need to get perl set to run in a settings file? I thought that I only needed to mess with settings files if I was going to use the web server. A little help would be appreciated. Thanks, Mark
Re: Documentation Install Problem with perl/tk
It's probably not quite that easy ;( Typing "man Tk//grid" seems like it might be a pain...I guess I might have to write a script to strip the "Tk//". Is there any way I can at least get the pod files updated in the Tk perl area? Trying to read the make file gives me severe headaches... --Jerry On Apr 25, 2004, at 3:06 PM, Sherm Pendley wrote: On Apr 24, 2004, at 11:13 PM, Jerry LeVan wrote: The man folder contained a "man1" and a "man3" folder. Each of these folders contains files with names like "Tk//grid.3pm". The contents look like nroff stuff. ( Note the ":" is the native mac file path seperator). As the directory name implies, they're man pages, created with pod2man as part of the install process. Perl is configured with the correct path for man pages in $Config{siteman1}, so it would seem that the makefile created by ExtUtils::MakeMaker is ignoring this config variable and using $Config{siteprefix} . '/man' instead. Any simple fix? The fix is far from simple - patch ExtUtils::MakeMaker to do the right thing, and rebuild/reinstall Perl. :-( On the other paw, there is a very simple workaround. Move the current contents of /man/man1 to /usr/share/man/man1, and the contents of /man/man3 to /usr/share/man/man3: sudo mv /usr/man/man1/* /usr/share/man/man1/ sudo mv /usr/man/man3/* /usr/share/man/man3/ Then delete the /man directory, and in its place create a symbolic link that points to /usr/share/man: sudo rm -r /man sudo ln -s /usr/share/man /man If you'd like to hide the /man directory/link from Finder, just add it to the /.hidden file. It's a simple text file, so use vi, emacs, BBEdit, whatever your favorite editor is. sherm--
Documentation Install Problem with perl/tk
This morning I installed the latest version of perl/tk (804.27). After the install I noticed a folder named "man" in my root directory. The man folder contained a "man1" and a "man3" folder. Each of these folders contains files with names like "Tk//grid.3pm". The contents look like nroff stuff. ( Note the ":" is the native mac file path seperator). The dates on all of the files were for today... I looked in the standard Perl install location and noticed that all of the Tk "pod" files were dated from and earlier install. Any simple fix? Jerry
OT: Looked at system.log lately?
Hi, I upgraded to 10.3.3 and it appears to tickled a USB problem, system.log is growing at about 250K a day. The same error message over and over and over... The diagonostic disk shows no errors. Apple has asked for a profile and copy of a system log. It sounds like I am not the only one with this problem. I was desperate to control the log size so I invented a rube goldberg scheme to make sure that cron would fire every night even if the mac was in a deep sleep. The tools are dailyWakeup and ShowPMQueue. It's not perl but cron runs properly now... Details at http://homepage.mac.com/levanj/Cocoa Jerry
Re: Preview.app opening multiple files
You could use an applescript... This seems to work tell application "Finder" open {"Macintosh HD:Users:jerry:Pictures:ElephantHead.jpg", ¬ "Macintosh HD:Users:jerry:Pictures:PB.jpg"} end tell --Jerry On Mar 23, 2004, at 6:35 PM, Chris Devers wrote: On Tue, 23 Mar 2004, Joseph Alotta wrote: I have dozens of these one page pdf files. If I select them all in finder and double click, Preview opens them in one window as a multiple-page document. This is what I'd like to have happen. Yeah, this bugs me too. I *think* this is really a shell vs. Finder issue, and I don't know what the fix is, but generally it seems like if you want to work on a collection of files, the Finder can operate on that collection as a set -- hence opening PDFs together in Preview, or a directory or a directory tree full of MP3s in iTunes, etc -- but if you do the same sort of thing from the command line, it's as if you sent out a series of commands such as "open -a foo bar1; open -a foo bar2; open -a foo bar3;" etc. Annoying. To date, I haven't found a way around this. The issue is broader than just Preview & PDFs though -- something the Finder is doing allows collections of files to be handled as a single set, and nothing I've tried from the command line has been able to reproduce that functionality. I'm also curious what workarounds people have for this. -- Chris Devers
Re: Urgent: Turning a script into a droplet
Do a search for "DropScript" on Google. --Jerry On Mar 16, 2004, at 12:06 AM, Rick Measham wrote: Need some quick help ... how do I turn a perl script into a droplet (and when I do, do the dropped files appear in @ARGV still?) Cheers! Rick Senior Developer PrintSupply - Print Procurement & Supply Management 18 Greenaway Street VIC 3105 Tel: (03) 9850 3255 Fx: (03) 9850 3277 http://www.printsupply.com.au/
Re: Perl/TK (Was: ANNOUNCE: Affrus 1.0 - a Perl Debugger
From the Google comp.lang.perl.tk group > Steve Lidie <[EMAIL PROTECTED]> writes: >> On Feb 28, 2004, at 12:49 PM, Nick Ing-Simmons wrote: >> >>> Pause <[EMAIL PROTECTED]> writes: >>>> The uploaded file >>>> >>>>Tk-804.025_beta15.tar.gz >>>> >> >> Results for Mac OS X Panther 10.3.2, IRIX 6.5.20m and AIX 5.2.0.0 are >> close to 100% thumbs up. Panther compiled, loaded and tested >> perfectly. >> Both AIX and IRIX had one problem with Xlib_f.h while compiling the >> new >> tkImgGIF.c. > > I see what happened. Xlib_f.h got included but Xlib.h didn't. > OK, all works fine now. On Mar 11, 2004, at 6:19 PM, Bohdan Peter Rekshynskyj wrote: On Mar 11, 2004, at 18:15, Jerry LeVan wrote: Works fine on my stock Panther Perl...Tk-804.025_beta13 So - you downloaded this from CPAN and just used the Darwin install then? No kludges or anything? BPR Jerry Bohdan> Any quick way to install for use? A web-site or page on this? It installs according to the "INSTALL.darwin" in the distro. You *cannot* use the Panther Perl with it. You have to build your own. My configure line (which works fine) is: ./Configure -des -Duseshrplib -Dusedevel -Uversiononly -Dprefix=/opt/perl/snap -Dlocincpth=/sw/include -Dloclibpth=/sw/lib [EMAIL PROTECTED] But beware, I'm installing into /opt/perl/snap (for snapshots).
Re: Affrus PLUS Perl/TK
Yes :) Jerry On Mar 11, 2004, at 6:09 PM, Bohdan Peter Rekshynskyj wrote: On Mar 11, 2004, at 18:05, Jerry LeVan wrote: Last version of Tk I tried built out of the box. Do you mean you downloaded this from CPAN or somewhere? Thanks! BPR PS - Mark - Affrus support TK extensions? Could I actually step through, line by line, and actually see my graphic widgets manifest themselves one by one? Jerry PS - any Perl/TK users out there? Do we have an FAQ for this yet? I use TK with perl on Solaris alot, but haven't yet turned my attention to running this under OS X. Installation instructions/pitfalls might be a nice thread, if not rehashed already! Thanks!
Re: Perl/TK (Was: ANNOUNCE: Affrus 1.0 - a Perl Debugger
Works fine on my stock Panther Perl...Tk-804.025_beta13 Jerry Bohdan> Any quick way to install for use? A web-site or page on this? It installs according to the "INSTALL.darwin" in the distro. You *cannot* use the Panther Perl with it. You have to build your own. My configure line (which works fine) is: ./Configure -des -Duseshrplib -Dusedevel -Uversiononly -Dprefix=/opt/perl/snap -Dlocincpth=/sw/include -Dloclibpth=/sw/lib [EMAIL PROTECTED] But beware, I'm installing into /opt/perl/snap (for snapshots).
Re: Affrus PLUS Perl/TK
Last version of Tk I tried built out of the box. Jerry PS - any Perl/TK users out there? Do we have an FAQ for this yet? I use TK with perl on Solaris alot, but haven't yet turned my attention to running this under OS X. Installation instructions/pitfalls might be a nice thread, if not rehashed already! Thanks!
Re: Getting a 'Save As' dialog box
Have you ever looked at Perl/Tk ? It provides a complete GUI for Perl under X11. --Jerry On Jan 11, 2004, at 10:51 PM, Rick Measham wrote: Hello People, I need some help with a perl on OS-X problem. I need to pop up a 'Save As' dialog. Basically the same as the one AppleScript gives you when you: choose file name with prompt "Select a location to save this file" default name "Name" but I need to do this from perl. At first I thought it might be simple: $file = `osascript -e 'choose file name with prompt "test1" default name "test2"'`; but that gives me: 0:57: execution error: No user interaction allowed. (-1713) So next I used CPAN module Mac::AppleScript and I don't get any reply at all: RunAppleScript(qq(choose file name with prompt "test1" default name "test2")); But I figure that somewhere in all this there must be a way to pop up such a dialog directly from perl. How? Thanks and Cheers! Rick Rick Measham Senior Designer and Developer Printaform Pty Ltd Tel: (03) 9850 3255 Fax: (03) 9850 3277 http://www.printaform.com.au http://www.printsupply.com.au vcard: http://www.printaform.com.au/staff/rickm.vcf
Perls of taking a vacation...
After programming every day for about 25 years I retired a year ago and quit programming for a year. I recently bought a soldering station that displays temp in Centigrade so yesterday I saddled up again and ran into the wall with this code for a bit... #!/usr/bin/perl if ( scalar @ARGV ==0){ print "ftoc \n"; exit ; } print (5.0/9.0)*($ARGV[0]-32.0), " Centigrade\n" ; I had to grab the Perl book and found "If it looks like a function it is a function". Y'all ever been bit by this type of misdirection? --Jerry
Speaking of Tk...
I built Perl/Tk on Panther and found that the standard file selection and file save widgets generate a bus error. ( The "widget" demo will provide a working "example" of the failure ). I posted the problem on comp.lang.perl.tk and Steve Lidy(?) verified the problem. I have not seen any movement on the problem. Does anyone know who manages the OS X port of Perl/Tk? --Jerry
Re: Problems installing Tk
Configure is generally found in the Perl source distribution. The version of Perl that comes with Panther builds Tk ok. Your probably need to do something like ./Configure if the perl source directory is not in your PATH. --Jerry On Nov 17, 2003, at 6:14 PM, John Delacour wrote: At 9:17 pm + 17/11/03, John Delacour wrote: When I install Tk I get the same error with all the tests. If I force-install, then I get the same error im MainWindow.pm (though with a different path of course) when I try to run a script that calls Tk. Any hints as to how to fix this? DIED. FAILED tests 1-96 Failed 96/96 tests, 0.00% okay t/JP.couldn't connect to display ":0" at /Users/jd/.cpan/build/Tk-804.025_beta6/blib/lib/Tk/MainWindow.pm line 55. I now see in the README.darwin ___ For Tk804.025 to build properly on Mac OS X 10.2 (Jaguar) or 10.3 (Panther), Perl must be built dynamic, rather that the default of static. Use a Configure incantation similar to this: sh Configure -des -Duseshrplib [-Dprefix=/path/to/your/private/perl] S. Lidie, 2003/10/27 ___ but that gives me sh-2.05b# Configure -des -Duseshrplib sh: Configure: command not found sh-2.05b# Any ideas? JD
Re: Problems installing Tk
Are you running the X server? It pretty well compiled out the box for me. Failed 5 or 6 tests. There is another problem with Tk on Panther is the the standard file open/close dialogs "bus error". I have not seen a fix to this problem. --Jerry On Nov 17, 2003, at 4:17 PM, John Delacour wrote: When I install Tk I get the same error with all the tests. If I force-install, then I get the same error im MainWindow.pm (though with a different path of course) when I try to run a script that calls Tk. Any hints as to how to fix this? DIED. FAILED tests 1-96 Failed 96/96 tests, 0.00% okay t/JP.couldn't connect to display ":0" at /Users/jd/.cpan/build/Tk-804.025_beta6/blib/lib/Tk/MainWindow.pm line 55. JD
Re: "safe" system()?
> Let's say that I want to use a command (e.g., md5) on a file. No > problem; just use: > > system("md5 $file"); > > Except that the file name could contain all manner of white space > characters, shell wildcard characters, etc. Is there a module that > deals with this sort of thing (e.g., wrapping each argument in the > appropriate kinds of quoting)? > > -r > > P.S. This isn't strictly an OSX issue, but I see far more weird > characters in OSX file names than I ever saw in *BSD, etc. Yeah, this probably has some holes... # to be safe, quote shell metacharacters $command =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"])/\\$1/g; Parse($command); --Jerry
Re: Perl/Tk on OSX?
I built Perl/Tk 8.00.024 some time ago for Jaguar. Regrettably I have a peculiar problem with the dialog that chooses a path name for opening. (I think I used perl 5.6.1) It always returns null! Fortunately there is an alternative, but clumsier, widget available that does work... The open file dialog worked fine for my prejaguar versions of OS X. I had a similiar problem with an AIX system I used to administer. To the best of my knowledge I am the only person cursed with this affliction... With the help of some people on comp.lang.perl.tk I put some traces into the library but everything worked fine until the final return, which was munged. On homepage.mac.com/levanj there is a pointer to some of my perl programs, the "csv" program, an editor for tab,comma/whatever separated files has some comments near the top where I have a problem. --Jerry
Re: DYLD_ALLOW_MULTISYMS
> OK, I know I had this working once before. Trying to install Tk. I've > got the DYLD_ALLOW_MULTISYMS environment variable set but I'm still > getting the note about duplicate definitions of _LangExit in Tk.bundle > and the other one (Event, I think). > > This is under 10.2.2. Am I correct that you don't need to (and should > not!) download the hacked version of 'dyld' under Jaguar? > > Tk800.024, Perl 5.8.0. > > I *know* I'm missing something, I just don't know what. OK, from a post I made awhile ago on comp.lang.perl.tk, , Mac "Jaguar" and Perl/Tk, is it safe? the following was the response: Subject: Re: Mac "Jaguar" and Perl/Tk, is it safe? From: Michael Doster <[EMAIL PROTECTED]> Date: Tue, 27 Aug 2002 02:30:53 GMT Newsgroups: comp.lang.perl.tk Hello all, In Mac OS X 10.2, a hacked dyld is no longer necessary to get Perl/Tk to work. Here's how: 1) First, upgrade to Mac OS 10.2 (Jaguar). If you do a clean install, pay close attention to steps 3 and 4. 2) Install the latest development tools from the included Developer Tools CD. 3) If XDarwin doesn't work - and it won't if you did a "clean install" - them simply reinstall from: http://sourceforge.net/project/showfiles.php?group_id=18034&release_id=71056 First install XInstall_10.1.sit Then install the fixed xterm Jaguar_XTerm_Update.zip. 4) If you run OroborOSX and need to re-install, get it here: http://oroborosx.sourceforge.net/download.html#v075a1 5) Fetch perl-5.8.0.tar.gz from CPAN and install thusly: tar -zxpf perl-5.8.0.tar.gz cd perl-5.8.0 sh Configure -des make make test (97% pass) sudo make install That replaces the default Apple 5.6.0 Perl. 6) Fetch Tk800.024.tar.gz from your favorite CPAN mirror such as this one: http://mirrors.develooper.com/perl/backup.pause/authors/id/N/NI/NI-S/ tar -zxpf Tk800.024.tar.gz cd Tk800.024 perl -v (ensure 5.8.0 is found) 7) Make the following changes to Tk/MMutil.pm in the const_config subroutine: if ($^O eq 'MSWin32' && $Config{'ccflags'} =~ /-DPERL_OBJECT/) { $self->{'LDFLAGS'} =~ s/-(debug|pdb:\w+)\s+//g; $self->{'LDDLFLAGS'} =~ s/-(debug|pdb:\w+)\s+//g; } elsif ($^O eq 'darwin' ) { $self->{'LDDLFLAGS'} =~ s/-flat_namespace\s+//; $self->{'LDDLFLAGS'} =~ s/-undefined\s+suppress\s+//; if ( -e "$Config{'archlib'}/CORE/$Config{'libperl'}" ) { $self->{'LDDLFLAGS'} .= " -L\${PERL_ARCHLIB}/CORE -lperl "; } elsif ( -e "/System/Library/Perl/darwin/CORE/libperl.dylib" ) { $self->{'LDDLFLAGS'} .= " -L/System/Library/Perl/darwin/CORE -lperl "; } else { warn "Can't find libperl.dylib"; } $self->{'LDFLAGS'} =~ s/-flat_namespace\s+//; $self->{'LDFLAGS'} =~ s/-undefined\s+suppress\s+//; } elsif ($^O =~ /(openbsd)/i) 8) While running XDarwin and your favorite terminal app (xterm,rxvt, etc.) do the usual from the Tk800.024 directory: perl Makefile.PL make make test sudo make install in article ak996q$[EMAIL PROTECTED], Stephen O. Lidie at [EMAIL PROTECTED] wrote on 8/24/02 8:43 PM: > Michael Doster <[EMAIL PROTECTED]> wrote: >> Sorry for the inconvenience, but it appears that the new dyld is not ready >> for primetime after all. I'll let you know when it's fixed. > >> -- Mike :-( > --Jerry
Re: [OT}Arrgh, Something has gone wrong with my permissions
Ahh, Thanks for the info... --Jerry > On Tuesday, December 3, 2002, at 02:58 PM, Jerry LeVan wrote: > >> This morning when I tried to send some mail I was kept getting failure >> messages. >> >> Reading mail was OK. >> >> Mail log asserted localhost had refused connection. After some putzing >> around I noticed that "/" was owned by me and had all permissions >> turned on! >> >> System and System/Library seem to have suffered a similar fate. I >> started >> getting mail failures at about the same time I installed >> the"eUSBSmartmedia" >> upgrade package. >> >> I changed the owner/permissions of "/" to >> drwxr-xr-x 51 root admin 1734 Dec 3 13:56 / >> >> That seemed to get mail going again, ( I set Don't Blame Sendmail ) >> >> Could someone :) email a copy of a long directory listing of "/" and >> also >> include the owner/permissions for the /System/Library directory? > > Jerry, > > Run the Repair Privileges tool in Disk Utility instead. It's under the > First Aid tab. You can copy the log out of the display window and save > it in case you have some unique privs settings on your box. > > Phil Burk > > Systems Support Technician Wiley > Publishing, Inc. > 10475 Crosspoint Blvd > Indianapolis, IN 46256 > 317.572.3049 phone > 317.572.1049 fax > [EMAIL PROTECTED] > > [EMAIL PROTECTED] >
[OT}Arrgh, Something has gone wrong with my permissions
This morning when I tried to send some mail I was kept getting failure messages. Reading mail was OK. Mail log asserted localhost had refused connection. After some putzing around I noticed that "/" was owned by me and had all permissions turned on! System and System/Library seem to have suffered a similar fate. I started getting mail failures at about the same time I installed the"eUSBSmartmedia" upgrade package. I changed the owner/permissions of "/" to drwxr-xr-x 51 root admin 1734 Dec 3 13:56 / That seemed to get mail going again, ( I set Don't Blame Sendmail ) Could someone :) email a copy of a long directory listing of "/" and also include the owner/permissions for the /System/Library directory? Thanks, Jerry
Re: Process table information
Well, If we were running linux we could look in /proc. Possible solutions: 1) Get the source for darwin and study the code for the ps command. 2) Study the header files to find the format for the proc table, examine the kernel symbol table to get the start address of the proc table. Write code that fetches the table from /dev/kmem and parses it. ( I have done this with some other unix systems...). might be a good starting point. Regrettably sysctl does not give access to table info in the kernel. --Jerry > Hey, > > I was thinking about working on Proc::ProcessTable to get support for OS > > X. But after a little effort, it occurred to me that I have no clue how > > to access process table information. Anyone know this kind of thing, or > > could tell me what docs to look at? > > Thanks. > > -Ken >
Re: mod_ssl and libdbm
David [macjerry:/usr/lib]$ otool -vM libSystem.dylib | grep module_name | grep db module_name = ndbm.So module_name = db.So module_name = aliasdb.o module_name = printerdb.o Looks like something is there :) Regrettably I don't understand shared library syntax. Ie how to specify it on the link line. --Jerry [ > Hi All, > > I've been using mod_ssl with Apache 1.3.x on Mac OS X for a while now, > and it works great. I've had to use gdbm to get it to compile, but that > was okay with me. > > Now, however, I'm writing an article about this, and want to try to > eliminate the gdbm dependency in the name of simplicity. I know it can > be done, because Apple includes mod_ssl with their Apache. Furthermore, > via their bug report system, they tell me that libdm is in the Mac OS X > system library, libSystem. But mod_ssl's configure has never been able > to find it. -lm and -ldbm both fail. > > So I tried --enable-rule=SSL_SDBM, and that got Apache/mod_ssl to > compile nicely. Yay! But then, when I tried to connect to the SSL port, > Apache segfaulted! > > [Fri Nov 15 12:29:03 2002] [notice] child pid 26629 exit signal > Segmentation fault (11) > > So I'm stuck and could use some help from those more experienced with > compiling on Mac OS X. Does anyone know how to a) get Apache's > configure to find libdbm in libSystem and use it? Or b) have any idea > why Apache/mod_ssl might be segfaulting when using SDBM? > > TIA! > > David
Re: how to turn off locale
> Not equally effective. I run Perl from BBEdit, cron and other places > where I am not guaranteed to easily have those variables defined. > On Wednesday, November 6, 2002, at 06:10 AM, Alex Robinson wrote: > >>> Create the file "~/.MacOSX/environment.plist" containing the > following >>> content WITH UNIX LINE ENDINGS and log in again. But if you set >>> LC_ALL to >>> anything but "C", I have found that the problem persists, so this >>> still >>> doesn't seem to be a full solution. You will probably want 'en_US' > for >>> LANG. Other remedies I've read were ineffectual. >> >> Equally effective is to just set it in your shell environment >> >> eg. if you're using tcsh >> >> >> setenv LC_ALL 'C' >> setenv LANG 'en_UK' >> >> > Have you tried adding d_setlocale=undef; in the darwin hints file and rebuilding perl? --Jerry
Perl Tk problem revisited
Hi, A couple of days ago I complained about getOpenFile always returning an empty string. I also asserted that the "widget" demo "worked". Regrettably I was wrong on both assertions, on my system, MacOSX 10.2.1, Perl 5.8.0, Tk 800.024, the failure only occurs on the first invocation of either call. The following code will return an empty string on the first iteration and the correct string on subsequent iterations. #!/usr/local/bin/perl use Tk; $mw = new MainWindow; my $myfile="Whatever"; my $types; for $i (1,2,3) { # Get the CSV file name @types=(['All Files','*' ],['TEXT Files','.txt', 'text']); $myfile = $mw->getOpenFile(-title=>"FooBar"); print "...$myfile...\n"; } MainLoop; It smells like there is some kind of initialization problem in the Fbox code. Am I the only person with this problem? Help! Jerry
Re: Perk Tk Wierdness with getOpen File
Whoops, the url show be http://homepage.mac.com/levanj/Perl --Jerry > Hi, > > For some strange reason the following fragment seems to not work... > > # Get the CSV file name > my $types=[['All Files', '*', ]]; > if(scalar @ARGV > 0) { > $infile = $ARGV[0]; > } else { > $infile = $mw->getOpenFile(-filetypes=>$types); > print "->$infile<-\n"; > } > > In the above if the getOpenFile dialog is picked, $infile is always > Returned as the null string, bummer. $mw was earlier set by > > my $mw = new MainWindow; > > This is Perl 5.8 and MacOSX 10.2.1 and Tk 800.024, seems like when I > Upgraded to 5.8 and Jag, it used to work... I know it worked for > 10.5.1 and perl 5.6.1. > > I had a similar problem on a AIX system I used to manage, but > getOpenFile > only failed for the /etc directory... > > Any help/suggestions would be appreciated. > > The actual program is located at http://homepage.mac.com/levanj/perl > It is the csv file editor... > > --Jerry
Perk Tk Wierdness with getOpen File
Hi, For some strange reason the following fragment seems to not work... # Get the CSV file name my $types=[['All Files', '*', ]]; if(scalar @ARGV > 0) { $infile = $ARGV[0]; } else { $infile = $mw->getOpenFile(-filetypes=>$types); print "->$infile<-\n"; } In the above if the getOpenFile dialog is picked, $infile is always Returned as the null string, bummer. $mw was earlier set by my $mw = new MainWindow; This is Perl 5.8 and MacOSX 10.2.1 and Tk 800.024, seems like when I Upgraded to 5.8 and Jag, it used to work... I know it worked for 10.5.1 and perl 5.6.1. I had a similar problem on a AIX system I used to manage, but getOpenFile only failed for the /etc directory... Any help/suggestions would be appreciated. The actual program is located at http://homepage.mac.com/levanj/perl It is the csv file editor... --Jerry
Re: Expat 1.95.5 problems...
Evidently configure did something funky to me! It added a --traditional-cpp flag to the CC define. I was able to Do the build after I deleted the flag. Thanks for the heads up. --Jerry I took it out > On 10/6/02 1:43 PM, "Jerry LeVan" <[EMAIL PROTECTED]> wrote: > >> Any one built the version of expat on Jag? > > I just tried it, and it built fine (AFAICT). See below. > > Did you do anything funky with ./configure? > > - geoff > > [ganda:~/Downloads/expat-1.95.5] geoff% make > /bin/sh ./libtool --silent --mode=compile gcc -g -O2 -Wall > -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I./lib -I. -o > lib/xmlparse.lo -c lib/xmlparse.c > /bin/sh ./libtool --silent --mode=compile gcc -g -O2 -Wall > -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I./lib -I. -o > lib/xmltok.lo -c lib/xmltok.c > /bin/sh ./libtool --silent --mode=compile gcc -g -O2 -Wall > -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I./lib -I. -o > lib/xmlrole.lo -c lib/xmlrole.c > /bin/sh ./libtool --silent --mode=link gcc -g -O2 -Wall > -Wmissing-prototypes > -Wstrict-prototypes -fexceptions -I./lib -I. -no-undefined > -version-info > 4:0:4 -rpath /usr/local/lib -o libexpat.la lib/xmlparse.lo > lib/xmltok.lo > lib/xmlrole.lo > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions > -I./lib -I. -o xmlwf/xmlwf.o -c xmlwf/xmlwf.c > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions > -I./lib -I. -o xmlwf/xmlfile.o -c xmlwf/xmlfile.c > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions > -I./lib -I. -o xmlwf/codepage.o -c xmlwf/codepage.c > gcc -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions > -I./lib -I. -o xmlwf/unixfilemap.o -c xmlwf/unixfilemap.c > /bin/sh ./libtool --silent --mode=link gcc -g -O2 -Wall > -Wmissing-prototypes > -Wstrict-prototypes -fexceptions -I./lib -I. -o xmlwf/xmlwf > xmlwf/xmlwf.o > xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/unixfilemap.o libexpat.la >
Expat 1.95.5 problems...
Hi, I am getting interested in XML, so I decided to start with building expat 1.95.5. I seem to be getting preprocessor errors revolving around the definition Of XML_STATUS_OK, [macjerry:/Volumes/MacHD/software/expat-1.95.5]$ make /bin/sh ./libtool --silent --mode=compile /usr/bin/gcc --traditional-cpp -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -I./lib -I. -o lib/xmlparse.lo -c lib/xmlparse.c lib/xmlparse.c:1320: macro or #include recursion too deep lib/xmlparse.c:1324: macro or #include recursion too deep lib/xmlparse.c:1327: macro or #include recursion too deep lib/xmlparse.c:1379: macro or #include recursion too deep lib/xmlparse.c:1399: macro or #include recursion too deep lib/xmlparse.c:1404: macro or #include recursion too deep make: *** [lib/xmlparse.lo] Error 1 I futzed around with the definition of XML_STATUS_OK in expath.h but then I started getting of preprocessor errors later in the xmlparse file. Any one built the version of expat on Jag? --Jerry
Re: A man page viewer...
Greetings PK, I seem to recall that linux man pages are kept initially in a gzip format and as invoked get converted to an unpacked format. You might try removing the redirection of stderr to stdout in the man command, in fact you might even redirect it to /dev/null and see if that helps. I sorta like the bookshelf idea. I think you would have to do a tough job of parsing to try to pick out the man page references. It seems like I wrote some perl code a long time ago that stepped through the man directories and generated a html clickable index by section. Regrettably when I retired from the University all I got to keep was my email address, I lost a ton of interesting programs... --Jerry > Greetings Jerry. > > Last night I downloaded your wonderful little man page viewer. I have > modified the code a tad bit so it now primarily -- > - runs in a frameset so a search field is always visible at the top; > - added code to remember visited man pages -- > - visited man pages are added to a "bookshelf" on the left. > - duplicate entries to the bookshelf are removed. > > I also zipped up the files for the viewer and put a link on the top > frame for downloading the entire thing. > > The whole thing can be viewed at and downloaded from > http://209.83.8.226/perlman/ > > three things -- > 1. I am not sure what the protocol is... should I have sent all the > mods to you so you could have decided to put it up on your website (or > not). You didn't have any such instructions in your code, so I didn't. > If yes, just let me know and I will remove it from my website. Of > course, all your original attributions and acknowledgements are there. > > 2. I get a "gunzip: stdout: Broken pipe" message at the top of the > manpage displayed. I dunno what is causing this since this doesn't > occur on my iBook (the above website is no an old beat-up Red Hat box. > > 3. I would like to be able to convert links within manpages to actual > links that can be clicked. For example, if I view the perldsc manpage, > it says at the end, "SEE ALSO perlref(1), etc..." I would like to > click on perlref, perllol, etc. and view those manpages as well. Any > ideas? > > 4. I would also (probably this weekend) clean up the script, use strict > and all that nonsense. Would you mind if I (or you) put this up on > VersionTracker? You will be amazed at how many folks might find it > useful. > > Why? I loved the little tool ManThor... a cocoa manpage viewer. That > got Jagwired and doesn't work anymore. This little perlman viewer is a > perfect replacement, and I can use it on my Linux box at work as well. > > Many thanks, > > Puneet. > > On Monday, September 30, 2002, at 03:26 PM, Jerry LeVan wrote: > >> Hi, >> >> I dusted off my old man page viewer and it seems to work in Jaguar. > The >> program is cgi that displays man pages in a not unpleasing format. >> >> The cgi collects a set of parameters and feeds them to the man > command. >> I try to do a reasonable job of preventing evil input, please let me >> know if >> you find a hole :) >> >> The code is located at : http://homepage.mac.com/levanj/Perl >> >> Enjoy, >> >> Jerry >
A man page viewer...
Hi, I dusted off my old man page viewer and it seems to work in Jaguar. The program is cgi that displays man pages in a not unpleasing format. The cgi collects a set of parameters and feeds them to the man command. I try to do a reasonable job of preventing evil input, please let me know if you find a hole :) The code is located at : http://homepage.mac.com/levanj/Perl Enjoy, Jerry
Re: OT: MacAngst
The behavior you described is typical unix gotcha, if you name a program "test" then issuing the command "test" nothing will apparently happen because the command "test" is generally built into the shell. test.pl is ok and ./test is ok but unadorned test won't... --Jerry > At 13:34 -0400 9/30/02, Sherm Pendley wrote: >> What sort of problems did you have? I've heard some people complain > about the >> fact that Apple ships 5.6.0, or about the odd directory arrangements, > but this >> is the first time I've heard someone claim that it simply didn't work. > > The problem I had (which is no longer repeatable, I think I know why) > was: > >> % cat test.pl >> #!/usr/bin/perl >> print @ARGV; >> print "\n"; > > Which should do this > >> % ./test.pl a b c >> abc > > never gave output. It worked on a Solaris machine, but not under > my previously loaded 10.1.x. I now have 10.2 and that simple script > works.
Re: Slightly OT - Tk on Mac OS X
Installation instructions : http://www.lehigh.edu/~sol0/Macintosh/X/ptk/ Books: Learning Perl TK -- Check O'Reilly's site Mastering Perl/Tk -- Same publisher. Much can be gleaned from the demos included in the source distribution. There is a Perl/Tk mailing list located at Stanford University and There is also comp.lang.perl.tk. --Jerry > Does anyone have a book, website or other resource to recommend as a > beginners' tutorial on installing and using Tk on Jaguar? > >
Re: Perl/Tk on OS X
I believe that Jaguar fixed the multisyms problem ( at least the linker did). As far as I know, the DYLD_ALLOW_MULTISYMS was a flag that enabled a feature of the "hacked" loader for 10.1 --Jerry > > On Thursday, September 26, 2002, at 02:10 PM, _brian_d_foy wrote: >> did you make sure to set the DYLD_ALLOW_MULTISYMS environment > variable? > > Oh! I didn't know about that variable - it's probably what will > fix Apache::{Request|Cookie} too. Is it a new Jaguarism? > > -Ken >
Re: Perl/Tk on OS X
Are you sure that you are exporting DYLD_ALLOW_MULTISYMS? --Jerry > Whoops! Spoke too soon. This is weird. Built fine, the demos run well. > However > if I try and create event the simplest perl/tk script, I get dyld errors > and > it fails: > > dyld: perl multiple definitions of symbol _LangExit > /Library/Perl/darwin/auto/Tk/Event/Event.bundle definition of _LangExit > /Library/Perl/darwin/auto/Tk/Tk.bundle definition of _LangExit > > This reminds me of the errors that caused the original build to fail. > There > seems to be some recursion through libraries, such that multiple libs > try to > define the same thing. Any ideas? > > TIA > > Rich wrote: > >> Jerry/brian >> >> Thanks both. I don't know why it worked this time. I thought I had > followed >> all the instructions from the lehigh.edu site. Maybe it's just because > I'm >> on 10.1.5 now instead of 10.1.2? In any event it worked this time and > I'm a >> happy camper. Thanks. >> >> iBook 600MHz G3 384MB RAM >> MacOS X 10.1.5 >> perl 5.6.1 >> Tk-800.024 >
Re: Perl/Tk on OS X
I have built Perl/Tk for: MacOS X 10.1.5 and Perl 5.6.1 and MacOS X 10.2.1 and Perl 5.8.0 I followed the instructions found at: http://www.lehigh.edu/~sol0/Macintosh/X/ptk/ Could you be a bit more specific as to how your build failed? (Be careful, *don't* try the dyld replacement "trick" if you Are running 10.2) --Jerry > Has anyone gotten this to build. I've searched extensively. Tried the > "hacked" dyld/optimizer trick found on the lehigh.edu site - all to no > avail. XDarwin works great, perl does too. Npw I want to bring them > together. I bought my iBook with the intention of being able to use it > for cross-platform shell and perl scripting, and would love to be able > to work with perl/tk. Can anyone point me in the right direction to get > this built. > > Thanks, > -Rich >
Re: Still no joy in Mudville.
> I've struck out. > > I'm still getting the following undefined symbols from Perl 5.8: > > dyld: perl Undefined symbols: > _Perl_sv_2pv > _perl_get_sv > Trace/BPT trap > > Also discovered the following when attempting to run another program: > > dyld: perl Undefined symbols: > _Perl_safefree > _Perl_safemalloc > _Perl_sv_2pv > _perl_get_sv > Trace/BPT trap > Hmm, you might try retargeting the build to something like /usr/local. I have perl 5.6 and 5.8 coexisting. I have built Perl/Tk in 5.8 and it seems to be working fine. It seems like the errors you are getting are symtomatic of putting 5.8 into the same location as Apple's supplied perl --Jerry --Jerry
Re: Locale setting errors - LC_ALL, LANG
Hi, I undef'ed the locale stuff in hints.sh and have not noticed any evil to this point. # Locales aren't feeling well. #LC_ALL=C; export LC_ALL; #LANG=C; export LANG; d_setlocale=undef; ==Jerry > This was _really_ annoying me to the point of burning effigies of > camels, so with a view to helping any other unwary souls - > > Problem: > After rolling your own installation of perl , when you try to run a perl > > script you get a variation on the following: > > perl: warning: Setting locale failed. > perl: warning: Please check that your locale settings: > LC_ALL = "En_US", > LANG = (unset) > are supported and installed on your system. > perl: warning: Falling back to the standard locale > ("C"). > > Several places on the internet, including the ADC section of the apple > web site, suggest creating a .tcshrc or .bash file containing the > missing variables. This is only a partial solution however, working only > > if you run the script from a terminal window (aka CLI) - perl scripts > run as standalones, cron jobs and so on, still throw up locale errors > because the system environment doesn't have the necessary variable(s) > set > > The solution? > > I got the answer thanks to this page by Bob Dalgleish > http://duke.usask.ca/~dalglb/macosx/Perl_5.6.html > > where it gives an example of a shell script which makes an > environment.plist containing the missing locale variable(s). > > I've turned it into a perl script (written for clarity rather than > compactness) with some extra features which I think might be useful > (like the ability to change the language locale). > > > ==SCRIPT STARTS BELOW THIS TEXT== > #!/usr/bin/perl -w > > # Locale WTK(water torture killer).pl > # Author Robin McFarlane <[EMAIL PROTECTED]> > # > # based on the shell script written by by Bob Dalgleish > # viewable at http://duke.usask.ca/~dalglb/macosx/Perl_5.6.html > # > # This script will look for any missing folders and files in your user > folder, > # needed to kill locale related errors, creating them as need be. > # > # It will also safely add missing locale info to an existing > environment.plist, > # making a back-up of the original called "environment.plist.old" in the > > same folder. > > > > #=== declare includes = > > use strict; > use diagnostics-verbose; > > > #== declare variables = > > my ($TempPath,$path,$flag,$dir,$Missing1,$Missing2); > my (@NewPlist,@OldPlist,@Template,$TempFile,$plist); > my (%DataCheck,$ChangeFlag); > > $path=join ('/', '/Users',$ENV{USER}); > $dir ='.MacOSX'; > $plist='environment.plist'; > @Template=; > > print "Checking your current environment set up\n"; > > $TempPath= join ('/',$path,$dir); > if (-e $TempPath){ > print "\t",$TempPath," exists\n"; > }else{ > print "\t",$TempPath," is missing - creating it now\n"; > mkdir $TempPath || die "can't make $TempPath,\n OS says $!"; > } > > > $TempPath= join ('/',$TempPath,$plist); > > if (-f $TempPath){ > > print "\t",$TempPath," exists, checking the locale data\n"; > open(IN, $TempPath)|| die "can't open $TempPath,\n OS says $!"; > @OldPlist=; > close (IN); > @DataCheck{@OldPlist}=(); > > for (@Template){ > unless (exists $DataCheck{$_}){ > print "\t$_ missing from $TempPath, adding\n"; > $DataCheck{$_}=() ; > $ChangeFlag=1; > > } > @NewPlist=keys(%DataCheck); > if ($ChangeFlag){ > $flag = rename $TempPath,$TempPath.'.old'; > die "can't seem to modify $TempFile, may be permissions > related\n" if $flag; > } > } > > > } else { > print "\t",$TempPath," is missing - creating it now\n"; > @NewPlist=@Template; > $ChangeFlag=1; > } > > if ($ChangeFlag){ > > > open (OUT,">$TempPath") || die "can't print to $TempPath,\n OS > says $!"; > print OUT @NewPlist; > close (OUT); > print "your locale data has been updated - \nany changes will > come > into effect the next time you log into OSX. \n"; > }else { print "No data was changed, any problems you might be > experiencing \nare not connected with your environment.plist\n"; } > > __DATA__ > > "file://localhost/System/Library/DTDs/PropertyList.dtd"> > > > LANG > us_ENG > LC_ALL > C > > > ==SCRIPT STARTS ABOVE THIS TEXT== >
NetScape Strangeness (just a little off topic...)
Hi, I recently abandoned IE 5.x for MacOS X because it would not play nice with BankOne's online banking. Netscape is much better behaved. I recently noticed that I can't set a bookmark to get to the Perl documentation. My IE book mark looked something like: file://System/Library/Perl/html/perl.html Regrettably Netscape 6.2.3 (I think...) seems to want a URL that looks like: file://macintosh hd/System/Library/Perl/html/perl.html. Where "macintosh hd" is the name of the volume. Regrettably all of the embedded urls are of the former format, ie they do not have the volume name as part of the url. I would like to have the perl doc's on line via netscape, any suggestions? --Jerry
A couple of more tools...
Greetings, I have pretty much cleaned out my perl closet ( getting ready to abandon an account that I have had for at least a decade). I have uploaded to http://homepage.mac.com/levanj A little eye candy and a couple of tools I have found handy. There are a couple of perl solutions to the eight queens problem, how can you emplace eight queens on a chessboard so that none are attacking any of the others. Phd is my "proof of concept" non caching perl http proxy server. The story behind this project is interesting. The web was just starting to pick up steam when "the powers that be" became aware that something was happening out there. A "committee" was formed to study the problem ( naturally no CS persons were aboard). There was some talk of shutting down the http port while the problem was being studied by "the committee". Another idea floated by "the committee" was that all web pages emanating from the university would had to have "the committee's" seal of approval! I did not like the way the conversations were going so I developed the proxy server so I could bounce around the potential block of the http port by installing the proxy server at a near by school were I had another account. Fortunately sweet reason and the threat of burying the committee with hundreds of pages to approve finally swung the day :) The proxy was written when pages were much simpler ( no css, no javascript, etc). In recent testing I was able to view usatoday, cnn, and nytimes pages without any problems, salon.com seems to be a bit problematic. Any improvements would be appreciated. The other tool is a web based postgres db browser, rmtpgsql.cgi. This cgi requires DBI and DB:Pg. It will allow you to log on to any postgres database accessible via TCP/IP. I have added a couple of meta commands, "tables" will list the tables in the db that you have access to. "describe table" will do just that. There is an input box for sql commands that can be run against the database ( only one at time...). The code could easily be modified to other db's ( I did Oracle for a while) which have a DBD driver. --Jerry
Ouch! bitten by zombies
Grrr, I was raised in a Sys V /Linux environment and in my perl programs that are multithreaded I have been using: SIG{CHLD} = 'IGNORE' ; To deal with the problem of zombies. Much to my chagrin, yesterday I found out that Darwin/MacOS X does not work that way. I found out via a simple proxy http server that I had written a long time ago. It started out fine and then suddenly I could not execute any more commands. ( fork, resource temporarily unavailable). The only way I could get control again was to quit terminal. After a bit of pondering I started watching via ps as the proxy server would receive requests, sure enough the dead children where not being buried :) After a complex page was loaded the process table was littered with dead children. The solution was to use a signal handler for the Death of Child signal that basically calls waitpid(-1,WNOHANG) in a loop until no more children can be harvested. This seems to work on my MacOS X and Linux systems. I have re uploaded my perl httpd server, it had the same problem. The proxy server is still acting a bit weird, I am afraid that web pages are becoming more complex than my simple program can handle. I also uploaded my "humpf" program. This program provides a simple framework for developing menu driven perl applications. It was written for perl 4! but appears to work fine with my linux and macos x systems. One caveat, the program assumes a "terminfo" capability, this can be obtained by installing the NCURSES subsystem. Using the native macos x "tput" program will not work. I could not get the rascal to work at all until I modified the search path in the program so it would find the ncurses tput before the mac os version. My perl stuff is located at: http://homepage.mac.com/levanj Enjoy --Jerry
My Perl Web Server...
Hello, I finally got around to trying out my old perl http server on mac os x. It works! The server does user authentication, cgi, server side executables and includes. You can control access by IP. No threat to Apache :) but it was sorta fun. You can pick up the latest sources and documentation at: http://homepage.mac.com/levanj/Perl Enjoy, Jerry
How to read the Linksys Logs
Hi, Linksys provides an windoze application that can read the Linksys BEFSR series of Home routers log files. Here is a perl script that shows how the logs can be read. ( Try to maintain parity with our MS Brethern). Linksys told me that the log info Was broadcast on port 255 if a particular machine was not picked to get the Log file. I could not pick up the broadcast so I specified a fixed IP for my mac. I simply run the program in a Terminal window, a slicker approach would be to Start the program at boot time and write the results to a file, you could then ³tail f² the file and see the results. #!/usr/bin/perl -w # # Read the incoming/outgoing log files for # the Linksys BEFSR family of routers. # # Jerry LeVan ([EMAIL PROTECTED]) # May 9, 2002 # Mac OS X 10.1.4 # # Invoke By: sudo linksys.pl # use strict; use Socket; use Sys::Hostname; my ( $count, $hisiaddr, $hispaddr, $host, $iaddr, $paddr, $port, $proto, $message ); # Standard Boiler Plate for a socket... $iaddr = gethostbyname(hostname()); $proto = getprotobyname('udp'); $port = getservbyname('snmptrap', 'udp'); $paddr = sockaddr_in($port, $iaddr); socket(SOCKET, PF_INET, SOCK_DGRAM, $proto) || die "socket: $!"; bind(SOCKET, $paddr) || die "bind: $!"; while (1) { ($hispaddr = recv(SOCKET, $message, 2048, 0)) || die "recv: $!"; # &dump($message); &format($message); # print "\n\n"; } # Got the appropiate offsets here by using dump sub format { my ($string) = @_; my ($tmp, $info, $length); $tmp = substr($string,71,2); # length of message here $tmp = "\0\0".$tmp; $length = unpack "N", $tmp; # convert to a number $info = substr($string,73,$length); print timestamp()," ",$info; } sub dump { my ($string) = @_; my ( @nums,@chars,$rowindex,@tmpn,@tmpc,$i); #print "In dump strlen = ", length($string) ,"\n"; # convert file to a array o' bytes @nums = unpack "C*", $string; # convert file to an array o' chars @chars = map { chr } @nums; # replace non printable characters by "." @chars = map { if(ord($_) < 32 || ord($_) > 127){ $_='.' }else {$_}} @chars; # display stuff $rowindex = 0; while ( $#nums >= 0 ) { printf "%5x: ", $rowindex; # print row number @tmpn = splice @nums,0,16; # break off at most 16 elements @tmpc = splice @chars,0,16; # ditto for chars. if( $#nums >= 0) { # not the last row... printf "%02x " x 16, @tmpn; # print the hex values print " " ; # three spaces print @tmpc ; # now the characters print "\n"; # end of line } else { # ugly last row processing for $i (0..$#tmpn) { printf "%02x ", $tmpn[$i]; } for $i ($#tmpn+1..16) { # remainder of row of blanks print " "; } print @tmpc ,"\n"; } $rowindex = $rowindex + 16; } } sub timestamp { my @months =("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep", "Oct","Nov","Dec"); my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); $year = $year -100; sprintf("[%02u/%s/%02u:%02u:%02u:%02u]",$mday,$months[$mon],$year, $hour,$min,$sec); }
How to get the current IP from a Linksys Router
Hi, I just got online via a cable modem, yea. I am sitting behind a one port linksys Router and my provider uses DHCP so the router¹s IP is liable to change from Time to time... Here is a bit of Perl that can be used to capture the IP from the Router and perhaps mail it off to work :) Just change the admin password below >From the default ³admin² in the curl command. #!/usr/bin/perl # # fetch the current ip address from the linksys router... # Jerry LeVan ([EMAIL PROTECTED]) # Mac OS X 10.1.4 # May 12,2002 # my ($pattern,$thePage,$theAddress,$wan,$ip,$theip); #define the pattern we are looking for... $wan = '^.*.*'; $ip = 'IP Address:'; $theip = '(\d+\.\d+\.\d+\.\d+)http://192.168.1.1/Status.htm` ; # Look for the current IP embedded in the Status Page if ($thePage =~ m|$pattern|) { $theAddress = $1; print $theAddress,"\n"; # here you could mail the address ... } else { print "Problem getting address...\n"; }