Re: mac X+ perl where is the web folder

2002-08-29 Thread Joel Rees

 I am working on MAC OS X and Perl + Apache2.0.
 I used to use Asp + IIS.
 
 Would you please help me.
 1)Where is web folder of apache2.0 under os X?

Apache 2.0? Has Jaguar moved that far ahead?

 It seems related with /usr/local/apache2.0

/usr/local? Is Apple using that now?

I'm thinking I'm remembering apache (1.?) in one of those Library
directories, so you could look at the executable with the GUI, even
though you can't look at the configuration with the GUI.

 ,but I cannot copy a file into it or construct
 a folder using mkdir.

Well, that's probably because you are smart and not loggin in as root. 

Now, all you need to do is enable root login just long enough to edit
the sudoers file (Wasn't that in /etc somewhere?) and that kind of thing.

 2)Should I copy .pl file into /usr/local/apache2.0/
 cgi-bin in order to use cgi in perl?

I have the idea that the default httpd.conf actually allows you to have
cgi-bins for each user. Am I off base on that?

 3) Can you give me some documents or hypertext link
 about web-publishing
 using apache and perl ?

It's been a while since I looked that sort of stuff up. Try google:

http://www.google.com

Maybe plug in something like web-publishing apache perl example.

-- 
Joel Rees [EMAIL PROTECTED]




Re: Opening file with application

2002-09-08 Thread Joel Rees

John Labovitz [EMAIL PROTECTED] contributed

 On 9/8/02 3:58 PM, John Delacour [EMAIL PROTECTED] wrote:
 
  So at last Application names are cached somewhere with their paths.
  And about time too.  Where?
 
 Maybe here:
 
 /Library/Caches/com.apple.LaunchServices.LocalCache.csstore
 
 but it's binary, and I don't know how it's formatted.
 
 -- 
 John Labovitz
 [EMAIL PROTECTED]
 www.johnlabovitz.com

Obvious thought, but have you tried plist?

-- 
Joel Rees [EMAIL PROTECTED]




Re: Opening file with application

2002-09-08 Thread Joel Rees

John Labovitz [EMAIL PROTECTED] responded:

 On 9/8/02 8:01 PM, Joel Rees [EMAIL PROTECTED] wrote:
 
  Obvious thought, but have you tried plist?
 
 It doesn't seem to be that -- I tried both pl and plutil, and neither
 wanted to read it.  But I have no experience with plists, so maybe I'm not
 running these correctly...
 

Hmm --

http://www.macaddict.com/osx/hacks/pledit.html

talks about PropertyListEditor or something like that. (picked up by
searching with google for plist.)

They don't let me use my iBook at work, so I can't check what it was I
used last, but I keep trying to convince myself that some editor allowed
me to load and save compressed plist files. I'm probably confused,
though, seems like I spend most of my time confused.

Anyway, the file info app (cmd-i) allows you to set the default
application for a single file or a file's type, as I recall, which is
probably more to the point of the original question, now that I think
about it.

Plugging that path you mentioned:

/Library/Caches/com.apple.LaunchServices.LocalCache.csstore

into google produced three moderately interesting results, too.

(Hope you don't mind if I bounce this back to the list.

-- 
Joel Rees [EMAIL PROTECTED]




Re: Opening file with application

2002-09-10 Thread Joel Rees

 Methinks we shouldn't be going down this path, really.  Apple has a defined
 way to get to this stuff:
 
 http://developer.apple.com/technotes/tn/tn2017.html
 
 ...which is probably exactly what the 'open' command uses to figure out
 which application to launch.

Oh, darn. No excuse to write arcane code today. :)

Methinks youthinks right. Thanks for the link.

-- 
Joel Rees [EMAIL PROTECTED]




[OT] Re: OS Poll

2002-09-23 Thread Joel Rees

Sure, the thread is somewhat OT, but we all need to think about what
tools we'll use in the future, when the glitz has worn off information
technology.

 I thought one of the real core differences was that it was built with 
 GCC 3.1 instead of the 2.95 branch.

From what I've been reading on openBSD's misc list (among other places)
GCC 3.xx is not handling low-level optimizations very well. GCC 3.1
might, in fact, take part of the blame for the kernel panics.

Trade-offs. You sometimes have to take a step back to move ahead.

 As a developer I'm quite happy to 
 have paid for the new updated tools to be so deeply integrated.  I 
 kinda wish they'd gotten perl 5.8 under the wire, but that wasn't a big 
 deal to install.  There's alot under the hood that really makes it 
 worth the $$$. IMNSHO

Knowing what has had to be done to get Mac OS X running, I am simply in
awe. Okay, not like what I feel towards God or the Grand Canyon, but as
much awe as I can feel towards any of the work of humans. In my POV,
10.2 confirms that Apple recognizes that the corners they cut to get Mac
OS X out the door (just barely) in the market window have to be filled
in.

Anyway, I'm buying Jaguar this week or next month, as my budget will
handle it. .mac doesn't fit my budget. I've been half expecting .mac to
go for-pay, so I never used the .mac addresses for more than spam
buffering. (Accessed the google newsgroups from the .mac address, and I
was spending too much time on that anyway.)

What would induce me to keep the .mac account? If my budget were in better
condition, I'd probably keep it, although I don't really use anything
but the e-mail. (Could they separate the e-mail?) 

I already have a provider, and their rates are kept reasonable.
The provider serves my regular personal mail address, so I need
something to motivate a switch. If .mac were JPY 10,000 a year,
including a 56K modem point of access (15+ hours, in Japan), I'd
consider switching. If the 10 yen for three minutes telephone connect
time were also included, or if it were JPY 20,000 for ADSL, I'd
seriously consider it.

I do think they ought to have a free minimal .mac account, e-mail and a
small iDisk, one per valid serial number, with all new machines, valid
for the duration of the warranty/service agreement. That would probably
sell more AppleCare, too.

But what I would really like, and if Apple were to include it with their
basic .mac, it would be a huge selling point, is a spam-trapping
news-group-view mail address server/mail browser -- an address for
public use with a browser that would do things like showing the
send/reply sequence in tree form the way it shows on newsgroups, would
sort mail by sender and subject line, would download an index list of
topic lines and senders on demand (so I could delete without having to
wait for the whole body to download), and where the server would send an
automatic response to any mail that did not match the accept filter.

Anybody know of work on mail server scripts that would support this kind
of thing?

Of course, where this all has to eventually head is that your phone will
become your mail server.

-- 
Joel Rees [EMAIL PROTECTED]




Re: question on ssh and peeve on editors

2002-10-03 Thread Joel Rees

Puneet opined 

 the truth is that it is _primarily_ a wysiwig html 
 editor... but if you were to think of it as a web application 
 development IDE... then it would make sense to offer some basic 
 scripting support (which it does, except not for perl), or a darn good 
 integration with a (or several) external editors.

I don't know much about templates, and I like GoLive, in concept,
especially now that 300 MHz processors are considered slow. (First
experience with GoLive was the pre-Adobe days on an, erm, LC 630.
Speaking of which, anyone know a place in the Hanshin (Osaka -- Kobe)
area to get a non-buggy 68040 cheap? I still have one of those boxes,
and I want to dual-boot openBSD on it.) 

But I found that what I usually did was design the page, grab the design
elements, and paste them into the real page. That is, I left GoLive
behind and used a straight text editor once the design work was done. 
(Used CodeWarrior's editor since it was pretty stable with shift-JIS and
handled the various flavors of line-endings for me. I like BBEdit, too.)

General-purpose WYSIWYG editors for XML are still a little bit ahead of
us on the software technology curve.

Say, my company is training a large group of us on Struts (Java -- Jakarta).
Anyone know of a comparable project with Perl, i. e., a framework that
would allow separating the business model and control logic out of the
view?

-- 
Joel Rees [EMAIL PROTECTED]




OT Java pseudo-benchmark (was Re: What up with the mac)

2002-10-10 Thread Joel Rees

Okay, here's the Java program I was talking about, since someone might
want it and I'm going to be off-list for a while:

-begin code
/**
 * Let's try the Factorial in BigInteger
 *
 * @author Joel Rees, Altech Corporation, Esaka, Japan
 * Copyright September 2002
 * May be copied, modified, and/or used freely.
 * No warranty. Use at your own risk.
 *
 * @version 0.1
 */


import java.lang.Class;
import java.math.BigInteger;


public class BigFactorial 
{
public static void main( String[] args )
{   if ( ( args.length  1 ) || ( args[ 0 ].charAt( 0 ) == '-' ) )
{   System.out.println( Usage:  
/* Okay, this is ridiculous. */
+ BigFactorial.class.getName() 
+  integer {, integer } );
}
else
{   for ( int i = 0; i  args.length; ++i )
{   BigInteger input = new BigInteger( args[ i ] );
System.out.println( 
(
+ input.toString() 
+ )! ==  + factorial( input ).toString() );
}
}
}


/* Let's not try to blow the stack with the old 
 * forced example of recursion, at any rate.
*/
public static BigInteger factorial( BigInteger n )
{   if ( n.compareTo( BigInteger.ZERO )  0 )
{   return new BigInteger( 0 );
}
BigInteger result = new BigInteger( 1 );
while ( n.compareTo( BigInteger.ONE )  0 )
{   result = result.multiply( n );
n = n.subtract( BigInteger.ONE );
}
return result;
}
}

--end code-

Should be easy to re-write in Perl.

-- 
Joel Rees [EMAIL PROTECTED]




Re: CPAN Jaguar

2003-02-09 Thread Joel Rees
 mrsparkle ellem ~ $ perl -v
 This is perl, v5.6.0 built for darwin
 
 
 I have loaded FINK
 
 CPAN is acting funny.  Actually it isn't doing anything.  I get a lot of this:

You have run CPAN before, right?

 cpan install Mail::Sendmail
 
   Please, install Net::FTP as soon as possible. CPAN.pm installs it for you
   if you just type
   install Bundle::libnet
 
 
   Please, install Net::FTP as soon as possible. CPAN.pm installs it for you
   if you just type
   install Bundle::libnet
 
 
   Please, install Net::FTP as soon as possible. CPAN.pm installs it for you
   if you just type
   install Bundle::libnet
 +++
 
 cpan install Bundle::libnet
 Can't install Bundle::libnet, don't have an associated bundle file. :-(
  at /System/Library/Perl/CPAN.pm line 1806
 
 
 
 any ideas?

Looks to me like FINK walked on wherever you put your configuration info
for CPAN. You'll probably need to re-configure CPAN, at minimum.

Anyone successfully using CPAN and FINK together?

-- 
Joel Rees [EMAIL PROTECTED]




Re: [MacPerl] Re: problem with Japanese text

2003-03-27 Thread Joel Rees
Not sure if my comments are relevant, just feeling inclined to expose my
ignorance --

 Character set difficulties are still a real problem, but so is dynamic
 text.  Damian Conway's paper
 
An Algorithmic Approach to English Pluralization
http://www.csse.monash.edu.au/~damian/papers/HTML/Plurals.html
 
 contains some fairly complicated tools for generating dynamically-
 pluralized English.  Now generalize that tool set for multiple
 languages and/or more complex variations.  Right.

Japanese is one of those languages that has relatively few specifically
plural forms. To get the pluralizations right in Japanese, the program
would have to consult a dictionary.

 In my current work, I am generating user-specific explanations for the
 permission and ownership information in (roughly) an ls -al listing.
 That is, the user gets three paragraphs, saying (a) what the effect of
 these permissions is on the user, (b) how this was derived, and (c)
 what the item's permissions are, as a whole. 

I see the reason for the interest in automatic pluralization there.

Pluralization could probably be ignored for this purpose for Japanese,
but, if the purpose is to produce text that the technically un-inclined
can parse reasonably effortlessly, there are all sorts of other context
related issues, most of which would require not just vocabulary
dictionaries, but idiom dictionaries as well. And your locale machinery would
have to include some sensitivity to dialect issues and social status
issues, to make the generated text natural and non-offending.

Japanese is becoming more egalitarian, more homogenized, and less
colorful, so those who work on such things are aiming at a moving target.

Thinking about the recognizer side, did anyone mention that Japanese
text does not use word delimiters? Space has a somewhat different
meaning for Japanese.

-- 
Joel Rees [EMAIL PROTECTED]



[OT] Re: [MacPerl] Re: problem with Japanese text

2003-03-30 Thread Joel Rees
 ... In English the singular nominative pronoun is nothing but I, 
 no matter how old or young you are or whether you are a boy or a girl 
 (or a computer).  But in Japanese it can be Watashi or Boku or 
 Ore 

Boku. Hmm. What would it mean if an educational program intended for
kindergarten use said Boku no shippai desu ka?

 ...

 Well, 
 the total richness of Japanese is I believe is increasing but 
 ironically per-capita richness might not be.  But I believe this 
 phenomenon is not unique to Japanese; could be even more prevalent in 
 English.  If you don't believe me just compare the Two Bushes in White 
 House :)

Heh. West Texas is a country and a language to itself. 

-- 
Joel Rees [EMAIL PROTECTED]
(Amusing myself by imagining the elder bush saying Kwansai and the
younger saying Kansai. Not sure I could imagine the old guy saying
tefu-tefu, though.)



Re: OT: looking for the relevant list

2003-04-02 Thread Joel Rees
 Suppose one has a question about compiling some (perl-unrelated) c code 
 (originally developed on linux) on os x, is there a list where it would 
 be appropriate to pose this kind of question?

If you can subscribe to newsgroups, or if you can bear the time delay on
groups.google.com, you might try 

comp.lang.c

or 

comp.lang.c.moderated

Google requires you to register, but it's free. The big drag is that in
the three or more hours it takes to see your question posted, you
usually either solve the problem yourself or lose interest. But it's a
high-volume list, so, if you subscribe, you'll want a newsreader, or
you'll want to set filters for you mail reader.

-- 
Joel Rees [EMAIL PROTECTED]



Re: [OT] Japanese

2003-06-16 Thread Joel Rees
 I ask only because it came up here before and I can find nothing online about
 it...
 
 I'm trying to do some things in japanese on my OSX box, unfortuanately my
 japanese isn't terribly good so any help info on my computer is minimally
 helpful. My biggest question is how to get garbled text like
 deg.TMGDBdeg.$D9$BBdeg.$D9deg.$E9deg.$D9-$DA$F5 back into the form of
 kanji/kana. My next question is where there's a good online FAQ site for doing
 japanese on OSX or finding OSX programs that accept Japenese (unicode?).

I couldn't even guess where to tell you to start, except for google.
(Google is a great tool.)

The text there looks kind of like it might be some ASCII visible
encoding of euc-JIS, but I am not going to take time to test the
hypothesis. Where did you get it? If it's from a web browser, you can
try selecting a different encoding. (OmniWeb 4.1 requires you change the
default in preferences and then re-load the page.)

I'm thinking there are good tools to work with that kind of text in Perl
5.8 (also the jcode module in previous versions), but there are people
around here better qualified than I to tell you how. 

