Re: unix tip of the week

2002-12-15 Thread Puneet Kishor
On Sunday, December 15, 2002, at 06:06  PM, Riccardo Perotti wrote:


Puneet:

I just got my first "unix tip of the week"! (thanks to *your* tip)

I remember you said you used a script which placed each tip in some
browsable environment for future reference or something like that.

Would you care to share that script with me/us?



well, this is really very simple... geeks, please don't laugh. this is 
for newbies only.

1. I have a directory called unixtips.
2. I have the following files -- index.html, toc.pl, tipdetail.pl, 
unixtips.txt (files shown below)
3. index.html is a simple frame of two columns with a table of contents 
on the left (toc), and the main body for the tip on the right 
(tipdetail)
4. unixtips.txt contains the tips I copy from my email. Each tip starts 
with the words "TIP: " and ends with . Any code that one types is 
bounded by -- before and after.
5. that's it. ;-) I told you, it was simple. You can see the tips I 
have collected at
209.83.8.226/unixtips/index.html. The site is for personal use only, so 
don't be sending a dos attack against it ;-).

== index.html ==






== toc.pl ==
#!/usr/bin/perl -w
use strict;
use CGI::Pretty qw(:standard);
#use CGI::Carp qw(fatalsToBrowser);
$|++;

print header, start_html;
&toc;
print end_html;

sub toc {
open FH, "unixtips.txt" or die "can't open tips";
my $i = 1;
print "";
while () {
  if (s/^TIP: //) {
print "$_";
$i++;
  }
}
print "";
}

== tipdetail.pl ==
#!/usr/bin/perl -w
use strict;
use CGI::Pretty qw(:standard);
$|++;

my $tipnum = param("tipnum");

print header, start_html;
if ($tipnum ne "") {
  &detail($tipnum);
} else {
  print "Please choose a tip";
}
print end_html;

sub detail($tipnum) {
my $tipnum = shift;
my $i = 1;
my $tipflag;
my $codeflag = 0;
open FH, "unixtips.txt" or die "can't open tips";
  print "";
while () {
  if (/^TIP:/) {
$tipflag = ($i == $tipnum) ? 1 : 0;
$i++;
}
if ($tipflag) {
if (s/^TIP: //) {
print "$_";
} elsif (/^--/) {
$codeflag = ($codeflag == 0) ? 1 : 0;
if ($codeflag) {
print "";
} else {
print "";
}
if ($codeflag) {
print "$_" if (!/^--/);
}
} else {
print;
}
}
}
  print "";
}

== unixtips.txt ==
TIP: GETTING IPs FROM IFCONFIG

You can use ifconfig to lookup IP addresses bound to your box.
If you do not want to search the output from ifconfig, use the
following command to get just the IP listing.

--
ifconfig | awk '/inet/{print $2}' | awk -F: '{print $2}'
--



TIP: PATHS EASIER TO READ

Are your

--
% echo $PATH
--

and

--
% echo $LD_LIBRARY_PATH
--

unreadable?  Try this to make for something that is much easier
to read:

--
echo $PATH | tr ":" "\n"
--



TIP: COMMENT OUT MULTIPLE LINES



Re: browser compatibility (was Re: new to unix: basic help)

2002-12-15 Thread Chris Devers
On Sun, 15 Dec 2002, Riccardo Perotti wrote:

> ...and sorry for taking this list so off-topic ...

Nah, don't worry about it -- at least you didn't bring up Python :)

...zope zope zope zope zope... :)



-- 
Chris Devers[EMAIL PROTECTED]

If God had not given us sticky tape, it would have been necessary to invent it.




Perl Music (was new to unix: basic help)

2002-12-15 Thread Riccardo Perotti
On 12/14/2002 7:21 PM, Chris Devers wrote:

> On Sat, 14 Dec 2002, Sherm Pendley wrote:
> 
>> On Saturday, December 14, 2002, at 04:44 PM, Riccardo Perotti wrote:
>> 
>>> But no, there's no way I'm giving up music ...
>> 
>> You know... people use Perl to write poetry... why not music?
> 
> Indeed.
> 
> http://search.cpan.org/author/FOOCHRE/MIDI-Realtime-0.01/Realtime-0.01/Realtim
> e.pm
> 
> There may be others as well, but MIDI::Realtime is pretty neat... :)
> 
I've been long considering doing music with Perl, but I always thought of it
as *the lyrics* being written in Perl and probably even compile .. and maybe
even output something ... and even something meaningful ... or beautiful ...
you know, like some Perl poetry I've seen around (there was something
beautiful in the march edition of The Perl Review).

As to the "musical part of music" (!), I mean the MIDI stuff and such, I
haven't really looked into that, mainly because we have so much good
professional software that it'd seem like reinventing the wheel.

Please take that last statement as coming from a musician, ie: "people who
bought their first Macintosh computer to be able to run their first Opcode
Systems or Mark of the Unicorn music software". I know I could probably put
together a Perl version of "Studio Vision" now, but I bought that license 10
years ago!

