Re: [SLUG] great code to learn from - request

2005-09-21 Thread Rajnish



Benno wrote:


So I think in the tradiation of anti-partterns, it is best to ask,
which code sucks and why, and then try to avoid doing that.
 

I recall reading something similar in a M$ publication a long time ago. 
One has to go through
many iterations bad code/design before one recognises one that is good 
(great ?). I guess that means

learning from others' and your own mistakes  experiences.

Hasn't made me a better developer yet, though.

Regards,
Rajnish


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from

2005-09-21 Thread Taryn East
* Erik de Castro Lopo [EMAIL PROTECTED] spake thus:
 Just about any language can be made to look good by applying
 to a small problem that suites the language. Large projects
 tackling large difficult problem domains test the language 
 and the developer much more that toy problems.

good point.

So, to consider something particularly large - what about the linux
kernel itself? yes I know - not python, but I am interested in the
general case as well - though maybe skip the assembler bits.

are there bits of it that have been done exceedingly well... 


Cheers,
Taryn



-- 
This .sig temporarily out-of-order.
We apologise for any inconvenience
- The Management
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from - request

2005-09-21 Thread Erik de Castro Lopo
Benno wrote:

 On Wed Sep 21, 2005 at 13:09:52 +1000, Taryn East wrote:
 what nobody else is going to bite? :(
 
 I think this is because great code is code is due to the absence
 of suckiness rather than the presence of brilliance. At least
 IMHO.[1] 
 
 So I think in the tradiation of anti-partterns, it is best to ask,
 which code sucks and why, and then try to avoid doing that.

Years ago (like 1998 or so) I had a look at the then current
Procmail sources. Those were truely blecherous. Indentation
was totally random, there was repeated chunks of code all 
over the place etc etc. 

I ran away screaming.

Erik
-- 
+---+
  Erik de Castro Lopo
+---+
I saw `cout' being shifted Hello world times to the left 
and stopped right there. -- Steve Gonedes
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from - request

2005-09-21 Thread Rick Welykochy

Rajnish wrote:




Benno wrote:


So I think in the tradiation of anti-partterns, it is best to ask,
which code sucks and why, and then try to avoid doing that.
 

I recall reading something similar in a M$ publication a long time ago. 
One has to go through
many iterations bad code/design before one recognises one that is good 
(great ?). I guess that means

learning from others' and your own mistakes  experiences.

Hasn't made me a better developer yet, though.


My rule of thumb is that three iterations result in a reasonable
low-bug high-reliablity product. (Of course, provided you and/or your
team are competent! MS programmers need not apply)

First iteration: really just a prototype that reflects the first design
often developed with RAD tools with scant regard for optimisations

Second iteration: this is probably an alpha version, that moves to
   beta status and is inflicted upon your users/public

Third iteration: this is the chance we'd all like to have, and sometimes
   do get: redesign and recode the parts of the product you now know
   are sucky due to feedback from the Real World (TM)

These iterations are not 'releases', but major major redesigns and recodings.
I consider myself lucky if I can get time/funding/resources to get to the
Third Iter, but usually, the enterprise stops at the Second. For a brand
new idea, I think that only a fool would eschew iters First and Second.


cheers
rickw



--
_
Rick Welykochy || Praxis Services

Failure is not an option, it comes bundled with every Microsoft product.

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from - request

2005-09-21 Thread Taryn East
* QuantumG [EMAIL PROTECTED] spake thus:
 I heard someone bitching the other day that gtk+/python apps are slow.  
 Not been my experience, but if you're sufficiently bored, why don't you 
 download some and see for yourself?

I guess my point was that there are so many out there to choose from,
and time is finite. So I figured if there are better ones out there I
should start with those, or, in the case of C, continue on with those.


For me the C is more important. My python is little enough that I am
still figuring out the basics - but with C - I know the basics, I'm
fairly reasonable already... what I want to know is how to turn myself
into a brilliant C-hacker and the one good way, I figure, is to study
the work of other brilliant C-hackers... and thus learn a few things.

randomly hacking my way through mediocre C and stumbling across new
tricks by accident seems to be a little more ad-hoc than it should have
to be.

:)

Cheers,
Taryn


-- 
This .sig temporarily out-of-order.
We apologise for any inconvenience
- The Management
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from - request

2005-09-21 Thread Ian Wienand
On Wed, Sep 21, 2005 at 03:55:06PM +1000, Benno wrote:
 On Wed Sep 21, 2005 at 13:09:52 +1000, Taryn East wrote:
 what nobody else is going to bite? :(
 
 I think this is because great code is code is due to the absence
 of suckiness rather than the presence of brilliance. At least
 IMHO.[1] 

 Fools ignore complexity. Pragmatists suffer it. Some can avoid
 it. Geniuses remove it.
From SIGPLAN Notices Vol. 17, No. 9, September 1982, pages 7-13.

So the best code is code you look at and say is that it - I could
have done that, even though you probably couldn't have.

If you're interested in systems, I'd suggest starting with an
intermediate step of some good books first, the obvious ones that
spring to mind are

Lions' Commentary on UNIX 6th Edition, with Source Code - John Lions
Advanced Programming in the UNIX Environment - Stevens
TCP/IP Illustrated - Stevens
Linux Kernel Development - Robert Love (top levels of the kernel)
IA-64 Linux Kernel - David Mosberger (how an architecture really works)

Once you've got some idea jump in and start programming something.
Follow Rusty's driver tutorial from LCA, write toolbars for Mozilla,
fix that annoying bug in Gnome.  You'll soon see how things hang
together, and identify what is good and what isn't.  It's like
learning a musical instrument; you can read about guitar technique
(and that's certainly part of it) but you really need to sit there and
strum the thing to get any good.

-i



signature.asc
Description: Digital signature
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] great code to learn from - request

2005-09-21 Thread Taryn East
* Benno [EMAIL PROTECTED] spake thus:
 I think this is because great code is code is due to the absence
 of suckiness rather than the presence of brilliance. At least
 IMHO.[1] 

make sense - but surely there's some code around that has had the
greatest amount of suckiness removed... or at least enough that it's
better than most.

 So I think in the tradiation of anti-partterns, it is best to ask,
 which code sucks and why, and then try to avoid doing that.

ok, so what are your thoughts? :)

and, in the same vein, does that stupid things students do emailing
list (I think it was a KEG thing) still exist?

I've been making do with thedailywtf.com but it doesn't always have the
same ring to it. :)


Cheers,
Taryn


-- 
This .sig temporarily out-of-order.
We apologise for any inconvenience
- The Management
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] debsig is on!

2005-09-21 Thread Robert Collins
Due to a scheduling hiccup no debsig has been announce, and Mind Control
is happening in DebSigs normal slot...

So come along, and you *WILL* have fun. Guaranteed, send no money now,
and we'll throw in ...

Rob
-- 
GPG key available at: http://www.robertcollins.net/keys.txt.


signature.asc
Description: This is a digitally signed message part
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] great code to learn from - request

2005-09-21 Thread Rick Welykochy

Taryn East wrote:


I've been making do with thedailywtf.com but it doesn't always have the
same ring to it. :)


I read the dailyWTF for sheer entertainment value :)
I wonder why 90%+ of the examples are from Windows developers?

The site is a great source of antipatterns.


cheers
rickw


--
_
Rick Welykochy || Praxis Services

Failure is not an option, it comes bundled with every Microsoft product.

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] Accidental mouse gestures in Firefox driving me insane.

2005-09-21 Thread Mike MacCana
Hi all,

Firefox keeps randomly going back. It seems to be some kind of mouse
gesture triggered by my trackpad. I'd like to disable gestures in FF
completely. 

I can't find the option in the GUI or about:config.

I've tried with an extension, All In One Gestures, but it doesn't seem
to be working.

Mike

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Accidental mouse gestures in Firefox driving me insane.

2005-09-21 Thread Ian Wienand
On Wed, Sep 21, 2005 at 04:42:49PM +1000, Mike MacCana wrote:
 Firefox keeps randomly going back. It seems to be some kind of mouse
 gesture triggered by my trackpad. I'd like to disable gestures in FF
 completely. 

Do you have horizontal scrolling on your trackpad?  The same thing
happened to me when I switched over to a mouse with horizontal scrolling.

This tip

http://www.macosxhints.com/article.php?story=20050821141856688lsrc=osxh

fixed it for me.

-i


signature.asc
Description: Digital signature
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] Re: wifi router

2005-09-21 Thread Shaun Butler
I recently acquired a couple of WRT54G routers to create a wireless
network at home. I've flashed one of them with the dd-wrt firmware. The
great thing about using the open source firmwares out there like dd-wrt
and OpenWRT is that you can turn your router into anything you want -
router, access point, wireless ethernet bridge, making it a very
versatile piece of kitOn 9/20/05, Matthew Palmer [EMAIL PROTECTED] wrote:
On Mon, Sep 19, 2005 at 12:44:24PM +0200, Gottfried Szing wrote: Hi again The good thing about OpenWRT is that you can install it and use the hardware for something else than the factory programmed
 functionalities. I recently installed Asterisk PBX on it. It's a quite sweet device. For good or bad, it could run Apache as well (lacks persistant memory space though). i forgot to ask in the last mail: have you used the packages that are
 availble via ipkg or a different piece of software? is this software stable enough for home-usage?Rock solid for me.- Matt--SLUG - Sydney Linux User's Group Mailing List - 
http://slug.org.au/Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] great code to learn from - request

2005-09-21 Thread Erik de Castro Lopo
Taryn East wrote:

 what nobody else is going to bite? :(
 
 I felt for sure there'd at least be one person self-promoting: 
 my code is briliant, you should come see it in my project foo ;)

I've spent many long hours on libsndfile:

http://www.mega-nerd.com/libsndfile/

It had its first release in 1999, has gone through a number
of major internal refactorings, has gone through one API
revision and has code contributions (small) from over 20
developers.

This is whats interesting in libsndfile:

  - A well designed API. I often get compliments on how
easy it is to get soemthing going with a minimum of
fuss. Contrast this with using the Ogg and Vorbis
libraries.
  - Easily extensible internal structure so that new file
formats and data encodings can be added relatively 
easily. New formats never change the public API.
  - Handles data in big and little endian formats and runs
on big and little endian CPUs.
  - Contains two separate uses of stdargs.
  - A comprehensive test suite. My guess is that this 
suite covers about 90% of all code paths.

Erik
-- 
+---+
  Erik de Castro Lopo
+---+
... a discussion of C++'s strengths and flaws always sounds 
like an argument about whether one should face north or east 
when one is sacrificing one's goat to the rain god. 
-- Thant Tessman

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from - request

2005-09-21 Thread james
 I'm asking for anybody's opinion of code that they think is worthwhile to
 look at. It doesn't have to be universally accepted as being perfect
 (though that would be really good if you know of any) just what you
 have found to be really great.

 cheers,
 Taryn
 [who is trying to prod a sleeping tiger...]

Have you looked at the sources for TeX? I haven't myself, not being a C coder, 
but
iirc nobody's found a bug in it for about a decade. Knuth is certainly a
highly-regarded programmer, so it could be worth a look.


Cheers,
James

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


RE: [SLUG] Presentation Mind Control - 21st September 2005

2005-09-21 Thread Michael Kraus
Oscar,

Have you grown too technical and too old to have a sense of humour
anymore?

Lighten up - the talk is obviously on conference presentation.

Rafael Kraus
Software Developer
Wild Internet  Telecom
[EMAIL PROTECTED]
02 8306 0088 Technical Support
02 8306 0077 Sales | 02 8306 0099 Fax
02 8306 0055 Administration
1300 13 WILD (9453) National | 1300 13 WILD (9453) Fax
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of O Plameras
 Sent: Wednesday, 21 September 2005 10:42 AM
 To: Jacinta Richardson
 Cc: slug@slug.org.au
 Subject: Re: [SLUG] Presentation Mind Control - 21st September 2005
 
 Jacinta Richardson wrote:
 
 G'day everyone,
 
 You are invited to join us in a talk by Paul Fenwick about 
 Presentation 
 Mind Control - how to make other people think your talk is 
 much better 
 than it really is.  Come and learn some great tips on how to 
 improve your presentations.
 
 
   
 
 
 Just a friendly comment to say the use of Mind Control and 
 make ... 
 people think ...your talk...
 is better than ... it is  are  words that do not sync well 
 with technical people and are hardly acceptable as modes of 
 conduct or behaviour to  many  technical persons. That's 
 probably why some people are so emphatic in their comments.
 
 In my view, it is impossible to achieve high technical 
 discipline and honesty when entertaining the use of Mind 
 Control and espousing the philosophy of let's get people to 
 think my product or service is better than it actually is'. 
 It strikes at the heart of one's honesty, credibility, and 
 reliability.
 
 Just the same I intend to be present in this afternoon's 
 presentation to find out for myself.
 
 If you've check this page you'll know one of the many reasons 
 as to what I mean:  
 
 http://en.wikipedia.org/wiki/Mind_control
 
 The intention of this post is to clarify why it is so 
 controversial and generates a lot of heat.
 
 Don't mean to offend anyone.
 
 O Plameras
 
 
 Conference Presentation Mind Control
 
 At the heart of any good conference are its presenters.  To 
 learn new 
 skills and discover new ideas are what conferences are all 
 about -- at 
 least that's what you tell your boss when you apply for funding.  
 Presenting is a rewarding, and often prestigious activity, 
 but some speakers seem to do it better than others.
 
 Paul Fenwick shares his experiences of almost a decade of 
 teaching and 
 public speaking.  Discover how to keep your audience's 
 attention, how 
 to improve your presentation techniques, and how to use mind 
 control to 
 get others to do your bidding.
 
 
 Details
 ===
 When:  6:30pm, 21st September 2005
 Where: James Squires Brewhouse
2 The Promenade,
King St Wharf
Sydney
 Fee:   $0.00
 
 
 
 This event is hosted by the Sydney Perl Mongers.  Also 
 presenting will 
 be Andrew Savige discussion Damian Conway's newest book: 
 Perl Best Practices.
 
 Everyone is welcome.
 
 All the best,
 
Jacinta
 
   
 
 
 
 --
 O Plameras
 http://www.acay.com.au/~oscarp/tutor
 
 --
 SLUG - Sydney Linux User's Group Mailing List - 
 http://slug.org.au/ Subscription info and FAQs: 
 http://slug.org.au/faq/mailinglists.html
 




Wild Technology Pty Ltd , ABN 98 091 470 692
Sales - Ground Floor, 265/8 Lachlan Street, Waterloo NSW 2017
Admin - Level 4 Tiara, 306/9 Crystal Street, Waterloo NSW 2017
Telephone 1300-13-9453 |  Facsimile 1300-88-9453
http://www.wildtechnology.net
DISCLAIMER  CONFIDENTIALITY NOTICE:  The information contained in this email 
message and any attachments may be confidential information and may also be the 
subject of client legal - legal professional privilege. If you are not the 
intended recipient, any use, interference with, disclosure or copying of this 
material is unauthorised and prohibited.   This email and any attachments are 
also subject to copyright.  No part of them may be reproduced, adapted or 
transmitted without the written permission of the copyright owner.  If you have 
received this email in error, please immediately advise the sender by return 
email and delete the message from your system.


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


RE: [SLUG] Presentation Mind Control - 21st September 2005

2005-09-21 Thread Michael Kraus
 3) Unfortunately, Jacinta earnt her bile.

And here I was thinking that enough bile would be produced in Jacinta's
own liver.

Rafael Kraus
Software Developer
Wild Internet  Telecom
[EMAIL PROTECTED]
02 8306 0088 Technical Support
02 8306 0077 Sales | 02 8306 0099 Fax
02 8306 0055 Administration
1300 13 WILD (9453) National | 1300 13 WILD (9453) Fax
 





Wild Technology Pty Ltd , ABN 98 091 470 692
Sales - Ground Floor, 265/8 Lachlan Street, Waterloo NSW 2017
Admin - Level 4 Tiara, 306/9 Crystal Street, Waterloo NSW 2017
Telephone 1300-13-9453 |  Facsimile 1300-88-9453
http://www.wildtechnology.net
DISCLAIMER  CONFIDENTIALITY NOTICE:  The information contained in this email 
message and any attachments may be confidential information and may also be the 
subject of client legal - legal professional privilege. If you are not the 
intended recipient, any use, interference with, disclosure or copying of this 
material is unauthorised and prohibited.   This email and any attachments are 
also subject to copyright.  No part of them may be reproduced, adapted or 
transmitted without the written permission of the copyright owner.  If you have 
received this email in error, please immediately advise the sender by return 
email and delete the message from your system.


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] Gentoo

2005-09-21 Thread Gerald
Hi to all Once more.
I have been travelling around Aus for abount 15 Months and am noew settled 
down again. Its a BIG country 15 months and we saw only a small part of it.

Down to business!!!
Do any Sluggers run Gentoo?
Has anyone tried to install the Gentoo live cd?

How many answers to affirn will i get?
Thanks Gerald
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] minimal live CD

2005-09-21 Thread David
I just used a live CD for the first time (Ubuntu), and as good as it is, 
all I really want is a shell for diagnostics. It took ages to install.

Can anyone suggest a live distro that either doesn't have X at all, or has 
an option to bypass it. Naturally it would be nice if it was reasonably 
modern with most of the latest drivers etc.

I've looked at the Knoppix website, but that looks similar in concept to 
Ubuntu.

thanks...

David.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Presentation Mind Control - 21st September 2005

2005-09-21 Thread O Plameras

Michael Kraus wrote:


Oscar,

Have you grown too technical and too old to have a sense of humour
anymore?
 



You've nothing to say constructive, so don't say it here.



--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Gentoo

2005-09-21 Thread Sridhar Dhanapalan
On Wed, 21 Sep 2005 18:54, Gerald [EMAIL PROTECTED] wrote:
 Do any Sluggers run Gentoo?

I do.

 Has anyone tried to install the Gentoo live cd?

Not since 2002, when I installed my main system. That's a testament to how 
well a Gentoo system can run and be kept up-to-date, despite being 
source-based.

If you don't know what you doing, however, you can easily mess things up. I've 
found Gentoo to be a wonderful way to learn about the innards of the OS. I 
make the odd mistake from time to time, but I learn a lot in the process of 
fixing them.

If you want a system to tinker with and learn, or if you want to stay on the 
bleeding-edge, I wholeheartedly recommend Gentoo. Otherwise, you might be 
better off with a binary-based distro.


-- 
Sridhar Dhanapalan  [Yama | http://www.pclinuxonline.com/]
  {GnuPG/OpenPGP: http://dhanapalan.webhop.net/yama.asc
   0x049D38B4 : A7A9 8A02 78CB AB1B FCE4 EEC6 2DD9 249B 049D 38B4}

Don't try to be like Jackie. There is only one Jackie. Study computers 
instead. -- Jackie Chan


pgpganXvNyu4k.pgp
Description: PGP signature
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] Presentation Mind Control - 21st September 2005

2005-09-21 Thread Matthew Hannigan
On Wed, Sep 21, 2005 at 05:59:10PM +1000, Michael Kraus wrote:
 Lighten up - the talk is obviously on conference presentation.

Of course, that's just what YOU would LIKE us TO believe!



-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from - request

2005-09-21 Thread Matthew Hannigan
On Wed, Sep 21, 2005 at 01:09:52PM +1000, Taryn East wrote:
 what nobody else is going to bite? :(

Depends whether you wanted programming in the small or large.

Jon Bentley's Programming Pearls books are excellent.

Not sure whether they count as FOSS though.

Matt
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] Your browser does not support script

2005-09-21 Thread Adam Bogacki
Huh ? I've happily used internet banking with Commonwealth, St. George,
and ANZ using Epiphany, Galeon, Firefox  Mozilla but now find Moz is
the only one working and all the others are giving me variations on the
message that 'Your browser does not support Javascript'.

Yet under all the Preferences I've ticked all the correct boxes explicitly
allowing Javascript. My Gnome network proxy is set to allow direct
internet connection (unlike T*bird  F*fox I never managed to get
it working) and I'm at a loss ...

What am I missing here ?

Adam Bogacki,
[EMAIL PROTECTED]


signature.asc
Description: Digital signature
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] minimal live CD

2005-09-21 Thread Ken Caldwell
On Wed, 2005-09-21 at 19:38 +1000, David wrote:
 I just used a live CD for the first time (Ubuntu), and as good as it is, 
 all I really want is a shell for diagnostics. It took ages to install.
 
 Can anyone suggest a live distro that either doesn't have X at all, or has 
 an option to bypass it. Naturally it would be nice if it was reasonably 
 modern with most of the latest drivers etc.
 
 I've looked at the Knoppix website, but that looks similar in concept to 
 Ubuntu.

systemrescuecd-x86-0.2.15.iso has a few useful programs and fits on a
small (8cm) CD. INSERT-1.3.5a_en.iso is even smaller (50MB) and fits on
a business card sized CD. dsl-1.5.iso is a small general purpose distro
which also fits on a business card sized CD.

Puppy fits on a small USB stick. Current version is 1.0.4 with 1.0.5 due
out next week.

cheers,
Ken


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Your browser does not support script

2005-09-21 Thread Richard




pop up blocking

St George for example wont even work with IE6 sp2 unless you tell the pop up blocker to ignore the St George website (same for Firefox).

So add your banks URL to the pop up blocker allowed list.


On Wed, 2005-09-21 at 23:28 +1200, Adam Bogacki wrote:


Huh ? I've happily used internet banking with Commonwealth, St. George,
and ANZ using Epiphany, Galeon, Firefox  Mozilla but now find Moz is
the only one working and all the others are giving me variations on the
message that 'Your browser does not support _javascript_'.

Yet under all the Preferences I've ticked all the correct boxes explicitly
allowing _javascript_. My Gnome network proxy is set to allow direct
internet connection (unlike T*bird  F*fox I never managed to get
it working) and I'm at a loss ...

What am I missing here ?

Adam Bogacki,
[EMAIL PROTECTED]
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html





Regards

Richard Neal

When we speak of free software, we are referring to freedom, not price
-- Richard M. Stallman





-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] minimal live CD

2005-09-21 Thread David Kempe

David wrote:
I've looked at the Knoppix website, but that looks similar in concept to 
Ubuntu.


There are a million Knoppix variants, but if you want a Knoppix shell 
you can simply boot knoppix with knoppix 2 at the boot prompt. it boots 
runlevel 2 I think - all knoppix root shell, with all hardware and 
software available, except X.


dave
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Your browser does not support script

2005-09-21 Thread unauthorized
 Yet under all the Preferences I've ticked all the correct boxes explicitly
 allowing Javascript. My Gnome network proxy is set to allow direct
 internet connection (unlike T*bird  F*fox I never managed to get
 it working) and I'm at a loss ...

What's the gnome network proxy?

Chris-
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] minimal live CD

2005-09-21 Thread James
On Wednesday 21 September 2005 19:47, [EMAIL PROTECTED] wrote:
 I just used a live CD for the first time (Ubuntu), and as good as it is,
 all I really want is a shell for diagnostics. It took ages to install.

 Can anyone suggest a live distro that either doesn't have X at all, or has
 an option to bypass it. Naturally it would be nice if it was reasonably
 modern with most of the latest drivers etc.

 I've looked at the Knoppix website, but that looks similar in concept to
 Ubuntu.

 thanks...

David it looks as if you are quite a newby gee how do you say that kindly, 
and I do mean it so. All the distros can give you text mode. You are 
probably best off using a terminal session within X.
I think that you'd be best off using something like knoppix (dsl, puppylinux 
etc) then choosing something that suits your style/application when you have 
a better insight to what is available, what it can do, and what you want to 
do.

Most distros have tools to do the hard stuff. They are often X based. I just 
about never use anything but CLI, but an xterm is more comfortable than a 
console.

Cheers
James
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] minimal live CD

2005-09-21 Thread Peter Hardy
On Wed, 2005-09-21 at 21:30 +1000, Ken Caldwell wrote:
 On Wed, 2005-09-21 at 19:38 +1000, David wrote:
  I just used a live CD for the first time (Ubuntu), and as good as it is, 
  all I really want is a shell for diagnostics. It took ages to install.
  
  Can anyone suggest a live distro that either doesn't have X at all, or has 
  an option to bypass it. Naturally it would be nice if it was reasonably 
  modern with most of the latest drivers etc.
  
  I've looked at the Knoppix website, but that looks similar in concept to 
  Ubuntu.
 
 systemrescuecd-x86-0.2.15.iso has a few useful programs and fits on a
 small (8cm) CD.

I'll second the vote for sysrescuecd. I almost always have a copy in my
car/bag/pocket. It has a small X server, but doesn't run by default. My
only complaint with it is that the last time I did any work on SLUG's
server,  the sysrescuecd I had with me only had a 2.4 kernel. Made
playing with software RAID a bit more annoying.

 Puppy fits on a small USB stick. Current version is 1.0.4 with 1.0.5 due
 out next week.

And my other favourite distribution is Tom's rootboot
( http://www.toms.net/rb/ ). It'll fit on a floppy if you can format it
to 1.7MB (most are happy to do this). Or if you're feeling extravagant,
there's a 3MB CD boot image.

-- 
Pete

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] Heres on for the late nighters

2005-09-21 Thread James Purser
I am trying to get Skype to run through artsd and jack so I can pipe it
to an icecast client.

Below is what I got from the guy who wrote the icecast client:

This bit works fine:
jackd -d alsa -r 44100   # Or however you normally start it.
# The next line will not work if arts is suspended.  It must be stopped.

However when I try to run this bit:
artsd -F 15 -S 128 -r 44100 -a jack -d 

I get the following error:
Error while initializing the sound driver: unable to select 'jack' style
audio I/O

I'm assuming that artsd needs to have jack support built into it however
it looks like the Ubuntu version doesn't have this. Can someone confirm
this for me, and if it does and I'm just being blinded by lack of sleep,
could you let me know how to get it working correctly.

Thanks
-- 
James Purser
Chief Talking Guy - Linux Australia Update
http://k-sit.com - My Blog
http://la-pod.k-sit.com - Linux Australia Update Blog and Forums
Skype: purserj1977

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Presentation Mind Control - 21st September 2005

2005-09-21 Thread Conrad Parker
On Mon, Sep 19, 2005 at 10:03:23AM +1000, Jacinta Richardson wrote:
 G'day everyone,
 
 You are invited to join us in a talk by Paul Fenwick about Presentation Mind
 Control - how to make other people think your talk is much better than it 
 really
 is.  Come and learn some great tips on how to improve your presentations.

Hi Jacinta,

thanks for arranging this talk and for inviting SLUGgers; it was a very
interesting presentation and it was good to meet some of the local Perl
geeks.

Paul is a geek, and his presentation was for geeks. It had enough random
diagrams of brain parts and lego to entertain all the big and little
kids in the room. It was as much about how to clearly explain technical
concepts as about how to keep people's attention. It certainly wasn't
about how to make sales pitches, motivate or otherwise deceive people.

Afterwards (as was mentioned in the announcement) there was a technical
talk about best practices for Perl programming. After that we all chatted
over some games of pool, and lots of exchanging of contact details
between the Perl and SLUG crowds went on. It was a good opportunity for
like-minded geeks from different groups to meet up.

cheers,

Conrad.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] usb audio device for kernel 2.4

2005-09-21 Thread Gottfried Szing

hi slugs,

today my asus wifi router has arrived and i am going to play around with 
it this weekend. so i will try to install openwrt. because it has 2x usb 
 ports, having a standalone mp3-player with an external harddisk seems 
to be possible.


i have checked the support for external storage of linux and this works 
fine, but i havent seen a list of supported usb-audio-devices. on the 
web are hosts of pages that describe sometimes that usb-audio is no 
problem, sometimes that it is not working with all devices - always the 
same when i am looking for a new hardware for linux :)


so, has someone a usb-audio device in use?

requirements:
- linux 2.4 support (because openwrt uses this version)
- headphone mini jack. i want to connect it to my amplifier

br, gottfried
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] usb audio device for kernel 2.4

2005-09-21 Thread Rev Simon Rumble

On 21/9/2005, Gottfried Szing [EMAIL PROTECTED] wrote:

i have checked the support for external storage of linux and this works
fine, but i havent seen a list of supported usb-audio-devices. on the
web are hosts of pages that describe sometimes that usb-audio is no
problem, sometimes that it is not working with all devices - always the
same when i am looking for a new hardware for linux :)

That's because audio was very well specified in the USB spec, so for
basic audio, any device will just work.  Other features like knobs,
switches or in the case of those Skype phone handsets the keypad, will
require a special driver.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] usb audio device for kernel 2.4

2005-09-21 Thread Peter Hardy
On Wed, 2005-09-21 at 17:41 +0200, Gottfried Szing wrote:
 i have checked the support for external storage of linux and this works 
 fine, but i havent seen a list of supported usb-audio-devices. on the 
 web are hosts of pages that describe sometimes that usb-audio is no 
 problem, sometimes that it is not working with all devices - always the 
 same when i am looking for a new hardware for linux :)

The Linux-USB guys maintain a fairly large list of compatible devices at
http://www.qbik.ch/usb/devices/ .

-- 
Pete

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] gzip from perl script

2005-09-21 Thread Voytek
I'm using a Perl script for MySQL backup, I'd like to compress the
database dumps, the business end of the script runs like:

---
while (my @arr = $sth-fetchrow) {

print $arr[1]\n;
system(rm $backuppath/$arr[1]-$oldyear$oldmonth$oldday.sql);
system(mysqldump --opt $arr[1] -u $DB_User --password=$DB_Password 
$backuppath/$arr[1]-$year$month$day.sql);
}

---

do I simply add like:

system(gzip $backuppath/$arr[1]-$year$month$day.sql);
(and change the 'rm' line extension?)
?

-- 
Voytek

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] gzip from perl script

2005-09-21 Thread Gonzalo Servat
On 9/22/05, Voytek [EMAIL PROTECTED] wrote:
[snip]
 do I simply add like:

 system(gzip $backuppath/$arr[1]-$year$month$day.sql);
 (and change the 'rm' line extension?)
 ?

http://search.cpan.org

Look for the GZIP module, nicer way of doing it. Also, you probably
want to use unlink instead of that system rm command. There's probably
even a MySQL module to do the MySQL dump. Usually it's best using
those as it allows to look at return codes and it generally looks much
neater in the code.

HTH.

Cheers,
Gonzalo
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Gentoo

2005-09-21 Thread Julio Cesar Ody
I'm a FreeBSD user/sysadmin/tweak-for-fun-guy. I used slackware until
recently when I started to use Gentoo as my GNU/Linux system.

Gentoo has a package management system that resembles the BSD ports
system. If you take your time reading the Gentoo Handbook, you'll have
enough knowledge to make it less greedy. In fact, there's more of
FreeBSD in Gentoo than just that.

And no, it *doesn't* take 3 days or so to build the whole system in an
average machine if you do it from a universal install CD. You'll copy
most of the stuff into your hard disk as opposed to compiling
everything from source.

For knowledge sake, it's a great tool. If you understand what you're
doing when installing Gentoo, you'll go through LFS like a breeze (or
vice-versa, which was my case). Then understanding how
Ubuntu/Debian/Slackware/whatever works will become a lot easier.




On 9/21/05, Gerald [EMAIL PROTECTED] wrote:
 Hi to all Once more.
 I have been travelling around Aus for abount 15 Months and am noew settled
 down again. Its a BIG country 15 months and we saw only a small part of it.

 Down to business!!!
 Do any Sluggers run Gentoo?
 Has anyone tried to install the Gentoo live cd?

 How many answers to affirn will i get?
 Thanks Gerald
 --
 SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
 Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html



--
Julio C. Ody
http://rootshell.be/~julioody
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from - request

2005-09-21 Thread Taryn East
* Ian Wienand [EMAIL PROTECTED] spake thus:
 So the best code is code you look at and say is that it - I could
 have done that, even though you probably couldn't have.

good point!

 If you're interested in systems, I'd suggest starting with an
 intermediate step of some good books first, the obvious ones that
 spring to mind are
snip

thanks, I'm always on the lookout for good books. I'll add these to the
list.

 Once you've got some idea jump in and start programming something.

grin
have been for 5 years now - which I guess is part of my point: I'm not
a beginner programmer, I know how to program reasonably well. I was
hoping to find any methods that would take me beyond reasonable into
excellent...

books help with that - and I devour them regularly; programming helps,
but it's a bit of a blind search. I figured that looking at smart code
would also help.

I fully agree that actually writing it is better than reading it, but I
also figured there'd be no harm in reading good stuff on top of all the
rest :)

Cheers and thanks,
Taryn

-- 
This .sig temporarily out-of-order.
We apologise for any inconvenience
- The Management
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from - request

2005-09-21 Thread Taryn East
* Matthew Hannigan [EMAIL PROTECTED] spake thus:
 On Wed, Sep 21, 2005 at 01:09:52PM +1000, Taryn East wrote:
  what nobody else is going to bite? :(
 
 Depends whether you wanted programming in the small or large.

anything and everything will help.

 Jon Bentley's Programming Pearls books are excellent.

thanks - this sounds like a good lead.

 Not sure whether they count as FOSS though.

I only really stipulated FOSS so that I had a chance to look at the code :)

thanks,
Taryn

 
-- 
This .sig temporarily out-of-order.
We apologise for any inconvenience
- The Management
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Gentoo

2005-09-21 Thread Dean Hamstead

just for everyones info
if you want BSD style linux (and lets face it... who doesnt)
there is crux!

www.crux.nu


Dean

Julio Cesar Ody wrote:

I'm a FreeBSD user/sysadmin/tweak-for-fun-guy. I used slackware until
recently when I started to use Gentoo as my GNU/Linux system.

Gentoo has a package management system that resembles the BSD ports
system. If you take your time reading the Gentoo Handbook, you'll have
enough knowledge to make it less greedy. In fact, there's more of
FreeBSD in Gentoo than just that.

And no, it *doesn't* take 3 days or so to build the whole system in an
average machine if you do it from a universal install CD. You'll copy
most of the stuff into your hard disk as opposed to compiling
everything from source.

For knowledge sake, it's a great tool. If you understand what you're
doing when installing Gentoo, you'll go through LFS like a breeze (or
vice-versa, which was my case). Then understanding how
Ubuntu/Debian/Slackware/whatever works will become a lot easier.




On 9/21/05, Gerald [EMAIL PROTECTED] wrote:


Hi to all Once more.
I have been travelling around Aus for abount 15 Months and am noew settled
down again. Its a BIG country 15 months and we saw only a small part of it.

Down to business!!!
Do any Sluggers run Gentoo?
Has anyone tried to install the Gentoo live cd?

How many answers to affirn will i get?
Thanks Gerald
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html





--
Julio C. Ody
http://rootshell.be/~julioody


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] great code to learn from - request

2005-09-21 Thread O Plameras


Hi Taryn,

It seems to me you are looking for a project to exercise and to learn 
new tricks in
programming. Project that challenges you enough but not too much, for 
starters. An
environment  that provides feedbacks - positive, neutral, or negative or 
peer reviews

of your work.

Then,  if  I were in  your shoes  I will  check, for starters, the list  
of  Linux KERNEL
BUGS that nobody has taken ownership for some time (meaning it's too 
easy for the
regular bug hunter and fixer that they avoid doing the job), work on it, 
and if your
happy with what you've done, you publish it so others may check the 
results of your

toil, or otherwise keep it to yourself.

Then, as you get experience and confidence take on the more tricky BUG 
Fixing project.


This way you get to read real codes and truly understand it.  There's no 
better code than

working codes.

Along the way who knows you may also polish your skills in other 
disciplines like Code

Version Controls, Archiving, documentation, etc.

You may also check the bug-list of other smaller projects to work on it.

Or you even go 'Bounty Hunting' and get a prize for your programming 
effort. Check for example:


http://www.horde.org

Just an idea.

O Plameras

Taryn East wrote:


* Ian Wienand [EMAIL PROTECTED] spake thus:
 


So the best code is code you look at and say is that it - I could
have done that, even though you probably couldn't have.
   



good point!

 


If you're interested in systems, I'd suggest starting with an
intermediate step of some good books first, the obvious ones that
spring to mind are
   


snip

thanks, I'm always on the lookout for good books. I'll add these to the
list.

 


Once you've got some idea jump in and start programming something.
   



grin
have been for 5 years now - which I guess is part of my point: I'm not
a beginner programmer, I know how to program reasonably well. I was
hoping to find any methods that would take me beyond reasonable into
excellent...

books help with that - and I devour them regularly; programming helps,
but it's a bit of a blind search. I figured that looking at smart code
would also help.

I fully agree that actually writing it is better than reading it, but I
also figured there'd be no harm in reading good stuff on top of all the
rest :)

Cheers and thanks,
Taryn

 




--
O Plameras
http://www.acay.com.au/~oscarp/tutor

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] gzip from perl script

2005-09-21 Thread Jacinta Richardson
G'day Voytek,

In a spirit of defensive programming, I have an important question for you.
What happens if the mysqldump fails?  Perhaps the database goes offline part way
through, perhaps the disk fills up... since you've just deleted your old backup,
what are you going to do?

I suggest the following changes to your code:
* Take the backup first
* Check that it didn't fail
* Then do compression
* Check that it didn't fail (find out the possible failure modes,
  can it corrupt your file?  What happens if all the disk space vanishes
  half way through?
* Then, when you're fairly certain that things will be okay, delete the
  old version.


while( my ($ignored, $database) = $sth-fetchrow() ) {
print $database\n;

# Make the backup
system(mysqldump --opt $database -u $DB_User --password=$DB_Password .
 $backuppath/$database-$year$month$day.sql);

# Handle any errors
if($?) {
# something went wrong... try to guess what.
die some error as appropriate;
}

# Do the compression
system(gzip, $backuppath/$database-$year$month$day.sql);

# Handle any errors
if($?) {
# something went wrong... try to guess what.
die some error as appropriate;
}

# Now that you're fairly certain that the new backup has worked...
unless( unlink($backuppath/$database-$oldyear$oldmonth$oldday.sql.gz);
# something went wrong... try to guess what.
# This could just be that the file doesn't exist.
die if you think it's appropriate;
}
}



It might also be worth using chdir to change into $backuppath so that you don't
need to keep prepending that:

chdir $backuppath or die Failed to chdir to $backuppath $!;

You probably also want to wonder why you're pulling out a column from the
database and then ignoring it.

Whether or not it's better to use system or a module to do your compression
depends on a few things, like how easy it is to get modules installed, how easy
it is to use the module you select.  If you do use a module you're more likely
to have intuitive error handling rather than having to check one of Perl's very
super extra special variables.

All the best,

Jacinta

-- 
   (`-''-/).___..--''`-._  |  Jacinta Richardson |
`6_ 6  )   `-.  ( ).`-.__.`)  |  Perl Training Australia|
(_Y_.)'  ._   )  `._ `. ``-..-'   |  +61 3 9354 6001|
  _..`--'_..-_/  /--'_.' ,'   | [EMAIL PROTECTED] |
 (il),-''  (li),'  ((!.-' |   www.perltraining.com.au   |


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] usb audio device for kernel 2.4