There were some good pages mentioned here several months ago, so you
might search the archives. Or search the web for things like CJK, euc
encoding, shift-JIS, tron characters, etc.

-- 
Joel Rees [EMAIL PROTECTED]



Re: [OT] Japanese

2003-06-16 Thread Joel Rees
 I type in Japanese in textedit, mail and project builder without 
 difficulty.

I find I've had to fuss a bit with Project Builder's editor. Most of the
docs, source, etc., I see are encoded in shift-JIS, but I haven't yet
found a way to tell the PB editor what encoding to assume when opening a
file. I have been able to figure out that it seems to pick up the byte
order mark or something for UTF-16 (which surprised me). And it seems to
require UTF-8 for compiling in C. 

(Maybe I should download the new version of the dev tools. I don't have
the room on my vintage iBook's 5.6G drive, but I think Apple said the
bulk of the documentation didn't have to be on the boot volume.)

But I can tell Text Edit what encoding to assume and then save as UTF-8
or UTF-16, so there's a work-around.

Unfortunately, that's not going to help the OP, near as I can tell. Do
you recognize his deg.TMGDBdeg.$D9$BBdeg.$D9deg.$E9deg.$D9-$DA$F5?

 Have you set the language and the script in the 
 international System preference? 

I like to have several users, each with different language and script
settings. (Family account set to Japanese, of course.) I also find it
convenient to have multiple scripts selectable, and the precedence
defaults are pretty handy, as well.

-- 
Joel Rees [EMAIL PROTECTED]



Re: [OT] Japanese

2003-06-17 Thread Joel Rees
 Editors I use a lot.
 
 Jedit, Java editor.

I've got to try that some time.

   www.jedit.org
   It is extremely good at setting default encodings, changing file 
 encoding (batch mode, too) on the fly, et cetera.
 
 Mi, great text editor from Japanese author
   http://www.asahi-net.or.jp/~gf6d-kmym/en/mimi/index.html

Mac OS X. Looks interesting.

   http://www.asahi-net.or.jp/~gf6d-kmym/mimi/index.html
 
 VIM...well, not great at Japanese.  But an lovely editor.  Just had to 
 add it here.  Works great in X11 on OS X, too! ;)

Use it in freeBSD, trying to get it set up for openBSD, having trouble
with Wnn and onew, because the groff (ja-groff) port is not where the
obsd port seems to think it should be. While I'm definitely glad to have
it for fBSD and oBSD, I have trouble motivating myself to use it on Mac
OS X. I'm a little spoiled, perhaps. (Hmm. Might be interesting to try
MIFES under emulation on obsd/fbsd. It isn't free, of course. Come to
think of it, I should get Java up under emulation and try Jedit first.)

I haven't tried the editor in the latest Metrowerks Codewarrior, but
it's always been natural for me. No character set tools, however. The
color-coding would get out of sync in shift-JIS strings (for reasons
that those who work regularly with shift-JIS know and appreciate). 

BBEdit is what spoiled me on the Mac, by the way.

But none of that addresses the OP's garbled string of something
I was thinking looked like euc-JIS transmorgrified into some visible
hexadecimal display form --

deg.TMGDBdeg.$D9$BBdeg.$D9deg.$E9deg.$D9-$DA$F5

Where have I seen that before? It just doesn't make any sense at all as
any JIS in a visible hexadecimal form. Maybe it's just raw, untouched,
straight JIS, with no escapes.

-- 
Joel Rees [EMAIL PROTECTED]



Re: [OT] Japanese

2003-06-17 Thread Joel Rees
 deg.TMGDBdeg.$D9$BBdeg.$D9deg.$E9deg.$D9-$DA$F5
 
 Where have I seen that before? It just doesn't make any sense at all as
 any JIS in a visible hexadecimal form. Maybe it's just raw, untouched,
 straight JIS, with no escapes.

Nope. Not even straight JIS with the escapes being munged to periods. 
(Tried opening it with an editor that understands straight JIS.)

-- 
Joel Rees [EMAIL PROTECTED]



Re: [OT] Japanese

2003-06-17 Thread Joel Rees
(Replying to myself again, but just for the record, ...)

  VIM...well, not great at Japanese.  But an lovely editor.  Just had to 
  add it here.  Works great in X11 on OS X, too! ;)
 
 Use it in freeBSD, trying to get it set up for openBSD,

jvim. It would not make sense to use vim with Wnn and onew.

With freeBSD, jvim/Wnn does fairly well, behaves like I would expect vi
to behave with Japanese. It does flake out at times, however. I'll know
more about how they work on openBSD today, I suppose.

One of these days, I'll have to talk my employer into letting me use a
Mac at work.

-- 
Joel Rees [EMAIL PROTECTED]



Re: [OT] Japanese (correction about Mail)

2003-06-23 Thread Joel Rees
I took another look at some garbled spam I seem to be picking up
regularly, which I had mistakenly assumed to be from a Korean source,
and it looks like Apple's mail app in 10.2.4 is _not_ handling 7-bit JIS
correctly. More later.

But, while I was checking that, I checked the following:

 I managed to find the kanji I asked the person about with the charecter palette
 description she gave, but it was or could be described otherwise as: Unicode
 5782, JIS(X0213) 1-31-66, Shift JIS(X0208) 9082: 