Anybody care to share their experiences with Perl + Music and/or their
vision of how both can be put together?

Maybe we can start a project: put music to Perl poetry ... print CDs and
sell them to the Perl community ... start a www.perlmusicians.com or
www.perlmusicmongers.com ... (TMTOWTDI!)

Riccardo


PD: I'm going to check out MIDI::Realtime and other MIDI modules anyway ...
I've been putting it off for too long.
--
mailto:[EMAIL PROTECTED]
http://www.riccardoperotti.com





Re: unix tip of the week

2002-12-15 Thread Martin Redington

That's not the most helpful pointer for a newbie that I've ever seen :-)

Don't they have browsable/searchable back issues on unix tip of the day?

On Monday, December 16, 2002, at 12:06 AM, Kris Wolff wrote:


The method is:

1.
pop3 your email.
Filtering the mail
Download the mail
Store it in a database or text-based file architekture

2.
Build up a cgi that can access the db or textfiles
Print out the single files or entrys
A serch routine


I am shure everyone helps you in the list.


Kris


On 16.12.2002 1:06 Uhr, "Riccardo Perotti" <[EMAIL PROTECTED]> wrote:


Puneet:

I just got my first "unix tip of the week"! (thanks to *your* tip)

I remember you said you used a script which placed each tip in some
browsable environment for future reference or something like that.

Would you care to share that script with me/us?





Re: unix tip of the week

2002-12-15 Thread Kris Wolff
The method is: 

1.
pop3 your email.
Filtering the mail
Download the mail
Store it in a database or text-based file architekture

2.
Build up a cgi that can access the db or textfiles
Print out the single files or entrys
A serch routine


I am shure everyone helps you in the list.


Kris


On 16.12.2002 1:06 Uhr, "Riccardo Perotti" <[EMAIL PROTECTED]> wrote:

> Puneet:
> 
> I just got my first "unix tip of the week"! (thanks to *your* tip)
> 
> I remember you said you used a script which placed each tip in some
> browsable environment for future reference or something like that.
> 
> Would you care to share that script with me/us?
> 
> Thanks
> 
> Riccardo
> --
> mailto:[EMAIL PROTECTED]
> http://www.riccardoperotti.com
> 
> 




unix tip of the week

2002-12-15 Thread Riccardo Perotti
Puneet:

I just got my first "unix tip of the week"! (thanks to *your* tip)

I remember you said you used a script which placed each tip in some
browsable environment for future reference or something like that.

Would you care to share that script with me/us?

Thanks

Riccardo
--
mailto:[EMAIL PROTECTED]
http://www.riccardoperotti.com





Re: browser compatibility (was Re: new to unix: basic help)

2002-12-15 Thread Riccardo Perotti
Thank you guys for all your suggestions.

After (not) much though, I decided that the best thing to do is was to skip
the browser detection all together, since it really just boils down to the
size of the center frame, which is not as mission critical as it was when I
wrote this page (to tell the truth, I didn't really notice a big difference
anymore!).

...and sorry for taking this list so off-topic ...

kindest regards,

Riccardo


--
mailto:[EMAIL PROTECTED]
http://www.riccardoperotti.com





Re: Test Mac::Carbon build for me?

2002-12-15 Thread David H. Adler
On Sat, Dec 14, 2002 at 06:09:08PM -0500, Chris Nandor wrote:
> In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] (David H. Adler) wrote:
> 
> > Test results for os 10.2.2, perl 5.6.0:
> 
> > t/Carbon...## Component Manager: attempting to find 
> > symbols in a component alias of type (imdc/MP42/MSFT)
> > ok
> 
> I am not entirely sure what it is, but some component you are loading is 
> printing this information out, probably to STDERR.  I don't know that 
> there's anything I can do about it from Mac::Carbon, and it doesn't affect 
> the tests.
 
Well, *I* can live with it. :-)

> > MacPerl/t/MacPerl..## Component Manager: attempting to find 
> > symbols in a component alias of type (imdc/MP42/MSFT)
> > Use of uninitialized value in pattern match (m//) at blib/lib/MacPerl.pm line 
> > 144.
> > Use of uninitialized value in substitution (s///) at blib/lib/MacPerl.pm line 
> > 145.
> > Use of uninitialized value in substitution (s///) at blib/lib/MacPerl.pm line 
> > 146.
> > # Failed test (MacPerl/t/MacPerl.t at line 88)
> > #  got: undef
> > # expected: '3'
> 
> Hm.  I thought maybe this was a problem in 10.1.x, but apparently not, since 
> you're using 10.2.2.
> 
> Did you run the test from Terminal.app on the local machine?

yep.  I redirected the test results to a file for easier posting, but
IIRC, got the same thing without that.  If that even is an issue.

dha
-- 
David H. Adler - <[EMAIL PROTECTED]> - http://www.panix.com/~dha/
I bet if I cover my ears, this sounds a *lot* less like crap.
  - Tim Jones, http://www.bobbins.org/d/2918.html