2005-09-21 Thread Mark Johnathan Greenaway
On Wed, Sep 21, 2005 at 05:41:38PM +0200, Gottfried Szing wrote:
 so, has someone a usb-audio device in use?
 requirements:
 - linux 2.4 support (because openwrt uses this version)
 - headphone mini jack. i want to connect it to my amplifier

I use an Edirol UA-20 audio/MIDI interface, and it just works. It has
the features you're describing, but is probably overkill for your
application. I thought you might appreciate hearing from someone who has
worked with a USB audio interface, rather than just having read about
them.

-- 
Mark
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] gzip from perl script

2005-09-21 Thread Voytek

quote who=Jacinta Richardson

thanks, Jacinta

ahem, you assume I'm somewhat perl-literate, beyond knowing how to
paste'n'save... I'm not...

the script was kindly given to me in the past by a slugger

paste'n'save gave me an error on the last '}' in your additions, after
chopping it, I'm getting:

# perl mysqlbackup-day.pl
syntax error at mysqlbackup-day.pl line 61, near );
Execution of mysqlbackup-day.pl aborted due to compilation errors.

line 61 is:

 unless( unlink($backuppath/$database-$oldyear$oldmonth$oldday.sql.gz);

script now is:
---
#!/usr/bin/perl
use DBI;
use Mysql;
use Date::Pcalc qw(:all);


$DB_Host = localhost;
$DB_Name = mysql;
$DB_User = backup;
$DB_Password = password;
$backuppath = /backup/mysql;
$myoffset = -3; # set the number of days back to delete. Basically -number
of days you wish to keep logs rotating for.

my $dbh =
Mysql-Connect($DB_Host;database=$DB_Name;,$DB_User,$DB_User,$DB_Password)
or die $Mysql::db_errstr;

($year,$month,$day) = Today();
if (length($day)==1) {
$day = 0$day;
}
if (length($month)==1) {
$month = 0$month;
}

($oldyear, $oldmonth, $oldday) = Add_Delta_YMD($year, $month, $day, 0, 0,
$myoffset);
if (length($oldday)==1) {
$oldday = 0$oldday;
}
if (length($oldmonth)==1) {
$oldmonth = 0$oldmonth;
}

$dbh-selectdb(mysql) or die $Mysql::db_errstr;

my $sth = Query $dbh SELECT * FROM db or die $Mysql::db_errstr;

while( my ($ignored, $database) = $sth-fetchrow() ) {
print $database\n;

# Make the backup
system(mysqldump --opt $database -u $DB_User --password=$DB_Password .
 $backuppath/$database-$year$month$day.sql);

# Handle any errors
if($?) {
# something went wrong... try to guess what.
die some error as appropriate;
}

# Do the compression
system(gzip, $backuppath/$database-$year$month$day.sql);

# Handle any errors
if($?) {
# something went wrong... try to guess what.
die some error as appropriate;
}

# Now that you're fairly certain that the new backup has worked...
unless( unlink($backuppath/$database-$oldyear$oldmonth$oldday.sql.gz);
# something went wrong... try to guess what.
# This could just be that the file doesn't exist.
die if you think it's appropriate;
}



undef $sth;
undef $dbh;
---


-- 
Voytek

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] gzip from perl script

2005-09-21 Thread Jacinta Richardson
Voytek wrote:
 quote who=Jacinta Richardson
 
 thanks, Jacinta
 
 ahem, you assume I'm somewhat perl-literate, beyond knowing how to
 paste'n'save... I'm not...

My apologies.  Although I do find that it's usually better to to assume that
people who are asking about an existing Perl program are more often Perl
literate than they are Perl newbies.  :)

  unless( unlink($backuppath/$database-$oldyear$oldmonth$oldday.sql.gz);

Ah.  Remove the trailing ;  and replace with a ) {

 script now is:
 ---
 #!/usr/bin/perl
 use DBI;
 use Mysql;
 use Date::Pcalc qw(:all);
 
 
 $DB_Host = localhost;
 $DB_Name = mysql;
 $DB_User = backup;
 $DB_Password = password;
 $backuppath = /backup/mysql;
 $myoffset = -3; # set the number of days back to delete. Basically -number
 of days you wish to keep logs rotating for.
 
 my $dbh =
 Mysql-Connect($DB_Host;database=$DB_Name;,$DB_User,$DB_User,$DB_Password)
 or die $Mysql::db_errstr;
 
 ($year,$month,$day) = Today();
 if (length($day)==1) {
 $day = 0$day;
 }
 if (length($month)==1) {
 $month = 0$month;
 }
 
 ($oldyear, $oldmonth, $oldday) = Add_Delta_YMD($year, $month, $day, 0, 0,
 $myoffset);
 if (length($oldday)==1) {
 $oldday = 0$oldday;
 }
 if (length($oldmonth)==1) {
 $oldmonth = 0$oldmonth;
 }
 
 $dbh-selectdb(mysql) or die $Mysql::db_errstr;
 
 my $sth = Query $dbh SELECT * FROM db or die $Mysql::db_errstr;

You probably don't need to to select *.  But it doesn't hurt.

 while( my ($ignored, $database) = $sth-fetchrow() ) {
 print $database\n;
 
 # Make the backup
 system(mysqldump --opt $database -u $DB_User --password=$DB_Password .
  $backuppath/$database-$year$month$day.sql);
 
 # Handle any errors
 if($?) {
 # something went wrong... try to guess what.
 die some error as appropriate;
 }

You might want to make the above error somewhat more useful.  Perhaps:

die Mysqldump failed for some reason.;

just so that you know...  I've reindented.  Hopefully you just lost the
indentation in your cut and paste.

 # Do the compression
 system(gzip, $backuppath/$database-$year$month$day.sql);
 
 # Handle any errors
 if($?) {
   # something went wrong... try to guess what.
   die some error as appropriate;
 }

You probably want to change this error message as well.

die Failed to gzip file.;

 # Now that you're fairly certain that the new backup has worked...
 unless( unlink($backuppath/$database-$oldyear$oldmonth$oldday.sql.gz);

This should be:
  unless( unlink($backuppath/$database-$oldyear$oldmonth$oldday.sql.gz)) {

 # something went wrong... try to guess what.
 # This could just be that the file doesn't exist.
 die if you think it's appropriate;
 }

On further thought you proably want to change this die to the following:

warn Failed to remove $database-$oldyear$oldmonth$oldday.sql.gz: $!;

as failing to delete might not be important enough to stop doing all the 
backups.

All the best,

 Jacinta


-- 
   (`-''-/).___..--''`-._  |  Jacinta Richardson |
`6_ 6  )   `-.  ( ).`-.__.`)  |  Perl Training Australia|
(_Y_.)'  ._   )  `._ `. ``-..-'   |  +61 3 9354 6001|
  _..`--'_..-_/  /--'_.' ,'   | [EMAIL PROTECTED] |
 (il),-''  (li),'  ((!.-' |   www.perltraining.com.au   |


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] gzip from perl script

2005-09-21 Thread Julio Cesar Ody
On 9/21/05, Voytek [EMAIL PROTECTED] wrote:
 ...
 do I simply add like:

 system(gzip $backuppath/$arr[1]-$year$month$day.sql);
 (and change the 'rm' line extension?)

Go for it. There's no reason to install the module when you can safely
do it via system(). In fact, don't be afraid of using it at all. You
would need a module in a system without the gzip CLI tool but equipped
with the library... which anyway seems quite unusual for a *nix.

If you're not using strict, there's no reason to use my before any
variables. But instead of removing them, go for strict. You'll
probably have a few problems getting the program to run, but mind the
error messages, correct them, and move on.

A quick solution for that would be, instead of using Perl (nothing
against it, I'm a Perl lover), do it in shell. Like in:

$ mysqldump -u user | gzip --best  dbbackup.$(date +%s).gz

You won't be able to check for the gzipped file size *before* actually
writing it to disk (unless you take that gzip output and count the
number of bytes, then compare with a df output...). So you can trap a
failure by doing something like

#/bin/sh

if ! mysqldump -u user 2 ~./mybackuperrors.$$ | gzip --best  ...
   # then maybe
   echo -n $(date +%s)-`cat .mybkperrror.$$`  /var/log/mybackuperrors
   #  more error handling, log anything, bail out

And here's a MySQL backup system, with error logging. Cron it, and
you're off and running in no time.





 I'm using a Perl script for MySQL backup, I'd like to compress the
 database dumps, the business end of the script runs like:

 ---
 while (my @arr = $sth-fetchrow) {

 print $arr[1]\n;
 system(rm $backuppath/$arr[1]-$oldyear$oldmonth$oldday.sql);
 system(mysqldump --opt $arr[1] -u $DB_User --password=$DB_Password 
 $backuppath/$arr[1]-$year$month$day.sql);
 }

 ---

 do I simply add like:

 system(gzip $backuppath/$arr[1]-$year$month$day.sql);
 (and change the 'rm' line extension?)
 ?

 --
 Voytek

 --
 SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
 Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html



--
Julio C. Ody
http://rootshell.be/~julioody
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] gzip from perl script

2005-09-21 Thread Voytek

quote who=Jacinta Richardson
 Voytek wrote:

 My apologies.  Although I do find that it's usually better to to assume
 that people who are asking about an existing Perl program are more often
 Perl
 literate than they are Perl newbies.  :)

no need to apologize, I'm flattered

 On further thought you proably want to change this die to the following:

 warn Failed to remove $database-$oldyear$oldmonth$oldday.sql.gz: $!;

 as failing to delete might not be important enough to stop doing all the
 backups.

yes, 'die' was a show stopper, 'warn' is better
(especially as I'm deleting 3 generations prior, anyhow)


I just need to force a 'y' here, or pass to gzip

...screen snip---
gzip: /backup/mysql/postfix-20050922.sql.gz already exists; do you wish to
overwrite (y or n)?
...

thanks for all the help,


-- 
Voytek

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] gzip from perl script

2005-09-21 Thread Erik de Castro Lopo
Jacinta Richardson wrote:

 Voytek wrote:
  quote who=Jacinta Richardson
  
   unless( unlink($backuppath/$database-$oldyear$oldmonth$oldday.sql.gz);
 
 Ah.  Remove the trailing ;  and replace with a ) {

Oh, cool, a Perl person.

One thing thats been bugging me for a while about Perl is the
lack of a butfirst keyword. This would be *really* useful for
constructs like:

{
   # Huge chunk of code
}
butfirst
{
   # Second huge chunk of code to be executed
   # before the one above.
} ;

Sincerely,
Erik
-- 
+---+
  Erik de Castro Lopo
+---+
Incompetence, like misery, seeks company. -- Erik Naggum
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] usb audio device for kernel 2.4

2005-09-21 Thread Denis Crowdy
On Thu, Sep 22, 2005 at 11:38:57AM +1000, Mark Johnathan Greenaway wrote:
 On Wed, Sep 21, 2005 at 05:41:38PM +0200, Gottfried Szing wrote:
  so, has someone a usb-audio device in use?
  requirements:
  - linux 2.4 support (because openwrt uses this version)
  - headphone mini jack. i want to connect it to my amplifier
 
 I use an Edirol UA-20 audio/MIDI interface, and it just works. It has
 the features you're describing, but is probably overkill for your
 application. I thought you might appreciate hearing from someone who has
 worked with a USB audio interface, rather than just having read about
 them.
I have had similar just works experiences with a Roland Edirol UA-5,
and an Apogee Mini-me. Both usb-audio.  Getting them to work with jack
is a complete PITA, however, so if you do a lot of jack apps, I'd
recommend something else.  I have a working .asoundrc which works with
jack, but it is less than ideal.

Mark - does the UA-20 do sensible audio formats that jack likes?

Denis


-- 
Dr Denis Crowdy
Department of Contemporary Music Studies
Macquarie University
NSW 2109, Australia
+61 2 9850 6787; http://www.dcms.mq.edu.au
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] Script help

2005-09-21 Thread Simon
Hi all,
Can anyone tell me why I get no output from this script? I am not good
at writing my own so modify others. I have tested that it is reading the
allusers.txt by adding an echo $name

#!/bin/bash
while read name; do
grep $name smbpasswd;
done  allusers.txt

My basic problem is I have an smbpasswd file where for a couple of years
users were not removed properly so that there are about 350 extra users
in the smbpasswd file - I want to cut it down to the right size - and be
able to reuse the usernames. I have a complete list 'allusers.txt' of
all the valid users. Once this worked I was just going to pipe the
output to a nwe file.

OLMC
Simon Bryan
IT Manager
[EMAIL PROTECTED]
LMB 14
North Parramatta
Direct Number:88381200
SwitchBoard: 96833300
fax: 98901466
mobile: 0414238002


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Script help

2005-09-21 Thread Vino Fernando Crescini

#!/bin/bash
while read name; do
grep $name smbpasswd;
done  allusers.txt


are the names in allusers.txt listed one per line?

--
Vino Fernando Crescini Intelligent Systems Laboratory
   School of Computing  IT
phone: +61 2 4736 0140 University of Western Sydney
email: [EMAIL PROTECTED] Locked Bag 1797
web: www.cit.uws.edu.au/~jcrescin  Penrith South DC NSW 1797

Scanned by SCIT E-Mail Gateway http://www.cit.uws.edu.au


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html