tarasu/tareru (hang down)

 and it was mojibake'ed as
 ($BEZ(B)

That kind of looks like seven-bit JIS. The $B is a piece of a control
sequence when mixing 7-bit JIS with 7-bit ANSI.

EZ is the 7-bit JIS for tsuchi (earth, dirt). And BE is 7-bit JIS for
the da in datou (valid). Nope. Something else happened to that.

 Some other codes she sent, and hence probably in the same encoding,
 were $B7V(B and $Bj%(B both for hotaru.

7V is the 7-bit JIS for hotaru (firefly). j% is 7-bit JIS for a more
traditional rendering of hotaru.

Here's the meat of the source of a C tool I wrote to check:
-
for ( i = 0; i  kTermWidth - 1; i += 2 )
{   unsigned long byte1 = (unsigned char) buf[ i ] - 0x21;  /* kuten */
unsigned long byte2 = (unsigned char) buf[ i + 1 ] - 0x21;  /* 
kuten */
if ( byte1 == '\0' )
break;
byte2 += 0x40;
if ( ( byte1  1 ) == 1 )
byte2 += 94;
if ( byte2  0x7e )
++byte2;
byte1 = 1;
byte1 += 0x81;
if ( byte1  0x9f )
byte1 += 0x40;
buf[ i ] = (char) byte1;
buf[ i + 1 ] = (char) byte2;
}
buf[ kTermWidth ] = '\0';   /* training wheels */
-

(Yeah, C comes more natural to me than perl. Especially for this kind of
stuff. So shoot me.) It's missing the escape sequence and end-of-line
handling, among other things, but may be amusing to those interested in
the relationship between 7-bit JIS and shift-JIS.

 
 some other strings are:
 a$EAaD (this is the one I could decode)

Weird. All I can read out of that is kilogram told hits. Or, maybe just
the character hayai (early)?

 $B0T$B0U$B0Gndc

Who's meaningful dark? Or perhaps the saba fish in the crucible?

Anyway, they _look_ sort of like 7-bit JIS, and the two you came up with
for hotaru are, in fact, 7-bit JIS for hotaru.

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp



Re: [OT] Japanese

2003-06-23 Thread Joel Rees
 On Wednesday, Jun 18, 2003, at 20:01 Asia/Tokyo, Joel Rees wrote:
 
  (I'm still trying to decipher what they've done with the file system,
  and still trying to figure out how to get the terminal app to show the
  Japanese names for files. My brother in law has a book that shows a way
  that is supposed to even get it to show shift-JIS file names correctly
  in the terminal app, but I haven't got it to work on my iBook yet.)
 
 See Japanese in OS X 10.2 Terminal (in Japanese)
 http://member.nifty.ne.jp/poseidon/osx2t.html

Good information there. Thanks. I'd tried using escapes to type in file
names, but I did something wrong.

 File names in OS X are encoded in UTF-8 decomposition form. I.e.  
 U+30C0: KATAKANA LETTER DA is represented as 0xE382BF (U+30BF) followed  
 by 0xE38299 (U+3099).

Decomposed. ta+dakuten. Okay, knowing Apple is de-composing the kana
will be useful.

 UTF-8 aware tcsh is available as
 ftp://ftp.tba.org.tohoku.ac.jp/pub/tcsh-6.12-bin.tgz
 
 If you need install instructions in English, please see my posting to  
 another list.
 http://listserv.dartmouth.edu/scripts/ 
 wa.exe?A2=ind0306L=nisusT=0F=S=P=40940
 
  (Of course, this is all off topic unless somebody wants to come up with
  some perl code for trying to undo garbled file names.)
 
 It's not a perl script, but nkf -- Network Kanji code conversion Filter  
 -- is able to guess Japanese encodings and to restore broken JIS-Kanji.  

Well, I knew nkf was good for conversions, but I've never tried using it to
to fix really broken text. ;)

Actually, I was thinking more in terms of some code snippets that could
be useful in recovering text that had suffered serious damage in a
broken conversion pipeline.

 The garbled text in the original poster's message does not seem to be  
 Japanese though.

It looks like it didn't survive e-mailing. It looks like 7bit JIS, but
converting down doesn't produce much that makes sense, as you say. The
conversion that worked for hotaru is bad news, because it tends to
indicate some serious non-deterministic behavior in the broken pipe. 

 nkf is available as a part of jx package -- Japanese  
 aware Unix tools for OS X.
 http://www.fan.gr.jp/~sakai/jx.html
 
 BTW there are free text editors which autodetect Japanese encodings  
 properly in most cases.

 CocoaEditorJ (seems to be discontinued)
 http://cocoedit.hp.infoseek.co.jp/
 http://cocoedit.hp.infoseek.co.jp/CocoaEditorJ.dmg (binary)
 http://cocoedit.hp.infoseek.co.jp/CocoaEditorJSource.dmg (source)
 
 KEdit (syntax colouring for perl, php, html)
 http://www.drycarbon.com/macosx/kedit/
 http://www.drycarbon.com/macosx/archive/kedit010-20030619.zip (binary  
 and source)
 
 Dunno if they would help you in making money though ;-)

Heh.

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp



Re: Japanese + Encode::Guess

2003-06-25 Thread Joel Rees
 Thanks for your help Dan, but I'm mo further forward, the answer is 
 apparently 'ascii', which is puzzling, because but the content is not 
 ASCII - it is still legible in a web browser as it was written 
 originally so the data is still intact.
 
 I'm guessing that Encode::Guess tests the beginning of the file to see 
 what it contains, which being a HTML doc would have characters within 
 the ASCII range?

Thus, UTF-8, shift-JIS, or euc-JIS? 

Even 7-bit JIS apparently tends to be mixed with ASCII, so if your first
n characters are nothing but ASCII, the guess is ASCII? 

Is there a parameter to force the sample length?

(For five brief seconds, I was thinking about the value of randomizing
the starting point for samples. :*/ )

 On Wednesday, June 25, 2003, at 02:04  am, Dan Kogai wrote:
 
  print $enc-name;

And it was a good thing he responded, because I was going to take a
closer look at this tomorrow. (Thanks, Dan!)

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp



Re: [OT] Japanese (correction about Mail)

2003-07-07 Thread Joel Rees
 I took another look at some garbled spam I seem to be picking up
 regularly, which I had mistakenly assumed to be from a Korean source,
 and it looks like Apple's mail app in 10.2.4 is _not_ handling 7-bit JIS
 correctly. More later.

rant
Crud. I have some resume pages that I _know_ are shift JIS (looked at
the byte values with hexdump), but Metrowerks Codewarrior 5 editor is
won't play fair with them. Apparently, the pages I'm working with are
ones which I pulled back off the web (stripping the resource fork) and
edited with something that did not leave a traditional resource fork,
but whatever the Mac OS X file system is using instead of a resource
fork.

Haven't had time to pin things down, but Mac OS X's Text Edit utility
and the OS are playing strange guessing games on me, and the result is
that, even with Classic booted and CW 5 set to the Osaka font, what it's
showing me is as if the text were Mac (Latin) 8 bit.

Pages which do not have the incontinuity of going to the web and back
again are showing just fine. And Text Edit, when I save, adds another 8K
to the file, just because I changed the encoding on the save. Four
changes and 900 bytes of text is now 40K.

Whoever convinced the architects for the Mac OS X utilities and OS to
insist on converting the encoding when I just want to change the
interpretation, I'd like to have a little heart-to-heart with.
Converting should be NOT be under the Format menu in the editor in the
dev tools. If Save As is not enough, we need another menu. What's
under Format should only change the interpretion of the byte values.

I'll post an update on the interactions in a day or two, unless someone
throws a red flag about topicality. Maybe I'll be a bit more rational,
too.
/rant

-- 
Joel, muttering Japanese expletives while wandering over to the Mac OS X
bug reporting pages, if they are still there.



[OT] backslash when working with Japanese (Re: Pantherbites)

2003-07-25 Thread Joel Rees
 * input method is a mess!  I like the old one ("disintegrated") better.
(B
(BYeah, I think the IM is going backwards as much as forwards, myself.
(B
(B * took 15 minutes to find how to enter '\' (backslash) instead of $B!W!"(B 
(B (yen) ONCE Kotoeri is enabled.  Once Kotoeri is enabled, '\' key 
(B refuses to backslash and yens yens yens!  Solution: Add "US Extended" 
(B via [Input Menu] tab of [International] Preference Panel and use it.
(B
(BI was able to get the backslash in the Project Builder editor in Jaguar
(Busing the option key on the yen key or the forward slash key, I don't
(Bremember which and I didn't bring my iBook to work today. Do any of
(Bthose key combinations work? (I'll try to remember to check that tonight.)
(B
(B-- 
(BJoel Rees, programmer, Kansai Systems Group
(BAltech Corporation (Alpsgiken), Osaka, Japan
(Bhttp://www.alpsgiken.co.jp

Re: japanese in regular expressions possible?

2003-08-15 Thread Joel Rees
This script then behaves as I would expect:

#!/usr/bin/perl
no warnings ;
$f = $ENV{HOME}/Desktop/biao.txt ; # file saved as UTF-8
open F, $f or die $! ;
$/ = \015 ; # only if the file has Mac line endings !!!
print \x{8868}\n\n; # prints the character as utf-8
for (F) {
  print 1.   $_ if /Ë°®/ ;
  print 2.   $_ if /\xE8\xA1\xA8/ ;
}
Note that if you write   use utf8;  it will NOT work
 Thanks, John

I'll give it a try, soon as I can get 5.8 installed on my iBook. 
(Running short of disk space, so I've been putting it off.)

Joel (at home)


testing my rules, please wink at this and move on

2003-08-15 Thread Joel Rees
Now why'd you look?



Re: [OT] OSX privileges question

2003-09-24 Thread Joel Rees
 So I've been put in charge of setting up and
 maintaining our department's new dispatch/switchboard
 computer. In trying to keep it clean and in order, I
 was hoping, if possible, to be able to give users
 read/write access to information in files themselves,
 but to block them from renaming the files or moving
 them.
 
 I tried giving r-x access to a folder and rwx access
 to the file inside. This lets them open the file and
 prohibits them from moving/renaming it, but prohibits
 them from saving any changes (because they can't write
 to the folder).

That sure isn't the way I understand it. I'll check when I get a chance
whether that's the effect on Mac OS X. Are you trying to use the GUI
File Info interface from Finder, instead of chmod/chown, perhaps?

I've found it handy to set up dummy users and empty groups. Some
careful thought will often yield the functionality you need. For
instance, the first thing I might try (if I understand your question
correctly) is to set up an empty group called deptA with netinfo,
dummy user called deptA, complete with a file heirarchy under /Users, 

BTW, /etc/groups is ignored after Mac OS X goes multi. You'll need to
add users to groups other than their primary group through the
Netinfo Manager utility. (GUI access in the utilities folder.)

-- 
Joel Rees, programmer, Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp
--

When software is patentable, anything is patentable. 
(http://swpat.ffii.org)



Re: Weird math...

2003-10-14 Thread Joel Rees
 Fixed-point math (generally with 4
 decimal places and an implied decimal point on a 32 or 64 bit integer) is
 more appropriate in those cases.

Math::BigFloat, perhaps?




Re: Looking for old laptop/notebook

2003-11-11 Thread Joel Rees
drieux,

(Sorry about taking so long to respond -- further follow-ups off list, 
of course.)

On 2003.11.9, at 05:15  AM, drieux wrote:



Begin forwarded message:

does anybody know how to make Hypercard run on System 9 or X?
I've been running a few hypercard apps on Mac OS 9 and X without much
problem. Of course, they aren't complicated apps, and I had to disable 
an
XCMD on one to run it.

does anyone here have a good pointer on how to get
old style Hypercard stuff running on OSX? a friend
of mine in the UK was wondering. The stuff works
under the older Apple 8.5 but apparently not
in 9 or OSX.
If there are problems, my first guess would be that the apps require 
XCMDs
and/or XFCNs (or whatever those were) that were written to an API that 
no
longer exists.

If that's the case, he'll probably either need to get the source code 
for those
and port them, or simply run them on an older system.

Depending on how vital the old hypercard apps are, and the difficulty of
getting the source code or porting them, or of getting old hardware 
that is
fast enough and dependable enough, he might want to look into Mac-on-
Linux: Buy a new Mac, wipe Mac OS X, install Linux, install MOL on 
that, install
the older system on top of that. It should work. (YMMV) Since the 
emulation
is API-level only, they should run at native speed. It would be nice if 
the
Linux API emulation layer ran on Darwin, or if MOL ran native on Darwin,
but I don't believe either of those have been done yet.

One other thing to look into if he finds himself getting into porting 
(besides
Perl, of course) --

Runtime Revolution (which has bought the Metacard engine technology)
maintains a high level of compatibility with Hypercard. Metacard/RunRev
has an additional advantage of being cross-platform. I think I've also 
heard
that Supercard has been updated to Mac OS X, but I'm not sure.

HTH

Joel



Re: searching complex datastructures

2003-12-11 Thread Joel Rees
Can anyone offer an elegant solution for a data structure that 
maintains
sorted order as well as access to data for a (primary) key?
Is everyone thinking too hard or am I not thinking hard enough?

If you have a database and you need to search it on an alternate key, 
you either linear search on the alternate key or define the alternate 
key formally in the database as an alternate key. Defining an alternate 
key is just setting up a reverse-lookup index table. (Conceptually.)

So, if you don't want to linear search, and you don't want to build a 
reverse-lookup hash, your usual option would be to build something that 
works as an alternative way to reverse-lookup, say a binary tree or a 
trie or even a linear sorted array to do a binary search on. Right?

Deciding between the various alternatives is just weighing the cost of 
each approach, and deciding which cost you can afford best. Right?

I guess I just don't understand the thread.

reiisi



Re: get contents from clipboard

2003-12-14 Thread Joel Rees
On 2003.12.15, at 07:10  AM, John Delacour wrote:

At 5:01 pm +0900 11/12/03, Robin wrote:
late in on this one but you can treat the clipboard as a filehandle 
if you pipe to pbpaste and pbcopy :

open (FROM_CLIPBOARD, pbpaste|);
open (TO_CLIPBOARD, |pbcopy);
you can then do as you normally would for moving data to and from fle 
handles. See the typically useful-in-a-real-world-situation example 
script below
So far as I can see there is no way to use this useful technique with 
a clipboard containing Unicode text, for example Chinese or Greek text 
copied from TextEdit. Am I right?
Why do you think it won't work? Is there some irreversible munge 
applied to the pipes or the clipboard? Or is it the guessing game about 
being sure it was Unicode text?

reiisi



Re: DBD mysql unable to install since Panther

2004-01-30 Thread Joel Rees
Thanks everyone.  The developer tools I installed is the
developer tools from Jaguar.  I don't have the Panther
developer tools.  But I will get it.
Is there an easy place to buy the tools from?  Apple
seems to want to sign me up as a developer, etc.
If you don't mind the agreement they make you sign, it's definitely 
worth signing up. You pretty much have to sign that thing anyway, 
whether you download the developer tools or install from the system.

If you own Panther, you should have them already.
It's an optional install. Run your installer and customize the install.
You'll have to go to the applications folder and dig into a folder 
called something like installers.

Then go to Apple's site and get the XCode update 1.1. Maybe it's also 
accessible via Software Update.
It is.



Re: Soliciting opinions from Applescript refugees

2004-02-28 Thread Joel Rees
On 2004/02/28, at 0:08, Chap Harrison wrote:

... and I wonder why some people swear by Applescript.  I think it may 
be from inexperience.
Yours or theirs?

(heh.)

As has been pointed out, FileMaker is still more of a RAD tool than a 
solutions tool, and AppleScript also. Precision in a language is a 
requirement in contradiction with ambiguity, ergo, flexibility.

I think a large part of Perl's success is the ability to go from a 
relatively flexible syntax to a relatively precise syntax within the 
same language. (As opposed to Java, for example, where precision can't 
be escaped, but is relatively uncluttered by language artifacts, or 
SQL, where you have to escape the language to get precision in all but 
a few business contexts.)

I think I agree with John and Doug, your best approach is to expect to 
use multiple tools, which is why mailing lists are useful.



Re: Web servers with cable DSL

2004-03-16 Thread Joel Rees
On 2004/03/16, at 11:13, Bill Stephenson wrote:

I was wondering if anyone here is using a MacOS X box with a fixed IP 
cable DSL account
Cable with fixed IP? Does it exist?

My current US Cable provider told me I could do static IP if I put my 
own router between the cable modem and my internal network, but the 
sales rep was apparently talking about the internal-only ranges. Their 
license proscribes published static IP.

For similar pricing, I could have got full support for published static 
IP through phone company (A)DSL.

In Japan, I have ADSL (1M) broadband over telephone, renting a full 
configurable modem/router, for just under half of what the stateside 
cable company is asking for a similar setup.

as a commercial grade web server?
Don't know, but, if you really can get your cable company to let you 
use fixed IP, such a setup should be about as good as a similarly 
outfitted Linux or FreeBSD system. Well, plus or minus a bit, depending 
on what server software and modules you're using, of course.

If you go ADSL, your visitors' download rate is limited by your upload 
rate, of course.

 Is this a reasonable alternative to using a hosting company like 
Verio?
I haven't tried it yet, I'm kind of planning on something like this 
working for me. I have heard some success stories with openBSD, but I 
haven't been hanging around where I'd hear about such things on Mac OS 
X.

I could sure save some cash by switching to this set-up but I have 
concerns about performance and reliability.
So does your ISP, of course. That's why they want to sell you something 
quite a bit more expensive, instead.

Will DSL provide enough bandwidth to 2-5000 visitors a day for web 
sites that serve standard HTML and web graphics? (ie. no broadband 
media like video, mp3, or other streaming media formats)
When's rush hour?

Any help and advice will be much appreciated.
I'd like to hear someone else's experience, too. (Before I try it 
myself, I mean. First, I'm going to try dynamic DNS, I think.)

Joel



Re: Web servers with cable DSL

2004-03-16 Thread Joel Rees
On 2004/03/16, at 12:29, Chris Devers wrote:

On Tue, 16 Mar 2004, Morbus Iff wrote:

Please don't make the web a world of Geocities.
On the other hand, it has always kind of bugged me that having a fully
functional web server out of the box isn't seen as a normal part of 
having
interenet access, or more simply, a network connection.
One day, when Microsoft quits sucking the money and bandwidth out of 
the internet, phone service will come with hosted web sites, with the 
option of hosting our own, in much the same way that we currently have 
answering services and answering machines.

I guess that 'll make it a sort of world of geocities minus the ads, 
lusers, l33tz, and exploits. And google will run the yellow pages.

WIBG



[OT] Re: Web servers with cable DSL

2004-03-17 Thread Joel Rees
On 2004/03/17, at 11:29, Bill Stephenson wrote:

Well,

I think that Kevin (morbus) really did a good job of pointing out why 
I can't entirely do this yet. Some of the sites I host are critical to 
the businesses that use them and Verio has always provided a great 
service. Because they host on FreeBSD, developing on the Mac and 
porting to Verio is almost seamless even though Verio has never done 
anything special to accommodate this.

However, the fact that so many on this list are hosting sites with 
cable DSL indicates that I can possibly move some of the sites I host 
to a home office based server and still save a little money. I'll 
spend some time reviewing the sites and costs and see how the numbers 
crunch.
(I noticed with a certain amount of surprise that Verio seems to have 
merged with NTT Communications, which is not Nippon Telephone and 
Telegraph, but used to be a daughter company of the Japanese national 
telco before Japan decided to pursue the competition path like the US 
has.)

I was surprised recently to notice that my local telco is now offering 
a really stripped-down 256K line with no-frills (no mail, no web space) 
ISP for about $22 a month, and static IP addresses for fairly 
reasonable.

What about using http://directv.direcway.com/ to host servers? Anyone 
doing that?
Says you need a clear southern exposure. I'd wonder about trees and 
cloudy days, too. And I didn't see anything about the download/upload 
differential, but my memory is its about the same as cable.



[OT] slice vs. splice

2004-04-16 Thread Joel Rees
slice syntax  isn't deprecated or anything is it? Don't see it 
mentioned in O'Reilly's Nutshell or in the Cookbook's section on arrays.

(Sorry about the not-really-topical noise.)



Suggested version for Mac OS X.2?

2004-04-16 Thread Joel Rees
Gah! That's what I get for using comments! ;-)
Darn right, stop that! Code is hard to write, it should be hard to  
read, too! ;-)
 8-)

That's what I like about perl.

Anyway, I'm aware that slice is not a function, just surprised that  
neither the concept nor the syntax seems to get any treatment in either  
Nutshell 1st Ed. or Cookbook 2nd Ed.. (I don't own the Camel, just went  
straight from the Llama to Nutshell. Thought I was saving money at the  
time.)

Well, according to the blding edge Perl 5.8.4-rc2 docs:

http://search.cpan.org/~nwclark/perl-5.8.4-RC2/pod/ 
perldata.pod#Slices
Thanks for the pointer, merlyn.

So, I'm wondering about that version number. 5.8.1 is still the latest  
stable Perl, right?

Joel



Re: Suggested version for Mac OS X.2?

2004-04-16 Thread Joel Rees
So, I'm wondering about that version number. 5.8.1 is still the 
latest stable Perl, right?
No, 5.8.3 is the latest.
And 5.8.4 will likely be out within a week.
So, given an iBook that is going to host my personal site, should I 
load 5.8.3 parallel to the the 5.6 in Mac OS 10.2, or should I stick 
with 5.8.1?

(Purpose of the parallel load is to keep the one used by the system 
more-or-less pristine, of course. Purpose of 5.8 is Unicode and large 
character sets.)

Joel



Re: Advice for enabling perl on OSX

2004-04-22 Thread Joel Rees
On 2004.4.22, at 10:59 PM, Eric Curts wrote:

...
I loaded a simple script to just test things out (one that just prints  
out
environment variables) and it will not run.  When I try to bring up the
script I get:
What command line are you using?

Forbidden
You don't have permission to access /hck/cgi-bin/printev.cgi on this  
server.
What permissions do you have on the directory /hck/cgi-bin, the  
directory /hck, and the root directory?

Also, who owns (user and group) the file and each parent directory  
going up?

Since the message is about access, I would expect the problems to be  
something in permissions and user/group. However, I'll add the  
following comments to what the others have said:



--- 
-


Apache/1.3.26 Server at eagle Port 16080

I set the permissions to 755 for the script,
I prefer to use 750, making sure the script is owned by the www group,  
myself. But the looser permissions should give you access, if the  
elements of the path up the line are accessible.

and the folder is web
accessible because html files open up fine from that location.
As has been pointed out, script and hypertext access are set set  
separately. Since you call the directory /hck/cgi-something, I assume  
this directory is for scripts, and you are keeping the scripts and html  
separate. That's good.

But in that case you wouldn't want html files in that directory  
accessible to the web.

 When I make
a terminal connection and try to run the script from the command line,  
it
will not work either.
What's the system's complaint?

I think it may be a more fundamental problem, such as needing to edit
something in their httpd.conf file or needing to enable something else  
on
the server so that perl scripts will be executed.  They have never runs
scripts before, so nothing has every been set up for this.
My memory is that ... . Wait, I have the client version, not the server  
version, so I couldn't say for sure whether the primary script  
directory is enabled in httpd.conf in your case. In any case,  
/hck/cgi-bin is most likely not enabled for scripts. As mentioned, you  
need a section in httpd.conf that looks something like

ScriptAlias /cgi-bin/ /hck/cgi-bin/

Directory /hck/cgi-bin
AllowOverride None
Options None
Order allow,deny
Allow from all
/Directory
to allow access from the web. You'll also may need to set up httpd.conf  
to allow access from the high port. I think a listen line may be  
enough to get you started, although you may have to do more than that  
before you go to production.

I would appreciate any suggestions you have for this problem,  
especially an
idea of what configurations are needed the first time to get an OSX  
server
to execute perl scripts.
Well, read the comments in httpd.conf carefully. We only have vague  
guesses, since we don't know your setup. In case you aren't aware,  
Apple leaves the on-line manual accessible where the apache foundation  
folks were thoughtful enough to put it, at

http://localhost/manual/

Joel Rees



reinventing wheels (was Re: Image::Magick)

2004-04-27 Thread Joel Rees
On 2004.4.28, at 03:58 AM, Chris Devers wrote:

...
Hand-rolling popular software from source is nice and all, but how many
times does the wheel need to be re-invented, ya know? :-)
sherm:
The first wheels were simply logs placed under a sled;
...
We probably shouldn't clutter the list with module requests, so email 
those to me privately, and I'll summarize to the list in a few days.
Like the analogy, Sherm.

(Apologies to Chris Devers and to the list for cluttering it with 
noise, but this thread made me think of a new tag-line.)

--
Joel Rees
If God hadn't meant for us to tweak our source code, He'd've given us 
Microsoft.

;-P



Re: reinventing wheels (was Re: Image::Magick)

2004-04-28 Thread Joel Rees

Joel Rees
If God hadn't meant for us to tweak our source code, He'd've given us 
Microsoft.
Joel,
Don't credit God for this thing.  It is of the devil.
What? You thought I thought God meant for us _not_ to tweak our source 
code?

;-
--
Joel Rees
Opinions are like armpits.
We all have two, they all smell,
and we really don't want the other guy to get rid of his.


LC_ALL for daemons

2004-04-30 Thread Joel Rees
I'm sure I've seen a thread on this, but a casual search didn't turn it 
up. (I'm always looking in the wrong places.)

When I'm logged in as a user, I can set the appropriate environmen 
variables, but when a daemon is running, where is it going to get them?

Joel Rees


comparison always false is a problem or not?

2004-04-30 Thread Joel Rees
My experience is that this kind of thing tends to lead to dead code or 
endless loops. Do I need to dig in and find the macro declaration and 
see if I can fix it?

warning: comparison is always false due to limited range of data 
type

regcomp.c:724
pp_sys.c:302
byterun.c:898
re_comp.c:724
Joel Rees


Re: comparison always false is a problem or not?

2004-04-30 Thread Joel Rees
(BOn 2004.4.30, at 04:38 PM, Sherm Pendley wrote:
(B
(B On Apr 30, 2004, at 2:30 AM, Joel Rees wrote:
(B
(B My experience is that this kind of thing tends to lead to dead code  
(B or endless loops. Do I need to dig in and find the macro declaration  
(B and see if I can fix it?
(B
(B warning: comparison is always false due to limited range of data  
(B type
(B
(B In my own code, I compile with -Wall and try to chase down and  
(B eliminate all warnings. Occasionally I might use a -Wno-something to  
(B turn off a warning once I've determined that it's harmless, but I  
(B really, really prefer to fix them.
(B
(BMe too.
(B
(B I treat other people's code differently. If I'm building something  
(B from source and it emits warnings, I'll make a mental note of that  
(B fact. Then, if it's crashy, buggy, or exhibits some other odd  
(B behavior, I might go back and see if the warnings are relevant to the  
(B problems. If the app works fine though, I don't worry about the  
(B warnings.
(B
(BThat's kind of what I was figuring would do, but I also would prefer  
(Bnot to find my code skipping a parse because the code got thrown out.  
(BSo I thought I'd check.
(B
(B Those file names look familiar - are you building Perl?
(B
(BOf course! (I suppose I should have said so.)
(B
(B  If so, and the self-tests pass,
(B
(BWell, since you're kind enough to ask (heh heh), here's a few more I  
(Bget:
(B
(BIn the make phase,
(B
(B ...
(B cc -flat_namespace -L/usr/local/lib  -o miniperl (J\(B
(B miniperlmain.o opmini.o libperl.a -lm -lc
(B ./miniperl -w -Ilib -MExporter -e '?' || make minitest
(B make: [extra.pods] Error 1 (ignored)
(B ./miniperl -Ilib configpm configpm.tmp
(B sh mv-if-diff configpm.tmp lib/Config.pm
(B ...
(B Making Errno (nonxs)
(B Writing Makefile for Errno
(B ../../miniperl "-I../../lib" "-I../../lib" "-I../../lib"  
(B"-I../../lib" Errno_pm.PL Errno.pm
(B cp Errno.pm ../../lib/Errno.pm
(B make: [extras.make] Error 1 (ignored)
(B
(B Everything is up to date. Type 'make test' to run test  
(Bsuite.
(B
(Band also the range warnings mentioned already. In the make test phase,
(B
(B ...
(B ext/DB_File/t/db-btree...#
(B # This test is known to crash in Mac OS X versions 10.2 (or earlier)
(B # because of the buggy Berkeley DB version included with the OS.
(B #
(B FAILED at test 0
(B ext/DB_File/t/db-hashok
(B ext/DB_File/t/db-recno...#
(B # Some older versions of Berkeley DB version 1 will fail db-recno
(B # tests 61, 63, 64 and 65.
(B ...
(B # You can safely ignore the errors if you're never going to use the
(B ...
(B #
(B FAILED at test 64
(B ext/Devel/DProf/t/DProf..ok
(B ...
(B Failed 2 test scripts out of 804, 99.75% okay.
(B ### Since not all tests were successful, you may want to run some of
(B ...
(B ### Bourne-style shells, like bash, ksh, and zsh, respectively.
(B u=25.78  s=0  cu=599.71  cs=171.77  scripts=804  tests=80310
(B make[2]: *** [_test_tty] Error 1
(B make[1]: *** [_test] Error 2
(B make: *** [test] Error 2
(B
(BIt says I can ignore those, so I did a make install and got
(B
(B...
(B Making Errno (nonxs)
(B make[1]: [extras.make] Error 1 (ignored)
(B
(B Everything is up to date. Type 'make test' to run test  
(Bsuite.
(B if [ -n "" ]; (J\(B
(B then (J\(B
(B cd utils; make compile; (J\(B
(B cd ../x2p; make compile; (J\(B
(B cd ../pod; make compile; (J\(B
(B else :; (J\(B
(B fi
(B ./perl installperl --destdir=
(B WARNING: You've never run 'make test' or some tests failed!  
(B(Installing anyway.)
(B
(Bwhich worried me a little. So I went ahead and ran t/harness after the  
(Binstall completed. (That's backwards, I suppose.):
(B
(B ...
(B op/lex_assign..ok
(B op/lfs.skipped
(B all skipped: writing past 2GB failed: process limits?
(B op/listok
(B ...
(B ../ext/DB_File/t/db-btree..#
(B # This test is known to crash in Mac OS X versions 10.2 (or earlier)
(B # because of the buggy Berkeley DB version included with the OS.
(B #
(B ../ext/DB_File/t/db-btree..dubious
(B Test returned status 0 (wstat 10, 0xa)
(B ../ext/DB_File/t/db-hash...ok
(B ../ext/DB_File/t/db-recno..#
(B # Some older versions of Berkeley DB version 1 will fail db-recno
(B # tests 61, 63, 64 and 65.
(B #
(B # For example Mac OS X 10.2 (or earlier) has such an old
(B ...
(B ../ext/DB_File/t

Re: LC_ALL for daemons

2004-04-30 Thread Joel Rees
On 2004.4.30, at 04:30 PM, Sherm Pendley wrote:
On Apr 30, 2004, at 2:24 AM, Joel Rees wrote:
When I'm logged in as a user, I can set the appropriate environmen 
variables, but when a daemon is running, where is it going to get 
them?
Daemons are started from scripts found in /System/Library/StartupItems 
(for Apple-provided daemons), or /Library/StartupItems (for your own).

Startup scripts usually include /etc/rc.common, so if you want to 
export an env variable for *all* daemons, that would be a good place 
to do it. Be aware that /etc/rc.common is a system file though; 
Apple-supplied OS updates might overwrite it, so keep a backup just in 
case.
Thanks. I needed that information, because I had forgotten that Mac OS 
X doesn't use the rc/* convention. Don't look like there are any hooks 
for an rc.local. An rc script for the daemon would be handy for setting 
an environment variable.

Hmm. There are plists in those startup items. I wonder if I can pervert 
those. Time to dig out my copy of in-a-nutshell and see if there are 
enought clues there.

If you're writing a daemon,
Well, I'm still vacillating between a cron job and a daemon. I'm 
writing my own update tool for dynamic dns for the experience. (My ISP 
wants $60 a month for one static IP.) It'll screen-scrape the 
router/modem's setup pages for some Japanese text. I'm sure I could 
modify somebody else's script, but I have this cowboy mentality, at 
least until I learn how to read Perl for meaning instead of just 
function.

you might also want to be aware of /etc/hostconfig.
Yeah, I needed to look in there, too.
This sets a series of flags that indicate what daemons should be 
started. At system startup, *all* of the items in the StartupItems 
folders are run, so they check for the corresponding flag to see if 
they should actually start their service.
Yep, that's where I can turn sendmail on, once I figure out some 
configuration details, and I want that so my script can report problems 
updating and not just log them. Well, that's for another day.

Thanks, Sherm. I have to admit I get lost less with a little prompting.
--
Joel Rees


questions from configure

2004-04-30 Thread Joel Rees
Okay, one more that had me curious, from the configure script --
vfork() found.
Perl can only use a vfork() that doesn't suffer from strict
restrictions on calling functions or modifying global data in
the child.  For example, glibc-2.1 contains such a vfork()
that is unsuitable.  If your system provides a proper fork()
call, chances are that you do NOT want perl to use vfork().
Do you still want to use vfork()? [y]
Do I take this to mean that Mac OS X (10.2.8) still doesn't have a 
proper fork for Perl's purposes? (for Perl 5.8.4)

And, the default configure suggesting against threads, is that because 
Perl's threads are still in the oven, or because Mac OS X's threads are 
still a little unripe, so to speak?

--
Joel Rees


Re: backing up system

2004-04-30 Thread Joel Rees
Perhaps it's because I'm not strong on Perl yet, but I took a bit more 
of a naive view here --

On 2004.5.1, at 05:22 AM, 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,
Does logging in concurrently as root not work?
Not that I'd urge you to leave your root account enabled for logging 
in, concurrently or otherwise.

(I just tried, for grins, under 10.2.8, su-ing to an admin user, then 
sudo-ing a sh to get a root shell without logging in as root, but 
open-ing /Applications/AppleWorks 6 as the root user didn't seem to 
do anything other than opening the /Applications directory in a GUI 
window. open-ing /Applications/TextEdit.app as root runs TextEdit, 
but the process is owned by the user I'm logged in as. sudoing the open 
directly from the admin user yields complaints about not being able to 
map display interlocks or open default connections, etc. That's not 
Panther, of course.)

 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.
Well, Apple's blurbs seemed to say such things, but I think, when I 
read the fine print, it was for backing up to your .mac account.

2. Otherwise, has someone wrote a perl program to do this that I can 
run in cron.
Wasn't there a related thread here just this last week, including 
mention of either CpMac or ditto?

I'll shut up now.
--
Joel Rees
Opinions are like armpits.
We all have two, they all smell,
and we really don't want the other guy to get rid of his.


Re: backing up system

2004-05-02 Thread Joel Rees
I just tried it, and the application can be downloaded  installed just
fine, but if you try to run it you're asked for a .Mac login to 
procede.
I don't suppose there was an option for selecting the .Mac server?
I have some vague memory that Mac OS X server includes the ability to 
set up and provide several of the services provided on .Mac, but I 
might have been hallucinating. Sometimes my dreams seem pretty real 
when I don't get to bed until four-ish. Maybe I should see if I can 
find something on that.

--
Joel Rees
If God hadn't meant for us to tweak our source code,
He'd've given us Microsoft.


[slightlyOT] reading logs with long urls

2004-05-02 Thread Joel Rees
My apache log files show that I'm getting two or more of those long url 
attacks every day, and access_log grows to over 4Mb in just a week, in 
spite of the fact that there are less than ten valid accesses in any 
particular day. So, I'm going to write a daily script to 
compress-and-rotate. (4M compresses easily to less than 40K, since it's 
mostly those stupid attacks.) That's no big deal, I think, although I 
may pop up with specific questions on that later on.

(I assume either the root kit is dead stupid or my ADSL modem is 
fooling it. I suppose I should check myself on Netcraft some time.)

I also built a little C filter to get the attacks out of the way. I 
used C because all the vectors are around 32K, and it's easy enough to 
just use a 128 MB input buffer and look at the length. (It's an 
interactive tool, so an unexpected really long line will at most kill 
my shell.)

I think I was told by someone that Perl's input buffer would adjust to 
this kind of insanely long line. Does it slow the input down much to 
have to re-allocate the buffer?

The reason I'm asking is that, for now, my filter is just killing the 
long lines. I'm thinking some visible RLL could make those easier to 
see as well as easy to see around. (Not sure what I want to see in 
them.)

(And sometime I'd like to build an error page script that would dump 
64K from /random back at the zombie. But I have more important things 
to do first.)

--
Joel Rees
Getting involved in the neighbor's family squabbles is dangerous,
but if the abusive partner has a habit of shooting through his/her 
roof
the guy who lives upstairs is in a bit of a catch-22.



Re: [slightlyOT] reading logs with long urls

2004-05-03 Thread Joel Rees
My apache log files show that I'm getting two or more of those long 
url attacks every day, and access_log grows to over 4Mb in just a 
week, in spite of the fact that there are less than ten valid 
accesses in any particular day.
How about configuring Apache to disregard (and not log) any URL longer 
than a predefined length?
The default settings are correct for rejecting the long URLs, and 
reporting the attempts is correct behavior. Handling the large logs is 
a time tax on using inherently incomplete technology.

  Also, what are those long url attacks, I haven't heard of them.
See Daniel Staal's post. Fortunately, our Mac OS X boxes are at present 
somewhat immune to the code insertions anyway, because the code is 
almost always x86 code. Part of the purpose of wanting to compress out 
the bulk of the long url is to make it easier to tell if/when we start 
getting powerPC code insertion attempts.

--
Joel Rees
Complaining about systems that are incomplete misses the point.
In this world, a system can't be perfect and useful at the same 
time.
Of course, that's no excuse to refuse to fix problems --
we'll never run out of problems.



Re: [slightlyOT] reading logs with long urls

2004-05-03 Thread Joel Rees
Another idea might be to sleep proportional to the length of the URL.  
For example, 1k request get 1 second, a 2k request gets 2 seconds.  At 
least this will slow them down.
Fortunately, these attacks are not DOS, just looking around for boxes 
to 0wn. So it's just a matter of rotating the logs properly, and 
compressing them if I want to keep the old logs around. (At this rate, 
a year's worth of uncompressed logs would consume my hard drive.)

And, of course, the problem of viewing the logs, which is where this 
thread is closest to being on topic here. Writing a viewer will help me 
understand the perl approach to parsing characters. Not that I don't 
understand it, but it's hard for a guy who essentially cut his teeth 
porting Forth to get used to.

--
Joel Rees


Re: backing up using DejaVu

2004-05-03 Thread Joel Rees
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...
While you always want to avoid doing things that push the limits of the 
system while you're backing it up, in theory, all the timing issues 
should be handled by the drivers before they allow the system to go to 
sleep. Or, if some hardware job is in progress when the system goes to 
sleep, the hardware should be waking the system up to finish the 
process.

So it _should_ keep on trucking. If it doesn't, it's a system bug, and 
needs to be reported.

But risking dropping your backups to find Apple's bugs may or may not 
be what you want to do, and you can be sure that backups won't proceed 
while the system is asleep.

I think this question has come up before, but if there is an API for 
the Energy Saving settings (or whatever those are in English), I think 
I'd want to have my backup script set the system to not sleep while the 
backup was in progress, and then restore the setting when done. Until 
that part is working, I'd change the setting by hand, of course.

--
Joel Rees


sudo and cpan

2004-05-06 Thread Joel Rees
Okay, I seem to have forgotten how to use CPAN. Where are the detailed 
instructions?

(perldoc cpan only gets me a page.)
And while I'm making noise,
When you have perl 5.6 as the system perl (/usr/bin) and perl 5.8 as a 
parallel install in /usr/local/bin, you want to set your user's path to 
put /usr/local/bin in front of /usr/bin before you run cpan, so cpan 
doesn't get confused, right?

What's the difference between perl -mCPAN (or whatever that was) and 
/usr/local/bin/cpan?

Is it normal for cpan to not ask to be set up after a fresh install of 
5.8.4? It prompted me to install Bundle::cpan, but didn't run through 
the list of ftp services and so on, etc. that I remember from previous 
times.

Does cpan have to be run as root? What happened when I tried to install 
Bundle::cpan as an admin user, then ran sudo cpan? Was I supposed to 
do a clean or something first? It installed the second time, when I 
sudoed it, didn't fail any tests, but skipped some tests because I 
didn't tell it the location of any ftp servers to test off of and 
things like that. I was surprised that it didn't seem to know my local 
host name. Now it seems to be unable to release the locks when I quit  
unless I start sudoed.

And I can't find the instructions about querying which modules are 
installed, either.

Maybe it'd help if I had gotten more sleep last night.
--
Joel Rees


Re: sudo and cpan

2004-05-06 Thread Joel Rees
On 2004.5.6, at 08:08 PM, Joel Rees wrote:
Okay, I seem to have forgotten how to use CPAN. Where are the detailed 
instructions?

(perldoc cpan only gets me a page.)
And while I'm making noise,
When you have perl 5.6 as the system perl (/usr/bin) and perl 5.8 as a 
parallel install in /usr/local/bin, you want to set your user's path 
to put /usr/local/bin in front of /usr/bin before you run cpan, so 
cpan doesn't get confused, right?
What I'm thinking about is learning enough sh to split the path and 
insert /usr/local/bin in the middle, because I really don't want to put

set path=(/bin /sbin /usr/local/bin /usr/bin /usr/sbin)
in my users's .bash_profile, etc. It's not like it's going to change or 
anything, but it just feels wrong.

set path=(/usr/local/bin ${path})
also feels wrong. It avoids walking on the system provided path, but it 
gives /usr/local/bin priority over /sbin. If everything in /sbin should 
be called by full path anyway, why is /sbin in the path at all?

Maybe this is really a question for a security list.
What's the difference between perl -mCPAN (or whatever that was) and 
/usr/local/bin/cpan?
perl -MCPAN -e shell
is interactive.
Is it normal for cpan to not ask to be set up after a fresh install of 
5.8.4? It prompted me to install Bundle::cpan, but didn't run through 
the list of ftp services and so on, etc. that I remember from previous 
times.
Evidentally I don't run CPAN non-interactively very much.
Does cpan have to be run as root? What happened when I tried to 
install Bundle::cpan as an admin user, then ran sudo cpan? Was I 
supposed to do a clean or something first? It installed the second 
time, when I sudoed it, didn't fail any tests, but skipped some tests 
because I didn't tell it the location of any ftp servers to test off 
of and things like that. I was surprised that it didn't seem to know 
my local host name. Now it seems to be unable to release the locks 
when I quit  unless I start sudoed.
Still don't find much on this one.
And I can't find the instructions about querying which modules are 
installed, either.
Okay,
perldoc perllocal
perldoc perlmodlib
Maybe it'd help if I had gotten more sleep last night.
Reading the faq helps, too.
--
Joel Rees



Re: OS X

2004-05-06 Thread Joel Rees
On 2004.5.6, at 09:01 PM, Stephen Harris wrote:
Hi,
Decided to teach myself Perl and the got  Sam's Teach Yourself Perl 
in 24 hrs (book  CD ) from the local library.
I began working with the book and found that perl 5.6.1 only runs in 
Classic environment,
That would be macPerl 5.6.1?
but that the Unix
version of perl runs fine in OS X. OK, maybe, but how do you get it 
in there?
It's in there. Try this in the terminal:
ls -l /usr/bin/p*
and then this:
perl --version
which will show that it is 5.6.0. If you want the latest perl, 5.8.4, 
that does have to be installed (for instance, if you are like me and 
need the Unicode support).

(I'm running OS X 10.2.8 on a dual processor G-4 silver Power PC.)
Thanks
S. M. Harris




Re: sudo and cpan

2004-05-06 Thread Joel Rees
On 2004.5.6, at 09:58 PM, Chris Devers wrote:
...
But anyway, back to your original question. Your /usr/bin/cpan should
just be a little Perl script that amounts to little more than this:
$ /usr/bin/perl -MCPAN -e shell
hmm. I could have sworn I'd ended up with non-interactive behavior when 
I just ran /usr/local/cpan. Maybe it was just that all the defaults 
were already set from installing 5.8.4 from source.

Thanks. Any thoughts about the file locks left over when I run without 
sudo and quit? This doesn't happen when I'm running cpan as a non-amin 
user. Or maybe I should say it doesn't happen as a user other than the 
one I installed as, but I haven't tried running as a non-install admin 
user yet.

I'm thinking too hard, I know. Time to install XML and get back to work.
--
Joel Rees


Re: Anyone got a perl script to catch the disk: and help: uris in web browsers?

2004-05-26 Thread Joel Rees
On 2004.5.26, at 10:49 PM, Chris Nandor wrote:
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Joel Rees) wrote:
Macintouch is showing an AS script:
 http://www.macintouch.com/#notesandtips
I've never been comfortable with AS, so I'm thinking about installing
it to see how it works, then re-writing it in perl, and maybe even
further trap all attempts to climb the directory tree in the uri.
You can use Mac::InternetConfig to disable the protocol handlers.  
But
RCDefaultApp is a better solution for this.
Yeah, but neither of those are nearly as interesting. Of course, since 
Apple has already done the easy part, it doesn't make any sense to try 
to build it myself. The perl script in the patch they distributed is 
kind of interesting.

Any thoughts on the protocol registration issue or the login items 
issue? I'm thinking it might be useful to have a (say, perl? heh.) 
script clean up registered protocols and login items that were not 
explicitly okayed by the user, for one thing.

--
Joel Rees
If God had meant for us to not tweak our source code,
He'd've given us Microsoft.


Re: Whither Developer Tools?

2004-06-10 Thread Joel Rees
If not, you can always copy if off your collegue's hard drive.
It being the installer package, of course. It installs stuff all 
over the place - apps, documentation, headers, libraries, etc., etc. 
Trying to copy all that stuff manually would be a massive pain.

I'm pretty sure that's what Chris meant, but I figured it was worth 
spelling it out for the sake of the archives. (As if anyone reads 
them...)
I guess if we are going for completeness in the archives, someone 
should mention that, if you re-partition your hard disk and re-install 
from the DVDs, the dev tools/xcode installer will end up in the same 
place again. (Unless you do a custom install and deliberately deselect 
it, that is.) It's on the install DVDs (or CDs) for new machines, it's 
just not there as a separate package.



Re: Installing modules on osX 10.3.3

2004-06-14 Thread Joel Rees
On 2004.6.15, at 06:08 AM, Bill Stephenson wrote:
On Jun 14, 2004, at 3:12 PM, Sherm Pendley wrote:
I'm curious - is reinstalling the OS a common troubleshooting 
technique for older MacOS versions? I'm a fairly recent switcher 
myself. I purchased my first Mac expressly to run Mac OS X DP4.

Yes, it certainly was for Systems 7-8. Clean System install,
And there was that sweet spot where the system only took half an hour 
to re-install. When we were working in that sweet spot, re-installing 
made eminent sense.

But that sweet spot would go away. Apple would add necessary 
functionality, and, of course, we would add apps and extensions so that 
it would consume a whole half a day to re-install the system and apps.

I always that those half-day re-installs were terrible, until I 
starting helping with MSWnt4 or OS2Warp installs at work.

 then install apps one at a time until a failure (conflict) occurs. 
The Extensions Manager helped a bit, but I always shied away from 
using it and learned to manage conflicts manually instead.
I started using the extensions manager to move everything out of the 
extensions folder before installs. Then I could compare what the app 
installed with what had already been in place. Leaving only the most 
recent version of extensions and disabling as many Microsoft extensions 
as I could was usually pretty effective.

 I used to restart my 6100 and then my 8600 several times a day just 
to avoid System freezes. You could just feel one coming on after a 
bit. I sure don't miss that. System 9 was a pretty big improvement, 
but after several years my 8600 started acting weird and now it surely 
needs a clean install to make things work again.
YDL? NetBSD?
;-)


Re: Location of Files to be Printed

2004-06-16 Thread Joel Rees
Dunno about Jaguar  earlier.
[reiisi-rend:~] family% ls -la /var/spool/cups
ls: cups: Permission denied
heh. Permissions are correct.
Anyway, cups could be got to run (with a lot of patience, as I recall) 
in 10.0. It ran, if not with fully satisfactory results in some cases, 
in 10.1. I haven't noticed any serious issues in 10.2.

Obligatory Perl Reference: Although CUPS is installed and working (for 
both native Mac and Fink-installed Unix apps), the development headers 
are nowhere to be found, so Net::CUPS doesn't want to compile.
I'm sure I've seen stuff for cups on Apple's developer's sites. Can't 
say where, or if it was enough to compile Net::CUPS.



Re: CPAN can't write makefiles after perl 5.8.1 reinstall on 10.3.4

2004-07-15 Thread Joel Rees
On 2004.7.15, at 06:43 AM, Brian Dimeler wrote:
Hi, I was having trouble installing LWP on the version of Perl that 
came with our office iMac (running OS X 10.3.4) and therefore I 
reinstalled Perl as per the suggestion of CPAN, using the guide at 
http://developer.apple.com/internet/opensource/perl.html .
my, oh, my.
Would someone else take a look at that page and tell me whether they 
agree with me that it looks like some summer intern at Apple has kind 
of laid a little land mine in there, maybe thinking he was bringing the 
page up to date with Panther?

...



Re: CPAN can't write makefiles after perl 5.8.1 reinstall on 10.3.4

2004-07-15 Thread Joel Rees
(B Would someone else take a look at that page and tell me whether they 
(B agree with me that it looks like some summer intern at Apple has kind 
(B of laid a little land mine in there, maybe thinking he was bringing 
(B the page up to date with Panther?
(B
(B Absolutely. I wish Apple would take that page down - it was broken 
(B even for Jaguar.
(B
(BWhat I'm wondering about is this:
(B
(B---
(BA quick trip to Jaguar$B!G(Bs Terminal showed me that this version didn$B!G(Bt 
(Bmake it into the default install:
(B
(B [cpu:~] user% perl -v
(B This is perl, v5.8.1-RC3 built for darwin-thread-multi-2level
(B---
(B
(BI'm supposed to believe that little exchange was on a default Jaguar 
(Binstall?
(B
(B The latest Perl (5.8.4) comes with a readme.macosx file. Please, read 
(B and follow those instructions. Apple's instructions may be of interest 
(B to historians, but they have no relevance to the current Mac OS X.
(B
(BI note the original was contributed. Maybe it's time to contribute a 
(Bnew one. I wonder if I kept any notes when I did the parallel install 
(Bof 5.8.4 on this Jaguar box.
(B
(B--
(BJoel Rees
(B Opinions are like armpits.
(B We all have two, and they all smell,
(B but we really don't want the other guy to get rid of his.

Re: Forking Signals

2004-08-20 Thread Joel Rees

Now if we take that same simple program and either
don't define $SIG{'TERM'} or set it to 'DEFAULT' we
get END when the parent dies, but when we kill the
child cleanup isn't run (duh) but neither is END. Is
that standard behaviour? I would've thought it'd try
to do END if at all possible to clean up after itself.
Lessee, I think it's a kill 9 that can't be caught. And maybe kill 15, 
but I've never played with that. Other signals can be caught, but I've 
only done that in C, so my memory may be faded.



Re: Download images/movies

2004-08-21 Thread Joel Rees
On 2004.8.22, at 04:07 AM, Chris Devers wrote:
On Sat, 21 Aug 2004, Mark Wheeler wrote:
I have a picture gallery I building for my family. When a movie or 
picture is displayed, I want them to be able to save it. But... if I 
just provide a link in the coding to the actual file, it will open up 
in the browser window and be displayed. Is there a way to have 
download, either automatically or by a Save As... dialog box, the 
file rather then displaying it? I hope that was clear. :)
This is untested, but I'm guessing that you could write a simple CGI 
script that takes the URL for an image as an argument -- maybe just 
using $ENV{'HTTP_QUERY_STRING'} so that the url can be simple like --

http://site/images/fetch.pl?path/to/image/file.jpg
-- and then have your script find path/to/image/file.jpg and spool 
it back to the client with a Content-type of 
application/octet-stream instead of image/jpeg.

This can probably be done with about half a dozen lines of code, and 
if the browser is well behaved -- that'll be the part that's a pain to 
verify -- the alternate content type should force the right behavior.
Worked on a project where we wanted pdfs to automatically open in Adobe 
Acrobat. Various things we tried worked with some browsers and not with 
others, and I had to point out that some people would have their 
browsers set to save everything to disk. Boss decided that anyone who 
knew enough to set the browser to save everything to disk would be 
assumed to be unlikely to be surprised at the results.

You should have less problems because the save-to-disk is what you're 
going after, but some browsers in some settings will attempt an ascii 
dump to the browser.

I have a script that builds a page that spreads a set of pictures out 
in a table with links to several resolutions (no, not filtering the 
resolution at run-time). I did not bother with setting the Content-type 
in the download links because I knew two things -- those relatives who 
would not know to right-click would also not know what to do with the 
files when downloaded, and I was pretty sure the one person I wanted to 
be able to download would not have to be told to right-click or 
control-click.

Sorry to say, I won that bet with myself, so I didn't bother building 
in the Content-type machinery which is most interesting in this thread. 
If anyone's interested in what I did put together, I could post it.

--
Joel Rees
Complaining about systems that are incomplete misses the point.
In this world, a system can't be perfect and useful at the same 
time.
Of course, there's no excuse for refusing to fix problems --
we'll never run out of problems.



Re: Download images/movies

2004-08-21 Thread Joel Rees
Thinking twice, I'll be out of pocket for a while, so I'll just go 
ahead and post this just in case anyone is interested.

http://reiisi.homedns.org/~joel/cs/shared_code/showpics.pl.text
Contains some shift-jis, which can be stripped out with no ill effects.
--
Joel Rees
It's not the Here's a button, click it! attitude,
It's Bill saying he has to be free to invent our technological 
future.
(But I'm just as glad it's not Steve's company with the 95%, 
either.)



Re: Download images/movies

2004-08-23 Thread Joel Rees
I think that's what I'm looking for. One question. What do you mean 
whitelist the filepaths. My only reference point is email. 
Whitelist for me means that email address on my whitelist always 
get through, even though the spam software might initially think it's 
spam. Can you clarify?
If the script I posted was readable, you might have noticed that it 
accepts one parameter and sets the directories only if that parameter 
matches correctly. It looks like a waste, but it's one way of what he 
was calling whitelisting in a fairly strict way, but allowing the same 
script to be used on multiple sets of images. You do have to add a 
little code for each set of images, of course.

That script needs some comments.
--
Joel Rees
Getting involved in the neighbor's family squabbles is dangerous.
But if the abusive partner has a habit of shooting through his/her 
roof,
the guy who lives upstairs is in a bit of a catch-22.



Re: Download images/movies

2004-08-25 Thread Joel Rees
Just a few nosy comments --
html
head
titleUntitled Page/title
/head
body
a  
href=javascript:window.location='cgi-bin/download.cgi?picname=Upload- 
Background.gif'picture link/a
Not sure why you want to bother with javascript in there. ICBW, but I  
don't think it buys you anything. And some of your family may decide to  
turn javascript in their browsers off.

/body
/html
-
#!/usr/bin/perl -w
use strict;
use CGI ':standard';
I didn't notice that you had used anything from CGI in the script.  
Might as well comment it out.

my $filename = param('picname');
Did you follow what was said about ../../ someodd with /etc at the end?
It's a good way to dump all sorts of things about your machine into  
someone else's browser, including user names and ids, the entire  
httpd.conf file, and so forth.

That's why I don't usually accept filenames in scripts. But if you do,  
you need to check for / at the top or ../ anywhere, and balk if you get  
those. It can get kind of tricky, since \/ is /.

my $path = /images/$filename;
For instance, somebody puts this in their browser:
 
http://your.domain.com/cgi-bin/download.cgi?picname=../etc/httpd/ 
httpd.conf

binmode STDOUT;
print Content-Disposition: attachment;filename=$filename\n;
print Content-Type: application/octet-stream\n\n;
If you _had_ been using CGI, the above two lines could have created  
some subtle conflicts.

open (FILE,  $path) || die(Can't open($filename): $!);
This is why you got the attempted download that stalled, of course.  
That die statement won't do much useful. Well, if it were going out  
STDOUT, it might have shown up as your downloaded file.

You'll want to look into using a logging file or the http version of  
carp.

my $data = FILE;
close (FILE);
print $data;
exit;
--
Joel Rees
Nothing to say today
so I'll say nothing:
Nothing.


[OT]Re: Brand New Empty Mac

2004-08-25 Thread Joel Rees
But I just thought I'd get the opinions of the list on the best way to 
set up such a brand-new machine -- do you partition your hard-drives?
I usually do.
But on a Mac, I have decided not to to be play too smart. I'll usually 
format a gig or two for classic and leave the rest to the boot drive.

I have not satisfied myself that there is any advantage to a swap 
partition, and I won't mention why here. On the other hand, Apple may 
have decided to let fstab have some so in Panther, in which case a 
separate swap partition can help smooth the virtual memory system a bit.

Some of your Mac OS X applications may throw a hissy if they are not on 
the boot partition, or if the users are not on the boot partition, so 
you lose most of anything you'd gain with separate /home or /usr. And 
the automount puts everything under /Volumes, anyway.

However, if you plan to serve the web with that box, a separate 
partition for web stuff might give you warm fuzzies and maybe even some 
real protection. Just make sure you format any partition(s) for web as 
Unix File System, instead of HFS+. That way you should actually get the 
permissions bits to work right.

I might also have another UFS partition for PostGreSQL and other such.
I also keep a spare hugh partition if I can, for downloads and large 
images. If you have a  bigfiles partition it should be HFS+, of course.

Do you have the system on one partition and documents on another and 
so on?
No, that just buys you heartache in Mac OS X, of present.
 Any issues around the installation of Perl and other things like C 
libraries that I should be thinking about?
I like to have multiple users, one for doing serious work in, one, 
perhaps with limits on it, for surfing, and, of course. I also like to 
make two administrator accounts, just in case something goes haywire in 
one.

Most people don't really need to bother with anything fancy, just let 
the install set up run.

--
Joel Rees
If God had meant for us to not tweak our source code,
He'd've given us Microsoft.


Re: Download images/movies

2004-08-25 Thread Joel Rees
Thanks for your input. In regards to filename, I'm assuming you are  
talking about the filename passed within the HTML, right?
If I know what you meant be that, I'd be more able to say.
So I'll dodge and try explaining it this way: Any script that could  
potentially be called by someone typing it's URL into their web browser  
is subject to getting input you don't want. If you accept file names  
directly in such scripts, there are several bad things that can happen:  
An attacker can gain information you may not want him or her to get  
about the structure of things in your site (ergo, by checking the  
status bar). Worse, an attacker could pass a complex path giving access  
to files you don't want him or her to be able to access. Another bad  
thing is that an attacker could pass a huge string that contains lots  
of escape characters to hide the complex path. (I regularly see zombies  
posting 32k parameter strings to my home server.) If I tried to put one  
of those strings into a limited space buffer (usually more of a problem  
in C than in perl), it could blow up my program or allow a buffer  
overrun attack.

I think what I will probably do is pass an ID number to the script and  
then process it that way.
If the file name contains the ID number or name string, you'll still  
need to clean the http parameters.

If you have a hash (not an array) that you use the ID to index into and  
get the real file name, that is one good way to clean the parameter. An  
if-ifels condition that compares the IDs to a (small) set of valid IDs  
could be another way.

But whatever you use to map the IDs to file names, you'll want to check  
for weirdness like escape characters and long strings, just to avoid  
stressing your machine.

I will still check for ../ andywhere the passed ID, as well as /  
at the beginning of the ID. You mentioned that V is /. Im afraid  
you lost me there. Can you explain?
The backslash is an escape character and can be used to hide things.  
For instance, ../ will go up one level in the directory, but so will  
\.\.\/.

Have fun. I gotta go to work.
Thanks,
Mark
On Aug 25, 2004, at 8:16 AM, Joel Rees wrote:
Just a few nosy comments --
html
head
titleUntitled Page/title
/head
body
a  
href=javascript:window.location='cgi-bin/ 
download.cgi?picname=Upload-Background.gif'picture link/a
Not sure why you want to bother with javascript in there. ICBW, but I  
don't think it buys you anything. And some of your family may decide  
to turn javascript in their browsers off.

/body
/html
-
#!/usr/bin/perl -w
use strict;
use CGI ':standard';
I didn't notice that you had used anything from CGI in the script.  
Might as well comment it out.

my $filename = param('picname');
Did you follow what was said about ../../ someodd with /etc at the  
end?

It's a good way to dump all sorts of things about your machine into  
someone else's browser, including user names and ids, the entire  
httpd.conf file, and so forth.

That's why I don't usually accept filenames in scripts. But if you  
do, you need to check for / at the top or ../ anywhere, and balk if  
you get those. It can get kind of tricky, since \/ is /.

my $path = /images/$filename;
For instance, somebody puts this in their browser:
 
http://your.domain.com/cgi-bin/download.cgi?picname=../etc/httpd/ 
httpd.conf

binmode STDOUT;
print Content-Disposition: attachment;filename=$filename\n;
print Content-Type: application/octet-stream\n\n;
If you _had_ been using CGI, the above two lines could have created  
some subtle conflicts.

open (FILE,  $path) || die(Can't open($filename): $!);
This is why you got the attempted download that stalled, of course.  
That die statement won't do much useful. Well, if it were going out  
STDOUT, it might have shown up as your downloaded file.

You'll want to look into using a logging file or the http version of  
carp.

my $data = FILE;
close (FILE);
print $data;
exit;
--
Joel Rees
Nothing to say today
so I'll say nothing:
Nothing.




Re: Download images/movies

2004-08-26 Thread Joel Rees
On 2004.8.26, at 04:45 AM, Bill Stephenson wrote:
On Aug 25, 2004, at 10:59 AM, Mark Wheeler wrote:
Hi Joel,
Thanks for your input. In regards to filename, I'm assuming you are 
talking about the filename passed within the HTML, right? I think 
what I will probably do is pass an ID number to the script and then 
process it that way. I will still check for ../ andywhere the 
passed ID, as well as / at the beginning of the ID. You mentioned 
that V is /. Im afraid you lost me there. Can you explain?
I'm curious, I've seen the ../ thing mentioned many times over the 
years but I've never successfully created a script that would open a 
file that way. I use a Clean Name sub-routine (that I got from 
Lincoln's CGI book) just to be safe on files I want to process or 
return to a client;

sub clean_name {
   unless ($selected_file =~/^[\w\._\-]+$/) {
That'll disallow some valid filename characters, particularly in Unix. 
But that's okay if you never use it to validate filenames that have 
those characters, and it side-steps a lot of picky details about trying 
to find all the naughty stuff.

  print STRONG$selected_file has naughty characters.  Only ;
  print alphanumerics are allowed.  You can't use absolute 
names./STRONG;
  die Attempt to use naughty characters;
   }
   return $selected_file;
}

Still, I've tried scripts without it and they will never open a file 
name input from a form like:

http://site.com/server.cgi?file=../../../../../../../etc/passwd
Maybe it's because I usually append the $file to a $path
How deeply nested is the path? would be one question.
or never input the right combo of ../ (path info) but I've never 
seen it work. Can someone actually show me a cgi script example that 
does this?
From a casual examination, I would guess that the sample Mark posted 
should be one that would do this. (It occurs to me that he really might 
probably prefer not to have anything he's pumping out to the web right 
under root the way it looks like he's got his images directory.)

  It seems to me that the file permissions for etc/passwd should 
prevent this from working in the first place.
Well, open up a terminal window and look at the permissions:
% ls -la /etc
% ls -la /etc/passwd
--
Joel Rees


Re: Thunderbird

2004-09-23 Thread Joel Rees
I'd like to take more time for this, but waiting doesn't produce more 
time this week. So I'll just toss out an idea --

You might be interested in this page, entitled
Import Address Book
records into to Thunderbird :

http://www.macosxhints.com/article.php?story=20040905025741769
When I googled for thunderbird and address,
trying to learn what
thunderbird was, this was the first link that came
up.
Yeah, shortly after posting I did the google and found
that page. Tried the script, it had some issues* but I
tinkered with it until I got it to work. But even
then, Firebird's import didn't seem to find anything
in the file.
I don't know about .vcf, but .csv is fairly easy to just look at with a 
text editor (formatting off, of course). The primary complications are 
for commas and new-lines buried in fields. Microsfot used quotes and 
made the whole thing a mess, but once you get your head around the mess 
it isn't that bad.

(One of these days, we have to put ASCII behind us, but that's a topic 
for a rainy weekend or two.)

 (After you load the file there's a pop-up
to link specific fields in the file to specific fields
in the Thunderbird format. But neither .vcf not .csv
seems to show up wih anything.) Since .csv *is* listed
as a text-type it understands, I wonder if this might
be a bug in the import abilities. I was hoping someone
else here uses Firebird and may have dealt with the
issue before.
* SImpleText doesn't like the create new document
stuff, so changed it to call TextEdit. And it craps
out on some of the addresses for no reason i can
discern, so I just commented that all out to produce
null addresses.
~wren

__
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail



Re: Thunderbird

2004-09-24 Thread Joel Rees
On 2004.9.24, at 11:55 AM, wren argetlahm wrote:
--- Chris Devers wrote:
--- Joel Rees wrote:
I don't know about .vcf, but .csv is fairly easy
to just look at with
a text editor (formatting off, of course).
Yeah, they're both just text and (pretty) easily
readable. The problem comes in that I don't want to
stop using AddressBook and so I'm looking for a
maintainable solution, where I can just hit a couple
buttons or run a script rather than needing to
manually enter anything.
That's part of the reason i've been looking at FB's
import function and Mac::Glue. I don't know for sure,
but I'm thinking that FB doesn't offer any sort of
scripting API (ala Mac::Glue or commandline commands)
that'd let me enter the data programmatically if the
Import function doesn't work. I'd love to be disproven
however.
Incidentally, the .vcf file generated by AB looks akin
to your example but with a space between every
charecter and two newlines instead of one. Is that
normal, or might that be part of the reason that
Firebird is having difficulty reading it?
I would guess that would be the entire reason. Use the file open menu 
item in Text Edit and try loading the .vcf file generated by Address 
Book as a Unicode UTF-16 file. (You may need to customize the encoding 
list.)

If you just double click or drag-and-drop, it will use the default 
encoding, which is probably UTF-8.



Re: Thunderbird

2004-09-24 Thread Joel Rees
On 2004.9.24, at 11:34 AM, Chris Devers wrote:
On Fri, 24 Sep 2004, Joel Rees wrote:
I don't know about .vcf, but .csv is fairly easy to just look at with
a text editor (formatting off, of course).
VCF is (basically) an ascii format. You can encode binary data (e.g.
photos) in it, but it's base64 encoded (just like email) so you can 
poke
at it with a regular text editor.

A typical entry might look something like this:
BEGIN:VCARD
VERSION:3.0
N:Meyer;Russ;;;
FN:Russ Meyer
EMAIL;type=INTERNET;type=HOME;type=pref:[EMAIL PROTECTED]
item1.EMAIL;type=INTERNET:[EMAIL PROTECTED]
item1.X-ABLabel:_$!Other!$_
TEL;type=HOME;type=pref:800 555.1212
item2.ADR;type=HOME;type=pref:;;42 Any Lane
\n;Hollywood;CA;12345;United States
item2.X-ABADR:us
X-AIM;type=HOME;type=pref:rmvix
END:VCARD
Now that you mention it, I guess I have looked at those with a text 
editor.

Etc. It's a little confusing,
Not so much confusing as just got a lot of stuff in it. Looks like 
colons for the element labels and semicolons for the element 
delimiters. And I think I see a buried newline escaped with a 
backslash. Hmm. Who made this format up, anyway?

My goodness, these things have got RFCs behind them:
http://www.imc.org/pdi/
Surprised they don't mention any movement to convert these to XML.
but it's mostly a regular format that
isn't too hard to read or otherwise work with.
Well, ...
(One of these days, we have to put ASCII behind us, but that's a 
topic for a
rainy weekend or two.)
???
Every tool has a role; ascii has lots and lots and lots of useful ones.
Also roles that it's totally wrong for, but that doesn't mean that it
makes sense to get rid of it altogether...
Yeah, but it's time to move on. (I'm busy in my spare time trying to 
invent an encoding scheme that includes a variety of meta-punctuation, 
including meta-field separators. Of course, by this point, I'm 
duplicating effort by the Unicode consortium, to a certain extent.)

--
Joel Rees


Re: [OT] Text Editor for OSX

2004-10-03 Thread Joel Rees
On 2004.10.4, at 02:29 AM, Doug McNutt wrote:
I'm not so sure about the OT designation.
FORTH is on topic on a perl list? ;-)
Apple's Macintosh Programmer's Workshop (MPW) is the best programming 
environment I have ever used. BBEdit worksheets are a start but are 
not nearly as flexible. emacs is another option but it still doesn't 
approach MPW with its window = file metaphor. MPW allows one to 
execute a shell command by selecting it and using the ENTER key.
I've always wondered how much MPW was inspired by FORTH.
Output from the command, which can be a named file or an open window, 
can be redirected to any other open window or to a file.
...
Let me see. IIRC, trying to run perl as an interactive shell had its 
limits. But it should not be hard, I suppose, to feed a selection or 
line from a text editor to an instance of perl.

I'm a little lazy right now. Was SubEthaEdit originally on open source 
project?

(And did Wren notice BareBone's TextWrangler and decide that didn't go 
far enough?)

One thought -- Wren, if you're going to go so far as to write YATE, I'd 
suggest your internal character encoding be a thirty-two bit encoding 
that uses the full thirty-two bits to allow you to keep track of input 
encoding on a character-by-character basis. While Unicode support is a 
must, I would not use it as an internal encoding because of the 
round-trip problems.

But then I've only wren one text editor, and that was in FORTH, and not 
very comprehensive.

--  The best programming tool is a soldering iron --
8-O


Re: OT: what happened to my permissions?

2004-10-05 Thread Joel Rees
On 2004.10.5, at 10:40 AM, John Horner wrote:
Please forgive the OT nature, but I just know you will be able to help.
I upgraded an old Mac I use as a server from 10.1 to 10.2.
After the upgrade, the webserver Documents folder had all the wrong 
permissions. I had to log in via the terminal and CHMOD various 
things. All is working well now, but not for *new* files.

Every new file I upload
upload from where and how?
has the permissions -rw-r- although the enclosing folder itself 
is drwxr-xr-x. I'm a bit confused about this, and the more I read 
about UMASK the more confused I get.

Short version of question: how do I set the default permissions, 
permanently, recursively, for all new files uploaded to 
/Library/WebServer/Document/ ?

Other questions:
If I do a rebuild permissions, will it fix this? Will it over-ride 
various folders which are world-writable
world writeable? whaddaya wanna doodatfer?
so I have to go back and CHMOD again? Can I run rebuild permissions 
in Terminal or only from the GUI?

And finally, if anyone's really annoyed by this being OT, where should 
I go to ask for this kind of help in future?
http://discussions.info.apple.com/
Admitted, it doesn't exactly look obvious, but if you go looking 
starting here you can find a unix forum under both Panther and 
Jaguar. (It's a little better hidden under 10.2.) If you look closely, 
it's the same forum.

If you have a (free) developer account already, you can use the same 
login name and password to post questions.

Not having done what you did, I'm not going to take a stab at your 
other questions. But what does umask without any arguments tell you?  
Something like 037 or 015?

--
Joel Rees
even though much of what I do is not sensible
it does make sense if you know why ...


Re: [OT] Black Screen of Death

2004-10-17 Thread Joel Rees
I was hoping that the error might be found in one of the Console logs.
It ought to be in one of the logs, yes. Sorry that I don't remember 
which. Check in

/var/logs
List by time, so you can tell which files were written most recently:
ls -latT
(IIRC. might want to man ls if that set of options doesn't work.) Some 
of the files are binary, but I'm pretty sure the most important ones 
are text. Oh, and run this command first:

last
That is not all, but it' all off the top of my head this AM.
 It's difficult to read the text that's scrolling on the screen 
because it's moving so darn fast, my old eyes aren't very good 
anymore, and I tend to get those pesky Optic Migraines when I stare 
at anything that strobes or has significant glare, ...

--
Joel Rees
Getting involved in the neighbor's family squabbles is dangerous.
But if the abusive partner has a habit of shooting through his/her 
roof,
the guy who lives upstairs is in a bit of a catch-22.



Re: Yet another Mac OSX and DBI question

2004-10-17 Thread Joel Rees
One quick question. I am sat in a hotel room a long way from a 
braodband connection. this is a 300 M download. That's a lot on a dial 
up at hotel phone rates. Is there a less financially crippling way of 
just getting the essential files, or do I need the full update to 
XCode?
I've never tried this, but the files have been named. Might be worth a 
try getting them from Apple's  darwin source code, hand compiling them 
and copying them into place. I suspect you won't get the options (like 
dynamic library vs. static or object code, object output format, among 
others) correct the first try. I'd guess dynamic library and somthing 
other than elf, but I'd likely be wrong and incomplete. Anyone else 
have a guess to hazard?

I'm sure you'd want to get the complete package installed once you get 
back where you have broadband.

And maybe one of us should file a bug report or suggestion that Apple 
put up a download of just the relevant files?

--
Joel Rees
It's not the Here's a button, click it! attitude,
It's Bill saying he has to be free to invent our technological 
future.
(But I'm just as glad it's not Steve's company with the 95%, 
either.)



Re: Installing new(er) perl on Jaguar

2004-11-02 Thread Joel Rees
Can someone disambiguate this article for me please?
I'll try. I think you'll recall that this has come up before, so you 
may want to take a look in the archives.

http://developer.apple.com/internet/opensource/perl.html
Consider this article to be old enough to be reference only, by the way.
I'm not up to a point-counterpoint today, I guess, so I'll just snip 
the rest of this and wing it.

You can have more than one version of perl installed. In fact, it is 
generally recommended to do so. Most Unix systems make heavy use of the 
perl that is installed with the system, so if you upgrade perl 
underneath the system you risk confusing the system. And if you upgrade 
from 5.6 to 5.8, you'll have to make sure all the binary modules the 
system has installed (and all the binary modules you installed) are 
re-compiled.

It's a lot easier to manage (and therefore a bit more secure) if you 
don't have to worry about effects on the system when you upgrade and 
add modules to the copy of perl you're using for non-system stuff.

5.8 is recommended for a number of reasons. (More complete Unicode 
support is a big reason in my case.)

So, when the installer asks where to install it, tell it to install in 
/usr/local (or wherever you keep the non-system stuff you install for 
all users).

You will have to edit the first line of _your_ scripts (not the 
system's) to

#! /usr/local/bin/perl
and remember to invoke the right CPAN, and such things, which can be a 
little confusing.

There is a way to get a list, but I don't remember it, and javadoc 
seems to be interfering with my memory of perldoc right now. Maybe 
someone can help me here?

--
Joel Rees
Nothing to say today
so I'll say nothing:
Nothing.


Re: Installing new(er) perl on Jaguar

2004-11-03 Thread Joel Rees
There is a way to get a list, but I don't remember it, and javadoc 
seems to be interfering with my memory of perldoc right now. Maybe 
someone can help me here?
Umm... a list of what? Perls? whereis perl will do that. If you're 
in doubt about which of the installed Perls appear first in your PATH, 
which perl will tell you that.
List of installed modules. I must be distracted.
--
Joel Rees
Nothing to say today
so I'll say nothing:
Nothing.


Re: Installing new(er) perl on Jaguar

2004-11-03 Thread Joel Rees
Instead, install perl in /usr/local/, and make sure that that comes
first in your path.
That's fine for scripts that you run from a shell, with perl 
scriptname.pl. Do you run many of your scripts that way? I certainly 
don't. Most of my scripts depend on the first #! line to choose a  Perl.
Actually, there is one more reason not to put /usr/local/bin in your 
path ahead of /bin.

It's a potential security weak spot.
(Say some package you test out puts a program of some sort named ps 
in /usr/local/bin.)

--
Joel Rees
even though much of what I do is not sensible
it does make sense if you know why ...


Re: MySQL

2004-12-09 Thread Joel Rees
Paul DuBois's  books on MySQL have been pretty good for me. I got a lot 
out of the one called, I think, Perl and MySQL for the Web.

It's been over a year, but the MySQL lists seemed to be a lot of help:
http://marc.theaimsgroup.com/?l=mysqlr=1w=2
(These days I seem to be messing around with PostGreSQL and xindice, 
mostly.)



Re: catnip.local (redirect)

2005-01-07 Thread Joel Rees
Hmm. All this made me look at how I have this box set up and I discover 
that what I was about to tell you (and what I've done to a box I'm 
borrowing from work) was wrong. I'lll try to reconstruct things. I hope 
I make sense.

My spouse has, at her workplace, a Mac OS X machine with web sharing
turned on. This machine is, therefore, reachable on the internal
company LAN as either http://catnip.local or http://catnip.company.com
If my memory is right, I used to get that back in the days of 10.0 when 
the link went down or the ethernet cable came slightly loose or 
whatnot. /etc/hosts was only referenced during single user mode back 
then or something. I can't remember if using the machines domain in 
netinfo was the cause or the cure. But if you look under /machines in 
the Applications/Utilities/netinfo GUI widget, you'll notice that there 
are two entries that look very suspicious.

At one time I had added an entry under /machines for the name of this 
box. I duplicated the localhost entry and edited it in a way that 
seemed appropriate. Sometime between 10.0 and 10.2.8, Apple fully 
restored the functionality of /etc/hosts, so I presently have a line 
something like

10.2.40.49  reiisi reiisi.homedns.org
in /etc/hosts, instead.

When she works from home, she accesses the company network via VPN.
The  machine is still accessible as http://catnip.company.com.
Unfortunately, many of the links automatically convert too URLs
beginning catnip.local.  Via VPN (the way she does it), there is
no catnip.local.
I was going to mumble something here, but I need to hit the hay. I'm 
not sure I'm making any sense anymore anyway.

Does anyone know where this redirection to catnip.local is stored and
whether (how) she can make it stop?
-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



[OT] Re: catnip.local (redirect)

2005-01-07 Thread Joel Rees
My spouse has, at her workplace, a Mac OS X machine with web sharing
turned on. This machine is, therefore, reachable on the internal
company LAN as either http://catnip.local or http://catnip.company.com
[]
other places to look at for grins and giggles --
man hostname
man domainname
cat /etc/hostconfig
(/etc/hostconfig is what actually tells the box to name itself 
automatically, which is causing the use of the local domain, but don't 
jump to the assumption that you should therefore change it from 
automatic to catnip.company.com. I don't remember why I don't do that, 
but I did think I had a good reason. Looking up etc/hostconfig+mac 
os x at your favorite search engine might provide some clues.)

The biggest failing with mac os x is its biggest strength -- too much 
indirection and delegation. It's often really difficult to figure out 
where the buck stops. But it does just work for most people, and they 
do seem to be making headway at sorting things out so that mere mortal 
sysads can figure them out.

Have you asked/searched on Apple's boards and mailing lists? I'm pretty 
the topic has floated there in the past.

--
Joel Rees
Nothing to say today
so I'll say nothing:
Nothing.


Re: installation weirdness with Mac::Glue

2005-01-15 Thread Joel Rees
I thought I'd play around with Mac::Glue, so I fired up the CPAN shell
to install it. The installation went, in part, like this:
[...]
END failed--call queue aborted, DATA line 1.
*** malloc: vm_allocate(size=268435456) failed (error code=3)
*** malloc[10104]: error: Can't allocate region
Out of memory!
[...]
Kind of an odd-ball question, but you aren't short of disk space are 
you? what's the output of df?



Re: TextWrangler

2005-01-21 Thread Joel Rees
On 2005.1.21, at 11:38 PM, William Ross wrote:
On 21 Jan 2005, at 12:35, Jeff Lowrey wrote:
At 07:10 AM 1/21/2005, Ken Williams wrote:
See http://www.barebones.com/products/bbedit/threeway.shtml for a 
3-way comparison between BBE, TW, and BBELite.
While we're playing around with Editor Wars...
there's no need for that sort of language...
Boy,, there's nothing like a good old-fashioned editor war!
But this one doesn't seem to have much punch to it. More like a dust 
devil than a cyclone.

Visual Slick Edit v9 from http://www.slickedit.com/mac/ will run on 
OS X.
aaargh! that was horrible. 50MB download (50MB! Quark 3.3! one floppy! 
etc!), only runs under X11 (so you can't even paste in the extremely 
long temporary license key unless you save it somewhere and open it in 
an xterm). its interface reminds me of Windows 1.0 and it keeps 
offering to bind my java.

actually, to come back to the topic, it looks like it might be a 
pretty good IDE for compiled and linked projects but it doesn't seem 
to have anything to do with perl, nor much with os x either.
I have to admit, I'm more likely to download that now than I would have 
been just from Jeff's comments. An rgh! has to rate something. 
Won't be until I can afford panther (or tiger?) and some more RAM, 
though. That, or until I can find a proper download for the libraries 
for the old X11 beta. Couldn't find them last I looked.

Oh, and thanks for letting us know about TW going free, Chris. I've 
always liked BBEdit, myself, almost as much as the CodeWarrior editor. 
(Talk about twisted tastes.)

--
Joel Rees
Opinions are like armpits.
We all have two, and they all smell,
but we really don't want the other guy to get rid of his.


Re: Need to reinstall unix head utility any ideas?

2005-02-10 Thread Joel Rees
Speaking of the case insensitivity issue, is anyone here experimenting 
with the case sensitive HFSx volume format?



Re: Suggestions to better ship Perl on OS X.

2005-02-18 Thread Joel Rees
Yes, you're right ... I suppose that Find in the Finder doesn't find 
it because /System is excluded from Find, unless you specifically 
choose it?
sudo find / -name perlfunc*


Re: Variables in external file

2005-02-18 Thread Joel Rees
On 2005.2.19, at 01:39 AM, Mark Wheeler wrote:
Hi,
Just a quick question. Is it possible to have a bunch of variables in 
a separate file and then require that file in the script file? Let me 
give you and example.
--
Script file
--

#!/usr/local/bin/perl -w
use strict;
require variables.conf
print Content-type: text/html\n\n;
foreach (@list) {
print;
}
exit;
-
variables.conf
-
my @list;
I remember how my works in blocks, but I'm having trouble remembering 
how my works in files.

And I'm having trouble remembering what to do when you actually _want_ 
a declaration to have global effect. Where're my books?

$list[0] = '1';
$list[1] = '2';
$list[2] = '3';
$list[3] = '4';
$list[4] = '5';
1;
-
When I try the above script, I get an error - Global variable @list 
needs to be defined. What am I doing wrong, or is this even possible?

Thanks,
Mark



Re: could not build a module

2005-02-26 Thread Joel Rees

I will install the Xcode and see how it goes.
You know where to find it?


Re: could not build a module

2005-02-26 Thread Joel Rees

I will install the Xcode and see how it goes.
You know where to find it?

You need to become an Apple Developer connection Member thet ypu can 
dowload
a lot of development tools.
The Apple web site  for the ADC is

https://connect.apple.com
And if you don't have broadband, you can almost always find it 
somewhere in the OS install. Of course, it may not be the absolute 
latest, but it will be there.

I was just wondering if Ted knew.


Re: What Perl editor do you recommend?

2005-03-02 Thread Joel Rees
On 2005.3.3, at 07:15 AM, John Delacour wrote:
At 9:45 pm + 2/3/05, Phil Dobbin wrote:
I'm thinking that if he's not comfortable with pico maybe emacs is 
not the best idea...
I'd love to hear a convincing explanation from someone why anyone 
would use such tools in preference to TextWrangler, BBEdit or Affrus. 
I can imagine they'd make it a chore to write code in us-ascii and 
either a nightmare or an impossibility to deal with non-ascii, but 
maybe that's because I'm just an unreformed Mac user :-)
Two points, or maybe three --
One, vim can be customized to handle mult-byte characters. Emacs, can, 
too, from what I hear. I'm personally not satisfied with the results, 
but it does work, even if it's rather clumsy.

I have the impression that pico can also be customized, since there are 
a number of Japanese people who use it.

The other, vi is, as has been mentioned, almost always there, and it's 
much easier to use than ed.

Also, vi inherits a lot of powerful macro processing capabilities from 
ex/ed that are somewhat arcane, but still useable. If you're 
comfortable with vi and can keep track of the arcane syntax, it pretty 
much lets you do everything you can do in mpw.

I personally use whatever's handy, but when I edit the files under 
/etc, I usually don't really want to waste the time fiddling with 
permissions and such. And if I have to type the file path in by hand 
anyway, I might as well open up a terminal and use vi.



Re: What Perl editor do you recommend?

2005-03-02 Thread Joel Rees
Apologies for fanning the fires, but this hits kind of close to home ...
On 2005.3.3, at 07:39 AM, David Cantrell wrote:
[...]
  and either a
nightmare or an impossibility to deal with non-ascii, but maybe 
that's because I'm just an unreformed Mac user :-)
If you put non-ASCII in your code you're doing something wrong. 
Language-specific stuff - including English - belongs in a seperate 
resource file if you care about internationalisation.
Resources have to be edited with something, and it is often useful to 
be able to use REs on them.

Also, making systems and apps universal is trying to solve a problem 
that shouldn't be solved, even if the tools are useful. Even if the 
core engines of, say, a medical system can be universal, there are huge 
pieces of functionality that should _not_ be so. If you try to run a 
Japanese clinic the way an American hospital or clinic is run, you're 
not going to help very many patients. Likely to scare a number of them, 
in fact.

The guys that build the local stuff should work in their own language 
as much as possible, and that includes not just comments, but, if 
possible, identifiers, syntax, and grammar. Otherwise, they tend less 
to understand what they are doing and more to think it's all just a 
mathematical game. And they tend not to really understand re-factoring 
if it doesn't work on symbols in their own language.

Right now, comments are about all that can be dependably worked with in 
non-Latin characters, but even those, it's useful to have a full and 
accessible set of RE-type tools to work with.



Re: First CGI Setup

2005-03-12 Thread Joel Rees
Should not try to give people advice at two in the morning. I said
I've set each user's web-facing directories and files to owned by 
user, but group is the apache user. The directories that serve the 
domain root are owned by the apache user. Directory permissions are 
read/write/search (rwx) for owner, read/search (r-x) for group, no 
permissions (---) for others.
And I failed to mention the permissions on the files. Putting the files 
in the apache user group allows you to remove the read (static html) 
and execute (cgi) permissions for others if you want, which shores 
things up a bit. I don't remember if Apple gives you an apache group, 
but that's easy enough to add with netinfo if they don't.

And I said
I personally am a bit of a bigot about file extensions. I don't use 
them except for perl because I don't have to, and because I prefer to 
have all my cgi in one place.
But I should have said I don't use extensions with perl, only with php, 
because that's the way php is built. (But I don't use php at home, 
which is kind of ironic. :-/)

My reason for confining executables to a specific set of directories is 
somewhat related to my reason for not using HFS on web-facing 
partitions. It allows me a greater level of confidence that I know 
which files the server is going to expose to the web and how. Less to 
keep track of. Less chance of mistakenly treating a non-cgi file as an 
executable, and less chance of spilling source code through some slip 
in the configuration.

(And how's that for trying to keep this on-topic?)


Re: dealing with UTF8 text

2005-03-31 Thread Joel Rees
On 2005.3.31, at 10:18 AM, Avi Rappoport wrote:
Hi old friends (and new),
I'm quite enjoying getting back to scripting, and like Perl a lot, 
especially with Affrus.  While I'm probably inefficient, it's nice to 
have a language actually designed for text processing (search engine 
logs, in my case).  However, I've got some Unicode issues and that 
seems to be platform-specific, so thought I'd ask here.
Have you done perldoc perlunicode and used that as a lullaby for 
several afternoon naps in a row? Used the stuff referred there for a 
few more afternoon naps? (perldoc always seems to put me to sleep, but 
if I don't open it up and stare at it in spite of the soporific effect, 
nothing seeps in at all.) Have you gone to unicode.org and scanned what 
they have to offer relevant to the character ranges (languages) you 
need to be parsing? Have you looked up the traditional encodings for 
your language/locale, particularly the microsoft (bleaugh) code pages? 
(Google or your other favorite search engines can help.)

I've done enough research to know that I should avoid hardcoded 
counting with positions and use the perl functions which will 
automatically handle utf8 characters properly.  That's cool.  I'm 
pretty sure I'm reading in utf8 and comparisons seem to work.
Comparisons can seem to work when the encoding is all off, as long as 
the input is being munged the same way in all inputs. That doesn't mean 
it will work for all valid input, however.

What I can't do is generate readable cross-platform output to show my 
clients.
Nothing necessarily surprising there. It takes quite a bit of tuning 
your brain to get the code right. (I speak from experience with 
Japanese encodings. ;)

 Even opening the output in BBEdit as UTF8 doesn't convert the codes 
into properly rendered extended characters, and by the time it gets 
into Excel on their Windows workstation, all hope is pretty much gone.
BBEdit, IIRC, handles some of the  traditional encodings fairly well. 
(Does quite well with the Japanese encodings, at any rate.) So if you 
are opening UTF-8 and it isn't looking right, your output is probably 
not UTF-8. If you check the options in the file opening dialogs, you 
may find a way to convert from the actual encoding you're writing out. 
And/or you should be able to adjust your perl, but we can't help you 
with that unless we see some code and have some idea what 
encoding/language/locale you're trying to write out.

Incidentally, in many of the traditional encodings, the basic Latin 
will be in the some positions (same code points) as UTF-8 Unicode basic 
Latin.

The stuff that looks like HTML entities is fine when viewed in a 
browser:

#1575;#1604;#1578;#1593;#1575;#1585;#1601;
s#305;emens
And if necessary, I can deliver in HTML.
But my logs have characters like this in them:
(from BBEdit as UTF8:)
   
atualizao
carreo
(from BBEdit as Mac Roman)
   
atualizao
torunn tmmervold
lschen
I can tell they mean something, but I can't figure out how to make 
them readable.  Help?

TIA,
Avi



Re: Tiger version

2005-04-11 Thread Joel Rees
As far as perl goes, I always install a parallel perl for my dev stuff, 
so I don't have to mess with the system install.

If you are anxious for Tiger, you can pay USD 500 for the privilege of 
testing pre-release versions. If you do lot of development for the Mac, 
it's worth the price. I've done it once, just haven't been able to get 
involved enough in Mac development to pay for the next one.

Found myself wondering what to do with all the CDs, also found myself 
wishing I could afford more hardware for running the pre-release 
software on.



Re: keychain

2005-04-22 Thread Joel Rees
On 2005.4.21, at 09:15 PM, Ken Williams wrote:
Hi Joseph,
In my address book, I've got several of those too.  I believe they're 
certificates from people who have signed their messages.  If you don't 
know them, they're probably on a list you're on.
That's definitely a possibility.
It bugs me that Apple lumps things together like this because there's 
another possibility as well. If spam comes with a certificate, what do 
you suppose might happen?

It's a bit of a pain, but I would prefer the keychain, in the default 
settings, prompted the user before storing any certificates. I'd also 
like to be able to set it to prompt before storing addresses, as well, 
but that's just something I can live with. When it stores certificates 
I don't know anything about, the chain of trust tends to have even less 
to do with me. Some things simply can't be mechanized.

 -Ken
On Apr 19, 2005, at 11:31 PM, Joseph Alotta wrote:
Hi Everyone,
I looked at man security, just for kicks and I dumped the keychains.  
I was suprised to find email addresses for people who I do not know.  
I am a single user powerbook with dial up 56k access.
Is this normal to have email keychain data for people I do not know?

I could post those emails, but in case they're legitimate, I don't 
want them to get spammed.  Any suggestions?

Joe.
On Apr 19, 2005, at 7:47 PM, Ken Williams wrote:
Yeah, check out the 'security' command-line program.  I use it in 
conjunction with Module::Release so that I don't have to type my 
PAUSE password every time I upload something to CPAN - it just 
fetches the password from my keychain.

 -Ken
On Apr 19, 2005, at 5:01 PM, Larry Landrum wrote:
I need to authenticate users in a perl CGI and was hoping to use 
the Keychain but can't find a perl way to do that. Has anybody done 
that before?





Macperl list false advertising?

2005-05-02 Thread Joel Rees
Anyone know why
http://www.perl.org/community.html
describes the macperl list as Mac Perl - OS 7-9 and X discussion


Re: Macperl list false advertising?

2005-05-03 Thread Joel Rees
On 2005.5.3, at 11:04 AM, Marc Manthey wrote:
On May 3, 2005, at 2:17 AM, Joel Rees wrote:
 Mac Perl - OS 7-9 and X discussion
joel,
have  you heard from apple ? its a small company from
cupertino that build  some cool mahines.
They started  from system 7.0 to 10.4 and there was a major change
from 9 to osx;)
Thank you, marc. I do appreciate it when people let me know I have 
assumed something is more obvious than it is:

http://www.perl.org/community.html
==
...
a href=http://lists.perl.org/showlist.cgi?name=macperl;Mac 
Perl/a - OS 7-9 and X discussion
...

==
The macperl Mailing List
Name:macperl
Summary:Main discussion list for MacPerl, the port of perl on 
Mac OS (Classic)

The reason this comes up is a recent post to the macperl-forum and 
macperl-modules lists looking for some help compiling mp3::info, or for 
someone willing to share a pre-compiled module. I may be wrong, but I'm 
pretty sure he wanted this list instead of that.

--
Joel Rees
even though much of what I do is not sensible
it does make sense if you know why ...


Re: Installing WebService::GoogleHack

2005-05-18 Thread Joel Rees
On 2005.5.18, at 09:53 PM, Lola Lee wrote:
[...]
Now, $! . . . what does this do?  I looked in perldebtut and it says 
that ! means, redo a previous command, but what is the purpose of 
$?  And, where should I be putting this in, again?
Just so this doesn't get lost in the wash, $! is a special variable. 
(Has nothing to do with the ! command explained in perldebtut.) The 
contents of the special variable $! is the text version of the error 
message of the last error which occurred.

There's a whole swarm of these special variables that use the $ sign 
with punctuation, including $_ . There are even some that are hashes or 
arrays, rather than scalars, and begin with % or @ instead of $.

For more information, type
perldoc perlvar
at the command line.


Re: CamelBones on Intel? Maybe not.

2005-06-06 Thread Joel Rees
I know what you mean, Sherm. Wish I could send you something to push 
into the iNTEL Mac world with, but I'm in the same position as you. 
Hope you can find a place that can see the value in understanding perl 
from the inside. If Perl 6 moves ahead, perl might go into the embedded 
world the way java hasn't yet really gone.


For me, the computer industry just lost its last little bit of shine. 
I'm looking for a new career. Any general purpose computers I buy will 
run AMD since I doubt I'll be able to afford PPC hardware, and I'll be 
scratching Mac OS X from this old iBook this weekend. Not sure if I'll 
load Linux or openBSD on it, since it's my server.


Jobs is insane.

--
Joel Rees
Nothing to say today
so I'll say nothing:
Nothing.



Re: CamelBones on Intel? Maybe not.

2005-06-07 Thread Joel Rees


On 2005.6.7, at 11:13 PM, Robert wrote:


Wiggins d'Anconia [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

Ian Ragsdale wrote:

On Jun 6, 2005, at 5:18 PM, Joel Rees wrote:


Jobs is insane.



I'm not so sure about that.  IBM seems unwilling or unable to produce
mobile G5s, which is a market that Apple considers very important.
They also are 2 years behind schedule on 3.0Ghz G5s, and appear to be
focusing on video game processors instead of desktop and mobile
processors.

Apple might be OK in a speed comparison right now (on desktops, they
are clearly losing in laptop comparisons), but how about in two  
years?
Perhaps IBM has told Apple that they won't attempt a laptop  chip, 
since
the volume is way higher for video game consoles?  What  should 
Apple do?




They should have released Mac OS X for Intel as soon as they had it
ready. Why wait? It seems Apple is too caught up in their own keynotes
to understand volume sales. One thing M$ was definitely *always* 
better

at. IBM will probably laugh this one to the bank, not exactly going to
put a dent in that $99 billion in revenue...



Because it wasn't ready


Five years and it still isn't ready?

That's exactly why they shouldn't have kept it hidden in the lab if 
they were going to be doing it.



 and obviously after watching the keynote they are
still working on some
things. They are trying (and it looks good so far) to make the 
transition as

painless as possible.

I think it is a good move.


If they were just saying, okay, we have had so many people begging for 
Mac OS X on iNTEL, we're going to give it to them and charge them 
double for running it on non-Apple hardware, that would be a good move.


Moving everything to the monoculture is not a good move.

Personally, it looks like it will be a bit painful for a few years,  
but

a far better move in the long run.



Unless they become just another cheap clone maker with a pretty 
software

interface. (Did I hear someone say Sun?)



Apple is not Sun in any sane comparison.


You think?


Ian



http://danconia.org









Re: CGI script running as a given user?

2005-06-07 Thread Joel Rees


On 2005.6.7, at 11:51 PM, Rich Morin wrote:


I've got a Perl CGI script that acts as a system browser.
For example, it can look at files and directories and say
interesting things about them.  This works fine, as long as
the files are world-readable, but fails (because Apache runs
as 'www') as soon as the user wanders into private areas.

One answer to this is to launch a small-footprint web server
that runs as the current user.  The CGI would run under that
server and all would be nifty and cool (well, not really,
but OK :-).

I'm wondering if I've overlooked a way to get Personal Web
Sharing (aka Apache) to handle this for me.  Something like
have the user authenticate via https, then launch a given
CGI script with that user's uid.


There's an apache module that does exactly that. I think it's called 
suexec or something like that. But you want to read the documentation 
carefully, because it has a lot of security issues that you have to 
understand.




  1   2   >