Re: [SLUG] advice on security compliance

2009-11-11 Thread Daniel Bush
Hey Amos, thanks for that.  And also thanks to Daniel and Sonia.

Cheers,
Daniel

2009/11/10 Amos Shapira amos.shap...@gmail.com

 2009/11/2 Daniel Bush dlb.id...@gmail.com:
  I was following Rick's recent post about penetration testing with some
  interest.  I'm looking at complying with anz e-gate for e-commerce
  transactions.  ANZ has this declaration form for internet sites that you
  have to sign.  One of the tick boxes says Do you operate a firewall that
 is
  regularly updated?

 I'm a bit late in the party but still wanted to add my two cents if that's
 OK.

 Some relevant points I learned during the PCI DSS compliance process
 we've gone through:

 1. They also care not just about preventing people getting
 unauthorised access to your server but also in making it difficult to
 get data out (e.g. by someone with an inside knowledge). So firewall
 rules should also limit outgoing connections to specific hosts. E.g.
 you want to talk to specific, hopefully more trusted, DNS and NTP
 servers, specific upstream SMTP servers (instead of allowing access to
 just about any SMTP server in the world) and maybe specific yum update
 servers, but not more. Since rules could be added to allow you
 temporary access outside for specific tasks, it might be prudent to
 verify once in a while that they are back to the way you expect them
 to be.

 2. Application firewalls can add a lot to the simple block everything
 except ports 80 and 443 iptables. I'm talking about mod_security and
 having its rules updated regularly to catch attempts to exploit holes
 in known application as they get discovered (e.g.
 http://www.gotroot.com/tiki-index.php?page=mod_security+rules).

 3. They care about auditing and accountability - the rule of thumb
 is no shared accounts - if there are more than one users on the
 system then each should use their own account and sudo ... for each
 privileged command. It also makes it easier to track who did what and
 when (bash HISTTIMEFORMAT='%F %T ' is also very useful, not just for
 Them).

 4. SE Linux is a major headache, I seem to be in the mainstream by
 disabling it for now. But it appears that once you get to learn it and
 tweak it properly it can add a lot to the security on your server and
 limit the damage done by a potential cracker. e.g. allow HTTP access
 to the yum servers only by the yum process, or send mail only from
 specific programs/scripts. The best tutorial I found about SE Linux so
 far resides in http://docs.fedoraproject.org/selinux-user-guide/f10/en-US/
 (I still have to finish reading it)

 In general - you can look at this as ah yeh, the security lawyers and
 paper pushers are at it again but I found that giving attention to
 these requirements and the thinking behind them makes a lot of
 security sense (most times - anti-virus for purely linux environment
 is pretty useless from what I've researched so far) and should end up
 in more secure servers.

 Cheers,

 --Amos




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


[SLUG] vmware server / debian kernel (testing)

2009-11-01 Thread Daniel Bush
Anyone successfully compiled or seen any docs on compiling vmware server
2.0.1 or 2.0.2 kernel modules for a stock standard debian kernel
2.6.30-2-686 ?

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


[SLUG] advice on security compliance

2009-11-01 Thread Daniel Bush
I was following Rick's recent post about penetration testing with some
interest.  I'm looking at complying with anz e-gate for e-commerce
transactions.  ANZ has this declaration form for internet sites that you
have to sign.  One of the tick boxes says Do you operate a firewall that is
regularly updated?

I have an iptables firewall which basically blocks all ip6 and all ip4
except for a couple of ports I expose to the internet.  I don't see why I
need to update it regularly.

Do people use any additional application-level filtering on top of iptables
packet filtering for ssh or http (aside from any security configurations
that these services already provide) ?  (The services I'm exposing through
iptables are ssh and http. )

If not, how do you deal with a compliance item that makes dubious sense and,
if you answered it honestly, makes you look bad when you're not?

The other thought I had was that it could be they are conflating my
understanding of a what a firewall is with antivirus software.
If people (staff even) are uploading stuff via http then maybe I need to
scan such content to prevent my system acting as an agent for spreading
viral content.  But that's heading out of firewall territory.


Regards,
-- 
Daniel Bush
-- 
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] Pulse Audio

2009-11-01 Thread Daniel Bush
2009/11/2 Daniel Pittman dan...@rimspace.net

 Heracles herac...@iprimus.com.au writes:

 G'day Heracles.

  Sorry Daniel if I offended your favourite program.

 If I was particularly fond of PulseAudio I wouldn't have described it in
 the
 terms I chose at the end.  Just sayin'

  It is just that I have had to re-setup my sound several times now with
 each
  ubuntu upgrade and it has almost always been a problem that could be lain
 at
  the feet of PulseAudio.

 You would hardly be the first person.  I think the PulseAudio developers
 have
 a similar view of Ubuntu, who they feel did about as bad a job as possible
 in
 integrating PA into the distribution. ;)


I went back to debian after having a very hard time with an ubu upgrade not
that long ago.  It was both audio and graphics.  Seems like debian doesn't
use pulse by default and it's been great.  If anything I feel like my system
handles simultaneous playing of sounds from different apps more reliably.

-- 
Daniel Bush
-- 
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] advice on security compliance

2009-11-01 Thread Daniel Bush
Rob,

2009/11/2 Robert Collins robe...@robertcollins.net

 On Mon, 2009-11-02 at 16:28 +1100, Daniel Bush wrote:
  I was following Rick's recent post about penetration testing with some
  interest.  I'm looking at complying with anz e-gate for e-commerce
  transactions.  ANZ has this declaration form for internet sites that you
  have to sign.  One of the tick boxes says Do you operate a firewall that
 is
  regularly updated?
 
  I have an iptables firewall which basically blocks all ip6 and all ip4
  except for a couple of ports I expose to the internet.  I don't see why I
  need to update it regularly.

 Two primary reasons:
  - iptables is not bug free. Few and far between, but not empty-of-bugs.


I mean updating the rules you use to filter packets not maintaining the
software that does the filtering.  Is that what you mean here?  Maybe that's
what this tick box means.  I didn't think of that.  I just assumed they're
were talking about the filtering rules...


  - ip4 and ip6 are not 'finished'. Every now and then a new RFC or even
 std is released, and you need to update your firewall and routing rules
 accordingly. (e.g. the nonroutable address space changes over time, so
 you need to update your rules accordingly).


Must still be missing something here Rob.  I just block everything except
for the services I run on the public interface (and stuff on the internal
loopback interface / localhost).  Why do I need to worry about
non-routables?



 Even if those two points didn't matter, if you admin the firewall using
 ssh, and sshd has a bug permitting remote compromise, you'd be remiss
 not to update that.


I think this is a software update issue.  As before I'm wondering if that is
what the tick box meant.  What confuses me is that I would have that as a
separate tick box in itself, something like do you regularly patch/maintain
security updates for your software, especially firewall and related security
systems?  That is not the issue I thought the tick box was addressing.
I may be reading you all wrong here though :(


 So, its an important checkbox, and if you're not maintaining your
 firewall, don't tick it! (Worse still, if you think deny-all + a couple
 of permits == correctly setup firewall - you need about 15 rules I
 think, for a _minimally_ conformant firewall [that is, not in violation
 of parts of the IP stack]).


Ok, now you're worrying me.  For a simple set up where you have an isolated
box running a webserver and ssh: I have a default drop policy on all tables;
a catch-all drop rule that logs certain things;  I have some stateful rules
so that I can talk to the outside world and several open ports on specified
interface for tcp protocol where I am exposing services to the outside
world.

If the default is to drop everything except a specific set of ports on a
specific interface using a specific transport why do I have to twiddle with
these rules?

Surely the only area of concern is the established/related stateful rules
Is that what you mean?  Are you reviewing the stateful part of your packet
filtering firewall every week because you're worried it could get spoofed or
something?  If so, what is your strategy here and does it result in some
sort of regular update?

Or do you have default policy of accept which means you have to worry about
closing stuff down all the time?  I've always assumed drop so I don't even
want to begin to think about the alternative.



 Keeping on top of the whole mess is what is
 implied by 'regularly updated', not turning on some vendor software-sync
 button and forgetting about it.


hm; as per my above comments.  I'm pretty paranoid about my firewall.


-- 
Daniel Bush
-- 
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] Any suggestions for places to do Personal Sprints in Sydney

2009-10-09 Thread Daniel Bush
On the google roro list occasionally you get people organising a jelly
session.
But I think the idea there was to get people who work from home into a
situation where they can interact and maybe bounce off eachother a little.
So I don't know how easy it would be to seclude yourself - haven't actually
done it.

http://wiki.workatjelly.com/JellyInSydney

Don't know if it's still going.

If you find a good get away place with all the mod cons, not too costly, be
sure to let me know.

Regards,
Daniel

2009/10/10 Adam Kennedy adamkennedybac...@gmail.com

 Hi gang

 Lately I've been finding that between IRC, twitter spam, and all the
 other communication conveniences of our modern lives, it's really hard
 to force yourself to devoting a whole day to learning some new
 technology or to hack on that Important Project or what have you.

 I'd like to experiment with the idea of a Personal Sprint, where you
 pack up a laptop and all the downloaded material and books you need
 into a backpack, go somewhere unusual or picturesk or otherwise
 undistracting and spend a 5 or 10 or 15 hour day or evening or night
 with absolute nothing to distract from the task.

 Only problem is, I'm stuck for places to do it.

 In the past I've had some success with shorter periods of a few hours,
 by just getting on a train to Penrith, or sitting our on the foodcourt
 balcony at Bondi Junction shopping centre, and so on.

 But where would people recommend as places to go for this kind of thing?

 Limitations.

 1. Must be reasonably reachable by public transport, some use of taxis
 is acceptable.

 2. Must have electricity, buying 10 hours of extra battery time is
 probably not reasonable, extension cords are allowable.

 Thoughts?

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




-- 
Daniel Bush
-- 
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] django/rails

2009-10-06 Thread Daniel Bush
I'd like to venture something but I can't really because I only know one
side of this - ruby/rails.
I think you could probably flip a coin and just go with one or the other.

It might come down to picking a language.  If python grabs you, then django
is probably the way to go and vice versa.  (If you like oop or iterators,
ruby is probably your thing :) )  Both languages run on jvm and probably
.net; I think jruby is maturing well from I what I've read (not done); don't
know about python.

That being said,  I think rails has more recognition than django although
both are probably not considered even close to mainstream yet and are
likely to attract blank stares from grizzled verterans hunched in their
trenches.

If I were looking at django based on rails I'd be looking at:
- testing: not only models but controllers and integration
(sessions,cookies, moving around); also integration with more behaviour
driven testing via rspec if you prefer that to TDD
- handling of test, development and production environments including the
database
- migrations - incrementally adding stuff like new columns etc
- authentication and other plugins like pagination etc
- models/orm - activerecord is nice (you've got get your head around:
associations, validations and callbacks - and it takes some time if you like
punching out sql) although it's easy to end up generating large wodges of
sql without you realising it
- templating/views; I like erb and how easy it is to print and/or execute
statements within a template; there are alternatives like haml which look
cool; I can't believe how clunky php is by comparison
- partials - rendering blobs of html within a template or other blob; this
is a nice way to organise your templating
- caching: page caching, fragment caching etc; so you can do expensive
things and not feel bad about how wasteful they are :)
- controllers: filters, sessions; subclassing controllers
- debugging: ability to debug a live controller/model; although I rarely
need to do this

etc etc


2009/10/6 david da...@kenpro.com.au

 I'm reading up on both, trying to make an intelligent decision which to
 use.

 I'm agnostic about ruby/python, although I have a faint feeling that python
 may be better. In either case I have to learn the language.

 Does anyone care to venture an opinion? Flame war anyone?

 David



 PS:
 I've noted that Ruby has a DB migration facility which looks useful.
 quote from article
 There are two key advantages to Rails' incremental migrations compared with
 Django. First, Rails provides a standard mechanism for deploying new
 releases to already running production systems while preserving data. For
 example, if a database column's type is changed from char to integer, the
 accompanying Rails migration script would specify the steps required to move
 the data from the old char column to the new integer column. To perform
 similar operations in Django, the developer would need to write an ad-hoc
 SQL script.

 The second advantage is that, being easily rolled back, migrations
 encourage a certain amount of experimentation with the model classes and
 database schema. Certainly some experimentation with models is possible in
 Django, especially if the model code is kept under source code control, but
 as data is not preserved through such changes, it is less attractive unless
 there is a mechanism for quickly loading test data.

 At the time of writing, the Django development community is working toward
 introducing a schema evolution mechanism.
 /quote



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




-- 
Daniel Bush
-- 
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] [OT] Thou Shalt Make Backups

2009-09-22 Thread Daniel Bush
Found this courtesy of bing.com image search:
http://www.reverendfun.com/add_toon_info.php?date=2324language=en


2009/9/22 Amos Shapira amos.shap...@gmail.com

 Hi,

 This is NOT strictly linux related but still maybe some people here
 hang around long enough to remember this one and help me find it (and
 I have an excuse - it should be hung on top of every sysadmin's desk,
 IMHO).

 Back in the second half of the 80's we lost one of our VAX 750's 400Mb
 disks after someone (very well known internationally today but I'll
 keep his privacy) neglected to do his weekly duty and perform a
 backup.

 The day it happened (the server room was full of thin dust from the
 crashed ceramic disk heads) someone came up with a cartoon showing
 Moses biting his fingers over the broken ten commandments with God's
 finger throwing another one saying XI Thou Shalt Make Backups.

 So far Google image and general searches haven't turned up anything.

 If anyone has a copy or knows where else can I look I'd appreciate a
 pointer.

 Thanks,

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




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


[SLUG] shell scripting help

2009-09-18 Thread Daniel Bush
Hi,
Writing a little utility to help me on something but having trouble.
Why does f stay blank?

d...@lin4:test$ echo foo|bar | awk 'BEGIN{RS=|}{ print $1 }' | while
read s; do echo $s; f=$s; done; echo '$f'
foo
bar
''

Regards
-- 
Daniel Bush
-- 
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] shell scripting help

2009-09-18 Thread Daniel Bush
Thanks for your quick responses.
I think Gonzalo is right and thanks for providing that link on the bash
gotchas.

If you check the bash manpage $$ will not give you the subshell - at least
when using ().
The 3rd read may occur, but the loop won't run because that read fails so f
is not blanked afaict.
Rodolfo, when you did set -x, your output was different to mine.
Anyway I think the subshell is the gotcha here.

wow, we're all using gmail...

Many Regards
Daniel


2009/9/19 Rodolfo Martínez rmt...@gmail.com

 Yes, but the last instruction is doing f=$s

 About the sub-shelling stuff... in this case that is not why 'f' is blank

 The 'while' is executed in the same shell

 [mar...@amartir01 ~]$ echo $$ ; echo -n foo|bar | awk
 'BEGIN{RS=|}{ print $1 }' | while read s; do f=$s ; echo f=$f ;
 echo $$ ; done ; echo f=$f
 5997  == Same shell
 f=foo
 5997  == Same shell
 f=bar
 5997  == Same shell
 f=


 If it was the reason, it could be fixed by exporting 'f' before the pipe

 [mar...@amartir01 ~]$ export f= ; echo -n foo|bar | awk
 'BEGIN{RS=|}{ print $1 }' | while read s; do f=$s ; echo f=$f ;
 done ; echo f=$f
 f=foo
 f=bar
 f=


 Regards
 Rodolfo Martínez




 On Fri, Sep 18, 2009 at 9:43 AM, Gonzalo Servat gser...@gmail.com wrote:
  2009/9/19 Rodolfo Martínez rmt...@gmail.com:
  'while' continues until read fails, there is a 3rd 'read' (when it
  fails) that clears 'f'
  [mar...@amartir01 ~]$ set -x ; echo -n foo|bar | awk 'BEGIN{RS=|}{
  print $1 }' | while read s; do f=$s ; echo f=$f ; done ; echo f=$f
  + set -x
  + awk 'BEGIN{RS=|}{ print $1 }'
  + read s  == First read
  + echo -n 'foo|bar'
  + f=foo
  + echo f=foo
  f=foo
  + read s== Second read
  + f=bar
  + echo f=bar
  f=bar
  + read s  == Third read, the one that clears 'f'
  + echo f=
  f=
  ++ echo -ne '\033]0;mar...@amartir01:~'
 
  Yep, however, he is concerned with the variable 'f' being blank, not 's'.
 
  - Gonzalo
  --
  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




-- 
Daniel Bush
--
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] shell scripting help

2009-09-18 Thread Daniel Bush
2009/9/19 Ishwor ishwor.gur...@gmail.com

 HI

  If you check the bash manpage $$ will not give you the subshell - at
 least
  when using ().
  The 3rd read may occur, but the loop won't run because that read fails so
 f
  is not blanked afaict.
  Rodolfo, when you did set -x, your output was different to mine.

 set -x turns on echo'ing; set +x does the opposite.  I'd thought the
 goal was to print foo|bar|baz but nevermind ;-D


The string being piped is an extended regular expression which I wanted to
prepend with a file path, so I wasn't actually printing.  I just isolated
the problem down to that particular example.
Since it is a cli utility I thought I could do it in shell rather than
breaking out the big guns like ruby or perl... and that's how the story
begins...

whoa, way past my bedtime
Cheers,
Daniel
-- 
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] shell scripting help

2009-09-18 Thread Daniel Bush
2009/9/19 Aleksey Tsalolikhin atsaloli.t...@gmail.com

 On Fri, Sep 18, 2009 at 6:42 AM, Daniel Bush dlb.id...@gmail.com wrote:
  Hi,
  Writing a little utility to help me on something but having trouble.
  Why does f stay blank?
 
  d...@lin4:test$ echo foo|bar | awk 'BEGIN{RS=|}{ print $1 }' | while
  read s; do echo $s; f=$s; done; echo '$f'
  foo
  bar
  ''

 and

  The string being piped is an extended regular expression which I wanted
 to
  prepend with a file path

 You mean, like this?

 # echo foo|bar | awk 'BEGIN{RS=|}{ print filepath/$1 }'
 filepath/foo
 filepath/bar
 #

 If that's not it, could you give an example of the desired output?


More like this:

rprepend() {
  ruby -EOF
f='$1'.split('|').collect{|i|i.chomp.sub(/^/,'$RSUBDIR.*')}.join('|');
puts f;
EOF
}

d...@lin4:image_library$ RSUBDIR='/path'
d...@lin4:image_library$ rprepend 'foo|bar'
/path.*foo|/path.*bar

It's a long story and it's not an application, it's part of a larger cli
utility to help me find and grep filenames and their contents in a project
and some of its nested subprojects so I can think and work that much faster
without having to pause and move around groping for the right file (from the
shell).

Thanks everyone for helping.

-- 
Daniel Bush
-- 
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] shell scripting help

2009-09-18 Thread Daniel Bush
2009/9/19 Daniel Bush dlb.id...@gmail.com



 2009/9/19 Aleksey Tsalolikhin atsaloli.t...@gmail.com

 On Fri, Sep 18, 2009 at 6:42 AM, Daniel Bush dlb.id...@gmail.com wrote:
  Hi,
  Writing a little utility to help me on something but having trouble.
  Why does f stay blank?
 
  d...@lin4:test$ echo foo|bar | awk 'BEGIN{RS=|}{ print $1 }' |
 while
  read s; do echo $s; f=$s; done; echo '$f'
  foo
  bar
  ''

 and

  The string being piped is an extended regular expression which I wanted
 to
  prepend with a file path

 You mean, like this?

 # echo foo|bar | awk 'BEGIN{RS=|}{ print filepath/$1 }'
 filepath/foo
 filepath/bar
 #

 If that's not it, could you give an example of the desired output?


 More like this:

 rprepend() {
   ruby -EOF
 f='$1'.split('|').collect{|i|i.chomp.sub(/^/,'$RSUBDIR.*')}.join('|');
 puts f;
 EOF
 }

 d...@lin4:image_library$ RSUBDIR='/path'
 d...@lin4:image_library$ rprepend 'foo|bar'
 /path.*foo|/path.*bar

 It's a long story and it's not an application, it's part of a larger cli
 utility to help me find and grep filenames and their contents in a project
 and some of its nested subprojects so I can think and work that much faster
 without having to pause and move around groping for the right file (from the
 shell).

 Thanks everyone for helping.

 --
 Daniel Bush



oh crap, before anyone beats me to it; yes I could have done it this way:

echo 'foo|bar'|sed -e 's#^#/path.*#;s#|#|path.*#;'

-- 
Daniel Bush
-- 
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] bash tips (tr, cut, loops, fields, records) Was: shell scripting help

2009-09-18 Thread Daniel Bush
2009/9/19 Jeff Waugh j...@perkypants.org

 quote who=Daniel Bush

  Writing a little utility to help me on something but having trouble.
  Why does f stay blank?

 Answer (which I think was mentioned in earlier responses): The parent shell
 doesn't have access to the subshell's scope. The usual way of doing this is
 to provide output from the loop into a variable, like this:

  PANTS=$(echo foo|bar | while ... echo -n $F ...)

 Solution: Depends on the actual task rather than the example. :-)

  d...@lin4:test$ echo foo|bar | awk 'BEGIN{RS=|}{ print $1 }' | while
  read s; do echo $s; f=$s; done; echo '$f'
  foo
  bar
  ''

 A couple of thoughts (note that I always use caps for variables for
 clarity)...

  echo foo|bar | tr '|' '\n' | while read S


You trying to make my awk look awkward? :)
yeah, I do caps for important stuff but I like dropping to lower for loop
and throw away variables.  I sometimes also scope them by using 'local'
within a bash function.

Cheers,
Daniel



-- 
Daniel Bush
-- 
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] Ubuntu Jaunty default folders - symlink to elsewhere?

2009-09-05 Thread Daniel Bush
2009/9/5 bill bi...@swiftdsl.com.au

 I've just installed Ubuntu Jaunty and have most things set-up ok (old
 install is Kubuntu 8.04), including finding replacement apps under gnome for
 those I've used under KDE.

 What I want to do is symlink my /home/bill/Documents;Videos;Music;Pictures
 folders to another folder :- ie /home/bill/DATA/documents

 I tried :-

 ln -s /home/bill/DATA/documents /home/bill/documents

 without success as opening /home/bill/Documents does not go to
 /home/bill/DATA/documents

 ls -all /home/bill/documents

 shows
 lrwxrwxrwx 1 bill bill 25 2009-09-04 19:02 /home/bill/documents -
 /home/bill/DATA/documents

 What did I do wrong?  Or are those folders setup in such a way by default
 that they cant be symlinked?



/home/bill/documents is not the same as /home/bill/Documents on ext and
other unixy file systems (ie case is important).


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




-- 
Daniel Bush
-- 
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] 40 Years of Unix

2009-09-01 Thread Daniel Bush
whoa jam!  Fanning the dying embers of this thread a bit aren't we!

2009/9/1 jam j...@tigger.ws

 [snip]

 Jobst I started this with outrageous comments so I should honour the
 discussion. INIT can be a shell, but is usually not. [1]

 [snip]

 So in general GUIs use the RH brain to operate. [2] That mode is intuitive
 and
 easy to learm, just because of the way we are built. CLI is a LH brain
 activity [logical, calculating etc] Arguing one is better is foolish.

 I've never seen a GUI that is faster or less cumbersome than a CLI each in
 the
 hands of a suitable user. Anybody have any examples either way?


Drawing a picture in inkscape or illustrator ?
Creating a budget in a spreadsheet.
Editing a document or even just a text file .

I mean everything is a command in the end.  It's just easier sometimes to
invoke that command using a mouse and/or keyboard than to type the
underlying command in some sort of command line.

Knowing the underlying command and being able to call it does give you more
power because you can now use it in a program; and you can make programs do
things that humans can't (practically).  But some commands may be of limited
value when you try to do this and are often easier to do using
mouse/keyboard in a gui.  I don't really need to be able to script the
bezier curve command that draws a nice curvey line on a logo I'm designing,
for instance.

Way I see it, the unix/linux shell provides a convenient, friendly way to
invoke commands and other programs on the system (interactively or not).
These are programs like 'ls','find',apache or other shell scripts, which the
shell forks and shell builtins like 'for' or 'while' loops.  When I type
'vim' at the prompt, I've just executed a simple program that loads my text
editor (unless you want to view my entire shell session as one big
program/shell script).

The unix shell is also a convenient/easy way to set variables in the
environment which can be read by processes forked off that shell.

The prevalence and ease of manipulating stdout/stdin/stderr and piping is
also a distinctive unix shell thing.  In a ruby cli (irb) I would instead
store output from a function in a variable rather than do something with a
pipe.



 Girl brains and boy brains are different and despite years of rude comments
 girls multi task and boys dont. Girls *seem* to prefer GUIs. Any comments ?


No :)
I think most people will prefer the gui for the sorts of things that most
people do.  It's only when you need or want to create a series of
instructions (a script or program) that the shell gets interesting.

That being said, I'm a heavy cli user myself because I can load my current
interactive shell with variables and commands for things I'm doing and move
around and operate on the file system very easily; whether it's learning
about couchdb or running mplayer in a particular way or administering a
remote system or application etc etc..  In fact the way I'm using the shell
at the moment is helping me to learn and handle lots of stuff in a way I'd
have a hard time replicating in a gui without a commandline facility.


-- 
Daniel Bush
-- 
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] Nokia one-ups IBM on Linux marketing

2009-08-29 Thread Daniel Bush
2009/8/28 Adam Kennedy adamkennedybac...@gmail.com

 Hi gang

 You may have noticed recently that Nokia has decided to pack a fairly
 beefy Linux setup into their new super high end phone.

 What I didn't notice till today is that they've also had a shot at
 making the shiniest ad for a Linux OS yet :)

 http://maemo.nokia.com/



What they didn't show was this:
http://flors.files.wordpress.com/2009/08/screenshot13.png?w=500h=300
That sold me right there (well for novelty value I guess).

Imagine being able to apt-get on your phone.  It's great (and a little
suprising) to see a big company running with the debian system like this and
leaving it pretty much open unlike apple.  I hope they kickass with this
product - although it's almost too geeky-cool to last/succeed.

On one of the forums I was reading people were talking about making use of
the Xserver on the phone to access apps on beefier machines - some mention
of nx enhancements to X for slow connections.  (yes, I also know about rdp
and vnc)

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


[SLUG] tweet from bash using your fave editor...

2009-08-24 Thread Daniel Bush
=$(grep '\'$nickname'\' $FOLLOWING)
  test -z $line  echo Don't know '$nickname'.  return 1
  username=${line/#*:/}
  curl $STATUS_URL/$username.$format | less
}

post() {
  test -z $1  status=cURL test! || status=$1
  curl --basic --user $USERNAME:$PASSWORD \
   --data status=$status \
   $POST_URL
  return $?  # If http error, curl returns 0
}

send() {

  testing=no
  order=cat
  file=$TMP_FILE

  while true; do
test -z $1  break
case $1 in
  # Don't send to twitter.
  dry) file=$TEST_FILE; testing=dry ;;
  # Send to twitter.
  test) file=$TEST_FILE; testing=yes ;;
  reverse) order=tac;;
esac
shift
  done

  if ask $file; then
echo POSTing
cat $file | $html_entities | fold -s -b -w 140 $file | \
$delete_blank_lines | $order | \
while read line; do
  case $testing in
  dry) echo $line; continue ;;
  *)
  if post $line; then
echo (posted a line!)
  else
echo (might have been an error posting this line: $line)
  fi
  ;;
  esac
done;
test $testing = no  (echo '-'; date; cat $file) $ARCHIVE
  else
echo NOT posting!
  fi

}

send.reverse() {
  send reverse
}

ask() {
  echo '--'
  cat $1
  echo '--'
  echo -n Post to twitter? [y] 
  read r
  case $r in
  n*|N*) return 1;;
  *) return 0;;
  esac
}

test.send() {
  send test
}
test.send.dry() {
  send dry
}

test.send.reverse() {
  send test reverse
}
test.send.reverse.dry() {
  send dry reverse
}

test.entities() {
 echo  | $html_entities
 echo 'should be: gt;lt;'
}



-- end of file

-- 
Daniel Bush
-- 
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] BBC News: 40 Years of Unix

2009-08-22 Thread Daniel Bush
Another one (care of reddit)
http://news.bbc.co.uk/2/hi/technology/8211355.stm

Might have to save some of this stuff and memorise bits of it because it
sort of says what I feel.

I had a win 2003 small business server (SBS) from my old place of work.
I was using it as a windows file server and as way to learn more ms, and had
disabled/uninstalled the existing domain controller because it was using the
old name from the place I had obtained it from and I couldn't find a way to
just change it.  Hadn't got round to setting up a new domain.  Anyway, it
served files ok without the domain thing but then it starts to mysteriously
shut down on me.  And I'm thinking gee ms is really crap.  Then, whilst
looking through the logs - while the damn thing was still on - I found it
was turning itself off because I was violating the licence - for not using a
feature (!).

That wasn't the reason I ended up installing vmware/ubuntu over it though.
The coup de grace came when I tried to upgrade internet explorer on it so I
could test my web pages in yet another wretched version of that wretched
browser.  Pretty sure I had found the right version on the ms site;
installed it and found that windows would hang when booting up.  Played
around with it in safe mode etc... but lost patience and moved on.

-- 
Daniel Bush


2009/8/21 Rick Phillips r...@greyheads.net

 BBC News is running a front page story about how Unix turns 40 this
 month.

 http://news.bbc.co.uk/1/hi/technology/8205976.stm

 I think it's pretty amazing to see the 40th birthday of Unix get such
 high-profile exposure...

 Regards,

 Rick

 --
 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] 40 Years of Unix

2009-08-22 Thread Daniel Bush
2009/8/23 jam j...@tigger.ws

 On Sunday 23 August 2009 10:00:05 slug-requ...@slug.org.au wrote:
   quote who=Marghanita da Cruz
  
   Can you throw light on the demise of the unix shell?
  
   Demise?! :-)
 
  I have to agree with Jeff: the only places I have really seen the shell
  vanish it has been moving — albeit painfully slowly at times — to being
  replaced by a more powerful programming model, universal scripting.
 
  For example, much of the traditional Unix shell use on MacOS has
 vanished,
  replaced by OSA and AppleScript, or by Automator.  In KDE they are
  gradually crawling towards more ubiquitous desktop wide scripting.  I
  presume that GNOME is doing more or less the same.

 My daughter created the web page for her business on her Mac.
 It is hosted on my server. After a morning of her trying to sync the two
 with
 the myriad of buy-this-and-all-your-woes-are-over, on the phone I talked
 her
 through a Terminal, rsync with ssh. Gobsmacked ! now she just uses it all
 the
 time. http://honeytreephotography.com.au
 James


There are people out there who are accountants, designers, etc who just have
a natural technical aptitude that can be surprising - I get so pessimistic
about aptitude/attitude/whatever that it really can be surprising when you
come across one.  And then there are PHB's...

Maybe the command line will die when programmers (in general) no longer have
to write words to get things done, but instead push coloured blobs around on
the screen using a mouse.  :)

-- 
Daniel Bush
--
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] firefox 3.5.2 on linux

2009-08-21 Thread Daniel Bush
2009/8/20 elliott-brennan elliottbren...@gmail.com

  Daniel Bush dlb.id...@gmail.com
  Wed, 19 Aug 2009 12:20:39 +1000
 
  Just curious, does anyone else use firefox 3.5.2 on linux?
  I followed the prompt recently and got upgraded only to discover it's a
 bit
  half-baked when it comes to handling css backgrounds and possibly other
 bits
  of css.
  I've filed a bug report at bugzilla.mozilla.org #510847.

 To which Erik replied:

  Erik de Castro Lopo mle+s...@mega-nerd.com mle%2bs...@mega-nerd.com
  Wed, 19 Aug 2009 12:43:21 +1000
 
  Yep, 3.5.2 on Ubuntu 9.04 from the Ubuntu repo.
 
  I followed the prompt recently and got upgraded only to discover it's a
 bit
  half-baked when it comes to handling css backgrounds and possibly other
 bits
  of css.
 
  Hadn't noticed.
 
  Erik

 I'm with Eric here. I'm running it on 8.04 and
 hadn't noticed :))

 These old eyes are not what they used to be :)



Well, I'm having all sorts of bother.  It doesn't remember logins (cookies)
or passwords anymore.  And using a website like paypal is quite hard because
of those pesky backgrounds.

I'm not using a distro firefox, so maybe there's something in that.  Or
maybe it's a plugin??

Trying to find a 3.5.1 build ... geez this is annoying.

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


[SLUG] firefox 3.5.2 on linux

2009-08-18 Thread Daniel Bush
Just curious, does anyone else use firefox 3.5.2 on linux?
I followed the prompt recently and got upgraded only to discover it's a bit
half-baked when it comes to handling css backgrounds and possibly other bits
of css.
I've filed a bug report at bugzilla.mozilla.org #510847.

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


[SLUG] kernel oops help

2009-07-20 Thread Daniel Bush
Hi Folks,
I just had a whole bunch of kernel oopses on my laptop.
I'm running Debian 5.0; kernel is 2.6.26-2-686
I get a dialogue in gnome telling me my kernel has just failed and lines in
/var/log/messages like:
  kerneloops: Submitted 2 kernel oopses to www.kerneloops.org
Everything appears to be working though.
Just before the oops entries in /var/log/messages, I have
  ata1: hard resetting link
a line after this printing out all my linked in modules
  Modules linked in: ... alot ...
and then what looks like some debug info:
  Pid: 14285, comm: top Not tainted (2.6.26-2-686 #1)
  EIP: 0073:[b7de108c] EFLAGS: 0216 CPU: 0
  [ ... several more lines of debug guff ...]

Is this an impending disk failure, power problem or have I been pwned? :(

-- 
Daniel Bush
-- 
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] two silly bash questions I can't find in google

2009-06-20 Thread Daniel Bush
2009/6/16 david da...@kenpro.com.au

 Q1. why does sed lose the first line?

 da...@david:~/test$ cat blah
 the quick
 brown fox jumps
 over
 the lazy
 dog
 da...@david:~/test$ cat blah | while read line ; do sed s/t/T/ ; done
 brown fox jumps
 over
 The lazy
 dog
 da...@david:~/test$



I'll have stab, though I've probably got this slightly wrong.
cat blah puts stuff into stdout.
This gets piped into stdin using your pipe '|'.
The 'while' is just a loop; it runs 'read' which opens stdin so it reads in
the first line of blah into $line.   Having read a line in, the while loop
moves on to the 'sed s/t/T/' line which also opens up stdin and reads the
rest of blah which it then dutifully substitutes (I guess the thing to note
is that 'read' reads a line at a time, but 'sed' just slurps up whatever
lines are available).  stdin has now been totally read - the first line by
'read' and the rest by 'sed'.  'sed' dumps stuff to the stdout but 'read'
doesn't which is why you don't see the top line.

Try running 'sed s/t/T/' by itself; it will sit their patiently waiting for
you to type lines into the terminal.

This would work:

   cat blah | while read line; do echo $line | sed s/t/T/; done

Each line of your file gets put into $line and then echoed into sed.

Or
   cat blah | sed s/t/T/
or, without cat:
   sed s/t/T/ blah

Or just
   sed s/t/T/ blah

I tend to use -e to specify the script:: sed -e 's/t/T/' ...


 Q2. what does the @ mean?

 da...@david:~$ date -d @1174306440
 Mon Mar 19 23:14:00 EST 2007

 I got this from a google search - the string is from a mysql timestamp
 which didn't include the @ I can't find a reference to @ in the date man
 page.


This isn't a bash thing but a 'date' command thing.
I checked this using the 'info' utility.  Alot of gnu utilities like 'date'
have detailed documentation using the info system - more detailed than their
man pages.
(you type 'info date' - but you may need to install 'info' on your system).
It says that it is the number of seconds since an epoch which for unix
systems is taken to be
1970-01-01 00:00:00 UTC .

date -d @1 would be 1970-01-01 00:00:01 UTC,
My system is outputting as EST so it's more like 10am.


-- 
Daniel Bush

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


[SLUG] microphone / skype / ubuntu 9.04 jaunty

2009-05-18 Thread Daniel Bush
Please, can anyone help.  I can't get my microphone to work in skype.

It's driving me nuts; i've spent the last couple of hours twiddling knobs
like crazy and making repeated calls to the test service.

If I load audacity and get it to monitor input and then do a skype it works
but it's horrible - too much gain or something.  But at least this tells me
it's working in some shape or form.
There are lots of posts from people, some with the similar card/chip (intel
HDA  Sigmatel STAC9228), saying how they solved mic/skype probs but it's not
working for me.




-- 
Daniel Bush

http://blog.web17.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] microphone / skype / ubuntu 9.04 jaunty

2009-05-18 Thread Daniel Bush
2009/5/18 david da...@kenpro.com.au



 Daniel Bush wrote:

 Please, can anyone help.  I can't get my microphone to work in skype.

 It's driving me nuts; i've spent the last couple of hours twiddling knobs
 like crazy and making repeated calls to the test service.

 If I load audacity and get it to monitor input and then do a skype it
 works
 but it's horrible - too much gain or something.  But at least this tells
 me
 it's working in some shape or form.


 I'm still using 8.10, but Skype works fine for me. OTOH I've had problems
 with


It was all working for me with hardy; maybe occasional problems but
otherwise quite reasonable.


 audacity stealing ALSA and not giving it back when it's finished. Very
 frustrating. Why are you using audacity with skype?


I read somewhere that someone had used it whilst troubleshooting - I've
forgotten the link now.  I installed it because at the very least it seemed
like an independent indicator that I could use to test my mic.  (I can't
figure out how to test the mic using the gnome sound tests)

I'm wondering if it's pulseaudio.  It seems more prominent in jaunty than it
did in hardy or maybe I disabled it in hardy - can't remember.  I seem to
have difficulty with audio on linux even though I don't think I've got
particularly special hardware :((

skype versions tried: 2.0.0.68 and 2.0.0.72 .   Static, oss static, dynamic
etc...

-- 
Daniel Bush

http://blog.web17.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] Re: microphone / skype / ubuntu 9.04 jaunty

2009-05-18 Thread Daniel Bush
2009/5/18 Richard Ibbotson richard.ibbot...@gmail.com

   It's driving me nuts; i've spent the last couple of hours
   twiddling knobs like crazy and making repeated calls to the test
   service.

 What I do after checking the sound levels with a gui based application
 is install another sound level controller.  Let's see..

 sudo apt-cache search sound ...

 alsa-firmware-loaders
 lib32asound2-plugins
 alsaplayer-alsa
 alsamixergui
 alsa-tools-gui
 ubuntu-restricted-extras

 Yes, I know it doesn't sound all that sensible but I found that after
 installing Jaunty Jackoffalot some things were missing.  I had to play
 around with apt-cache search for a while to find what I had missed.
 Don't know what this is about :)  Other than that it's a hardware
 issue.




What a mess this is!
Found this skype forum:
http://forum.skype.com/index.php?showtopic=334081
I'd like to follow the advice of one of the posters at the end but my sound
settings aren't the same.

Seriously thinking about downgrading all the long, sad way back to 8.04 -
well, it crossed my mind.
I'm screwed if it's skype's fault and they don't update; I'm potentially
less screwed if it is ubuntu.

Nuking pulseaudio didn't do anything.

Installing all of that junk above didn't do anything.

Game over.


-- 
Daniel Bush

http://blog.web17.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] Sound in Ubuntu 9.04

2009-05-18 Thread Daniel Bush
2009/5/19 Heracles herac...@iprimus.com.au

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Just a short note relating to my earlier post about my Sound Blaster
 Live! problem in Flash on my x86_64 install.

 I reinstalled 9.04 from scratch and lost ALL sound. After reading the
 Skype post from Richard I decided to remove pulseaudio (which took
 ubuntu-desktop with it) and see what happened. Without further ado I now
 have sound even in flash!


I didn't have any trouble with flash but I'm not on 64bit.  I think it might
be a skype issue for me but I truly have no idea and I think I might just
try what you said



 It would seem that either pulseaudio or ubuntu-desktop interferes with
 sound. I would like to know which it is but if I install either, the
 other installs automatically.

 So it would seem that, on my system at least, pulseaudio gets in the way
 of sound.


-- 
Daniel Bush

http://blog.web17.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] Sound in Ubuntu 9.04

2009-05-18 Thread Daniel Bush
2009/5/19 Daniel Bush dlb.id...@gmail.com



 2009/5/19 Heracles herac...@iprimus.com.au

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Just a short note relating to my earlier post about my Sound Blaster
 Live! problem in Flash on my x86_64 install.

 I reinstalled 9.04 from scratch and lost ALL sound. After reading the
 Skype post from Richard I decided to remove pulseaudio (which took
 ubuntu-desktop with it) and see what happened. Without further ado I now
 have sound even in flash!


 I didn't have any trouble with flash but I'm not on 64bit.  I think it
 might be a skype issue for me but I truly have no idea and I think I might
 just try what you said


... nope, that didn't work either.  My desktop is really sluggish too.  It's
the end of the road for me and 9.04.


-- 
Daniel Bush

http://blog.web17.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] Ubuntu 9.04 performance [Was: Sound in Ubuntu 9.04]

2009-05-18 Thread Daniel Bush
2009/5/19 Jeff Waugh j...@perkypants.org

 quote who=Daniel Bush

  ... nope, that didn't work either.  My desktop is really sluggish too.
  It's the end of the road for me and 9.04.

 Do you happen to have an Intel video chipset?


Yeah, it's all intel.  Integrated graphics and sound.  I can just about live
with the sluggishness (I'm not sure if it is a lot different to 8.04 or not
to be honest) but I need to talk on skype.
I'm prepared to try to debug or troubleshoot if it will improve ubuntu but
I'm a complete novice plus I seem to be a bit of an isolated case.

-- 
Daniel Bush

http://blog.web17.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] Ubuntu 9.04 performance [Was: Sound in Ubuntu 9.04]

2009-05-18 Thread Daniel Bush
2009/5/19 Jeff Waugh j...@perkypants.org

 quote who=Daniel Bush

... nope, that didn't work either.  My desktop is really sluggish
 too.
It's the end of the road for me and 9.04.
  
   Do you happen to have an Intel video chipset?
 
  Yeah, it's all intel.  Integrated graphics and sound.  I can just about
  live with the sluggishness (I'm not sure if it is a lot different to 8.04
  or not to be honest) but I need to talk on skype.  I'm prepared to try to
  debug or troubleshoot if it will improve ubuntu but I'm a complete novice
  plus I seem to be a bit of an isolated case.

 The sluggishness is almost certainly related to the video driver
 performance
 regression in Ubuntu 9.04. There are some half-fixes which introduce new
 problems, but for most users I recommend going back to 8.10 for now.
 Easiest
 way around it, sadly.

 Your audio issue I'm not so sure about (Skype works okay here whether I
 have
 pulseaudio running or not, so, hrm).


It does seize up just momentarily on menus and dropdowns as well as slow
repaints when dragging windows creating an echo effect so I can confirm that
graphics are definitely an issue.
Thanks for the advice.

-- 
Daniel Bush

http://blog.web17.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] OpenAustralia's first hackfest - Saturday 13 June

2009-05-18 Thread Daniel Bush
2009/5/19 Matthew Landauer matt...@openaustralia.org

 For those that were at my SLUG talk a few weeks ago, here's the
 official announcement of OpenAustralia's first hackfest which will be
 on Saturday 13th June, kindly hosted by Google at their Sydney
 offices:

 http://anyvite.com/5qitmm44gl

 There are a limited number of places and a big chunk of them have gone
 already so to be assured a place sign sooner rather than later at the
 link above!

 For those that weren't at the talk, http://www.openaustralia.org/ aims
 to bring the goings on at the Australian parliament a little closer to
 home for most people. The hackfest is an opportunity for a bunch of
 hackers to get together for the day, build some cool stuff, help
 democracy, and share some knowledge and generally have fun.


In the past I've sometimes thought it would be good to put legislation under
version control.  Maybe mercurial or bazaar or even git :)
Than you could tag releases that get passed; run diffs between older
versions; new acts that amend existing acts would hold these changes as diff
patches.
It'd be crazy awesome.  :)


-- 
Daniel Bush

http://blog.web17.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


[SLUG] Re: microphone / skype / ubuntu 9.04 jaunty

2009-05-18 Thread Daniel Bush
2009/5/19 Daniel Bush dlb.id...@gmail.com



 2009/5/19 Steven Heimann ste...@nami.com.au

 Skype also failed for me with Jaunty but I simply went to Skype main
 menu - options - sound devices and selected pulse.  After that it seems
 to work.

 lspci lists sound card as Audio device: Intel Corporation 82801G (ICH7
 Family) High Definition Audio Controller (rev 01)


 Mine is:
 Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)

 My skype settings were all pulse to begin with before I started hitting the
 permutations.
 I'm paying the price for getting a slightly fancier controller I fear.
 Playback with pulseaudio was definitely better than without.


Well, I took a deep breath and thought I'd give debian lenny 5.0.1 a try
rather than downgrading to previous ubuntu.
I've managed to get skype sound capture working again for my card (above).

For the sake of anyone who is in my situation with the intel 82801H HD audio
controller:

There was no sound initially after running the netinstall.
I ran 'alsaconf' as root, and it recognized my card and apparently did
some.twiddling for me.
I then ran the gnome sound tests and almost had my head blown off; it was
very very LOUD - so be careful boys and girls - let me sacrifice my hearing
so that you may keep yours.
Skype/microphone still wasn't working;  so in alsamixer (press F4 for
capture controls) I set 'Input Source' to 'Front Mic' for my first input
source control; also quite possibly one or more of the muxes and general
capture settings had to be turned up.
I let skype adjust my audio settings (that tick box near the bottom).
I was using the latest static skype 2.0.0.72.
Now it seems to be back to normal when I do a test call.
There's no pulseaudio on this system - I don't necessarily think or really
know if it had anything to do with the problems - just a datapoint for you.

I did most of this in ubuntu 9.04 except for the alsaconf bit.

-- 
Daniel Bush

http://blog.web17.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] HTTP server recommendations?

2009-05-17 Thread Daniel Bush
2009/5/17 Erik de Castro Lopo mle+s...@mega-nerd.commle%2bs...@mega-nerd.com


 Erik de Castro Lopo wrote:

  Apache, boa, lighttpd, something else?

 Rob Collins on irc suggested Apache so I installed that from an
 Ubuntu Hardy package. The setup was much easier than I remember
 it being. Standard HTTP and CGI worked out of the box.

 I would still be interested in hearing about people using other
 servers and their reasons.


I've always liked lighttpd.  I like the conf's.  I once got it to run rails
and mediawiki on a really small vps and it was a lot faster out of the box
than apache.  That being said I think there were issues with it and proxying
and with rails not that that would affect you with your stuff..

The other one I've used and liked is nginx.  It's fast and light and quite
capable and this is what I use for rails with reverse proxying to some
backend http app servers..However I'm looking at apache again for doing this
sort of stuff as well.

I should add that I haven't really been researching or trying anything new
lately so my views may be a little out of date on these things.


-- 
Daniel Bush

http://blog.web17.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] LVM

2009-05-15 Thread Daniel Bush
2009/5/15 fos...@tpg.com.au

 Quoting Daniel Bush dlb.id...@gmail.com:

  2009/5/15 fos...@tpg.com.au

   - LVM is really cool and well worth the time to rad up on it.   I
   am now going to LVM my home system.
  
  
  I'm planning to do this as well.
  I was thinking back to Mary's backup post last year and thinking if I
  could do lvm snapshots with an external harddrive.  Still a bit new to
 lvm
  though.
  I think you have to install the alternate ubuntu cd to get lvm
  right?
  (unless you are using the server install instead of the desktop).




 The distinction between desktop and server in ubuntu is an install
 option not anything else.  To add lvm to your existing system just
 'apt-get install lvm2'.


Aware of this.  Just weighing up whether to do a clean install so that is
why I think I have to use alternate instead of desktop.



 To convert an existing setup to lvm you have to have some free space
 (partitions or whole harddisks to use).

 First create a volume group (chunk of hardisk spread across one or more
 harddrives)

 sudo lvm
 pvdiskscan
 pvcreate /dev/yourpartions
 vgcreate vg1  /dev/part1  /dev/part2


 create a logical volume somewhere in that volume group  (say 300 gig
 named yourname in vg1)

 lvcreate -L300G -n yourname  vg1

 You can then mksfs.ext3 /dev/vg1/yourname  (replace ext3 with whatever
 is appropriate) and then mount it.


Since I've got you on this subject and maybe others reading this:

I was working with a test server using vmware esx.  It runs on a virtual
disk which is just a file.  I decided to resize the file to a larger size
which created a whole bunch of extra space at the end of the disk.  I made
this an lvm partition (/dev/sda4) using fdisk and then I did something
stupid which was to run mke2fs directly on /dev/sda4.
I then tried to add this as a physical volume to my existing volume group
and then extend one of the existing logical volumes.
So far so dumb, right.

So now lvm tells me I've got X gigs and df -h tells me I've got Y gigs (the
old number).
I think all I have to do is resize the existing fs on the logical volume
(/dev/vg1/lv1) .  I'm thinking there won't be any trouble because even
though /dev/sda4 had some sort of file system added to it (even though it
was an lvm partition), it never got used.  But not sure if running mke2fs on
/dev/sda4 has/will bork something.  (This is just a test system)

On a separate issue:

Is it safe to grow a root/bootable ext3 partition or do I have to unmount it
- the resize2fs man page doesn't say anything but I read somewhere that I
had to unmount and use a rescue disk (maybe this was just for ext2)? And I
also assumed I had to remove the journal, resize, check and then add the
journal.

Is XFS a better solution for server lvm stuff and for growing? -  or maybe
even JFS ??

-- 
Daniel Bush

http://blog.web17.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] LVM

2009-05-15 Thread Daniel Bush
2009/5/15 Amos Shapira amos.shap...@gmail.com

 2009/5/15 fos...@tpg.com.au
  The distinction between desktop and server in ubuntu is an install
  option not anything else.  To add lvm to your existing system just
  'apt-get install lvm2'.
 
  To convert an existing setup to lvm you have to have some free space
  (partitions or whole harddisks to use).

 That's probably the way to convert an existing system to LVM.

 If you want to install Ubuntu with LVM straight away then it's a bit
 more tricky since the LVM package is not included in the installation
 CD so you have to:

 1. Boot live cd.
 2. open shell
 3. apt-get install lvm2
 4. insmod dm_mod
 5. create PV, VG, LV's. Remember that you need to keep /boot on a
 regular partition since grub can't read LVM.

 (I can't remember off the top of my head now whether the GUI installer
 will support creation of LV's once it finds PV's and VG's. In any case
 it will be able to recognize the LV's and allow creation of
 filesystem/swap partitions on top of them).

 6. install system from live to hard disk
 7. mount -bind ... special filesystems (proc, sys, dev) under the
 hard-disk mount point
 8. mount /boot under the right mount point on hard disk

 (the above two steps are required because the lvm package install
 kernel modules and run initramfs)

 9. chroot to the hard disk partition
 10. apt-get install lvm2 again on the hard disk.

 That's more or less it.


That sounds fraught.
Are you sure I can't just go with the alternate cd which will walk me thru
lvm and still give me a desktop kernel/system?

-- 
Daniel Bush

http://blog.web17.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] LVM

2009-05-15 Thread Daniel Bush
2009/5/15 Daniel Bush dlb.id...@gmail.com



 2009/5/15 fos...@tpg.com.au

 Quoting Daniel Bush dlb.id...@gmail.com:

  2009/5/15 fos...@tpg.com.au

   - LVM is really cool and well worth the time to rad up on it.   I
   am now going to LVM my home system.
  
  
  I'm planning to do this as well.
  I was thinking back to Mary's backup post last year and thinking if I
  could do lvm snapshots with an external harddrive.  Still a bit new to
 lvm
  though.
  I think you have to install the alternate ubuntu cd to get lvm
  right?
  (unless you are using the server install instead of the desktop).




 The distinction between desktop and server in ubuntu is an install
 option not anything else.  To add lvm to your existing system just
 'apt-get install lvm2'.


 Aware of this.  Just weighing up whether to do a clean install so that is
 why I think I have to use alternate instead of desktop.



 To convert an existing setup to lvm you have to have some free space
 (partitions or whole harddisks to use).

 First create a volume group (chunk of hardisk spread across one or more
 harddrives)

 sudo lvm
 pvdiskscan
 pvcreate /dev/yourpartions
 vgcreate vg1  /dev/part1  /dev/part2


 create a logical volume somewhere in that volume group  (say 300 gig
 named yourname in vg1)

 lvcreate -L300G -n yourname  vg1

 You can then mksfs.ext3 /dev/vg1/yourname  (replace ext3 with whatever
 is appropriate) and then mount it.


 Since I've got you on this subject and maybe others reading this:

 I was working with a test server using vmware esx.  It runs on a virtual
 disk which is just a file.  I decided to resize the file to a larger size
 which created a whole bunch of extra space at the end of the disk.  I made
 this an lvm partition (/dev/sda4) using fdisk and then I did something
 stupid which was to run mke2fs directly on /dev/sda4.
 I then tried to add this as a physical volume to my existing volume group
 and then extend one of the existing logical volumes.
 So far so dumb, right.

 So now lvm tells me I've got X gigs and df -h tells me I've got Y gigs (the
 old number).
 I think all I have to do is resize the existing fs on the logical volume
 (/dev/vg1/lv1) .  I'm thinking there won't be any trouble because even
 though /dev/sda4 had some sort of file system added to it (even though it
 was an lvm partition), it never got used.  But not sure if running mke2fs on
 /dev/sda4 has/will bork something.  (This is just a test system)

 On a separate issue:

 Is it safe to grow a root/bootable ext3 partition or do I have to unmount
 it - the resize2fs man page doesn't say anything but I read


What I meant to say was grow the root ext3 fs which is on the bootable
first partition  .

somewhere that I had to unmount and use a rescue disk (maybe this was just
 for ext2)? And I also assumed I had to remove the journal, resize, check and
 then add the journal.




 Is XFS a better solution for server lvm stuff and for growing? -  or maybe
 even JFS ??


Found this thread on file systems:
http://linux.derkeiler.com/Mailing-Lists/Debian/2008-01/msg01789.html
Guess I'm sticking with ext3 for the moment.


-- 
Daniel Bush

http://blog.web17.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] recovering xfs

2009-05-14 Thread Daniel Bush
2009/5/15 fos...@tpg.com.au

 Quoting Adrian Chadd adr...@creative.net.au:

  On Thu, May 14, 2009, fos...@tpg.com.au wrote:
 
 ...


 Lessons learnt:

 - a journalling file system is bigger than what you see,  3Tb is really
 3.3Tb when doing a direct copy.

 - Get lots of harddisk in the beginning.   750G drives really only give
 you 698G.  It is annoying to be 300G short and have to go to the shop
 again.

 - Expect lots of wait time,   hard errors on raid take a long time to
 give up.

 - Don't promise anything, expect it to fail.

 - LVM is really cool and well worth the time to rad up on it.   I am now
 going to LVM my home system.


I'm planning to do this as well.
I was thinking back to Mary's backup post last year and thinking if I could
do lvm snapshots with an external harddrive.  Still a bit new to lvm though.
I think you have to install the alternate ubuntu cd to get lvm right?
(unless you are using the server install instead of the desktop).

-- 
Daniel Bush

http://blog.web17.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] w3c-libwww rpm

2009-05-04 Thread Daniel Bush
2009/5/4 Kyle k...@attitia.com

 hello Slug,

 I'm looking at trying to update my BIOS and the Intel update utility is
 telling me I need to ensure I first have the w3c-libwww package installed.

 I have scoured high  low for this package in a repository, but seem unable
 to locate it and the only rpm's I can find all show a build date of sometime
 back in '04 or '05. This leads me to believe that what I'm looking for
 probably doesn't exist anymore or is already integrated into the base
 system.

 But I can't be sure. I read somewhere it's in rpmforge  which I have
 enabled, but no joy.

 What can you tell me about this package please?


It looks like current debian/ubuntu package it.
% aptitude search libwww

p   libwww0 - The W3C WWW library

You're right.  It seems the last work was in Dec-06.
If the rpm is no joy, you could check it out of the CVS server and compile
perhaps:
http://www.w3.org/Library/cvs.html#Releases
Although the ubuntu package is using 5.4.0 (~2003) and the latest is 5.4.1
(2006).  Might be safer to go with 5.4.0.  But I'm not an expert - just had
a look at it.

-- 
Daniel Bush

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


[SLUG] Active Directory and linux

2009-04-19 Thread Daniel Bush
Hi,
Has anyone used Active Directory for authentication/login on their linux
boxes?
Any thoughts and opinions on this vs having a separate ldap server?

-- 
Daniel Bush

http://blog.web17.com.au
http://github.com/danielbush/sifs/tree/master
-- 
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] Active Directory and linux

2009-04-19 Thread Daniel Bush
Thanks Jeff.
Wasn't familiar with winbind.  I'll probably be looking at the first 2
options if I go this route.
-- 
Daniel Bush

http://blog.web17.com.au

2009/4/20 Jeff Waugh j...@perkypants.org

 quote who=Daniel Bush

  Has anyone used Active Directory for authentication/login on their linux
  boxes? Any thoughts and opinions on this vs having a separate ldap
 server?

 Not a lot of point duplicating the functionality or maintenance headaches,
 IMHO. It's relatively easy to set up AD authentication for Linux, but as is
 often the case, you have numerous ways to achieve your goal (ugh). You
 could
 try:

  * pam/nss_ldap/kerberos directly (bit challenging, sometimes brittle)

  * winbind (much easier, but acknowledges AD's centrality in your network
   architecture... sometimes that's entirely fine though)

  * Likewise Open (Open Source product intro to beefier enterprise stuff,
   seems to be nice to use, encouraged in Ubuntu land if that matters to
   you, but I haven't delved into it enough to know if one should be wary of
   codependency problems!)

 I'd recommend winbind as a starting point, especially if you just want to
 start playing around with the possibilities on a few desktop machines or
 file/print servers.

 - Jeff

 --
 linux.conf.au 2010: Wellington, NZ
 http://www.penguinsvisiting.org.nz/

 Laughter is a force for democracy. - John Cleese
 --
 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] Defining Mainsteam

2009-04-07 Thread Daniel Bush
2009/4/7 Ken Foskey fos...@tpg.com.au

 ...

 Hmm discounts all my work.  In one company a mere 2,000 employees got to
 see it.

 Hey if my software is used by tens of people but the results are seen by
 millions does that count?  Nope I guess not really.

 I am wandering away depressed that I have squandered my life programming
 meaningless applications...


cheer up Ken.
Didn't you say you worked on open office?  I probably owe you a beer for
directly or indirectly allowing me to conduct my affairs almost exclusively
in ubuntu for the last several years.
:)


-- 
Daniel Bush

http://blog.web17.com.au
http://github.com/danielbush/sifs/tree/master
http://github.com/danielbush
-- 
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] Defining Mainsteam

2009-04-06 Thread Daniel Bush
2009/4/6 Jeff Waugh j...@perkypants.org

 quote who=Daniel Pittman

  I am curious about the how to bring AppFolders... part of your
  comment, though: as far as I can tell, with the exception of the Rox
  stuff[1] and the GNUStep people[2] no only really cares ... and those
  two are pretty much a niche market...

 There were heaps of projects playing with the idea a few years ago, one of
 thre notably offensive ones being autopackage. OLPC .xo packages are
 essentially appfolders, too.

  (Plus, how hard is it, seriously?  Five lines of code?)

 Every time you're tempted to say that, hold it in and realise you probably
 haven't thought about it very much. It's like when clients say, it should
 be easy to... and suggest something that would require major architectural
 changes to your product...


 I sometimes think the converse can also be true at times - speaking from
very modest experience.
In the first instance, the client/boss asks offhandedly: Can you make this
small change? and it ends up being a rewrite of your life's work or you end
up founding a new branch of computer science in your basement in the wee
hours of the morning just to solve part of the problem (I kid!).  Then they
frown and get all tentative and worried and ask: Can you do this? Is it
difficult? for something that ends up being a one-liner in a template
somewhere.
=]


-- 
Daniel Bush

http://blog.web17.com.au
http://github.com/danielbush/sifs/tree/master
http://github.com/danielbush
-- 
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] Defining Mainsteam

2009-04-03 Thread Daniel Bush
2009/4/3 Rev Simon Rumble si...@rumble.net

 This one time, at band camp, Daniel Bush wrote:

  I don't always like the way debian (and perhaps by extension ubuntu)
 modify
  the conf files and arrange things for various software  - I don't want to
  have to figure out the debian-way on top of figuring out the software
 itself

 Wait a second, you'd rather learn where every piece of software you
 install puts its config files rather than the single place you'll find
 all config files with any Debian package?

 This, for me, is the best thing about Debian!  Configuration is in
 /etc/.  Not /use/opt/lib/conf/ or wherever the weirdo who wrote the
 software thinks config files should go since he started using Unix on
 one of the proprietary open systems in the seventies and that was the
 place it put them.  If config isn't in /etc/, it's a bug.


Yo. I'm with you man!
What I meant was the way some confs etc are done in /etc. I've been using
freebsd (just learning) and the /etc/ssh/sshd_config was done slightly
differently and looked like it was taken from the project/openbsd with some
modifications (I don't know for sure but it sort of says it at the top and
spells out the rationale for the whole conf file).  At the time I was
setting the system up I remember thinking that I preferred it.
But this extra layer of debian-ness is also a good thing as it creates
standardisation.  Noone inheriting a box from me has to work out the crazy
way I structured apache if I adhere to the debian way etc etc

-- 
Daniel Bush

http://blog.web17.com.au
http://github.com/danielbush/sifs/tree/master
http://github.com/danielbush
-- 
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] Defining Mainsteam

2009-04-02 Thread Daniel Bush
2009/4/3 Malcolm Johnston dr...@internode.on.net

 Regarding Martin Visser's comments in the final Sound Problem posting.  I
 don't want to incite a Holdens versus Faclcons type debate here, but how
 would one briefly characterize mainstream Linux these days?
 ...

 All this may be just me.  I haven't had a decent look at distros like
 Ubuntu,
 and this is why I ask my question.  What, in a nutshell, is their appeal?
 One one level it's all Unix, of course, but, given that, what are the
 appealing differences?



I don't always like the way debian (and perhaps by extension ubuntu) modify
the conf files and arrange things for various software  - I don't want to
have to figure out the debian-way on top of figuring out the software itself
-  but the thing I keep coming back to is the packaging system and
particularly apt/aptitude.  It's gold [1].

I've used yum utility with centos which does a similar thing but I had more
trouble getting what I wanted (that may be because of less experience and
the fact I was using one version below current).

The other thing is that debian and its non-commercial nature seems like an
interesting phenomenon in itself.  It feels big, comprehensive and reliable
(that ssh thing last year notwithstanding :) ) but it's not backed by any
big company or an overt commercial interest.   Seems to me that there is
definitely something valuable there in the way it brings together a lot of
the best free/open-source software into a unified system that can be shown
off to the world.

[1] it also helps that there are isp's like iinet who provide free mirrors
for debian/ubuntu/* repositories which you can use if you are customer

-- 
Daniel Bush

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


Re: Insulting racial terms (was Re: [SLUG] Re: [chat] Version control)

2009-03-24 Thread Daniel Bush
2009/3/22 Kevin Saenz kevsa...@spinaweb.com.au

 We are Not Political Correctness R Us.

 thus can we all Drop this Political Correctness Nightmare and start
 discussing Linux related topics?



If only Robert had said whoa there kemosabe!
Everything would have been just dandy.
Everyone under the age of about 30 - spanish or not - would be going like
what?.
:)

Question: Where does the Lone Ranger take his garbage?
Answer: To the dump, to the dump, to the dump-dump-dump!
[wikipedia]



Hi-yo Silver, away!
-- 
Daniel Bush

http://blog.web17.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: Insulting racial terms (was Re: [SLUG] Re: [chat] Version control)

2009-03-24 Thread Daniel Bush
Did you know that 'git' in english means, uhm, git ? :D
Someone, get Linus on the line!

2009/3/25 david da...@kenpro.com.au

 I'm really upset...

 I'm white, male, not crippled or deformed or a dwarf, no disabilities, have
 a job, not over 65, I'm not a lesbian, or a whale.

 How come *I* don't get insulted! This is discrimination.

 Michael Davies wrote:

 On Tue, Mar 24, 2009 at 10:39 PM, Daniel Bush dlb.id...@gmail.com
 wrote:

 If only Robert had said whoa there kemosabe!
 Everything would have been just dandy.


 http://www.geocities.com/TelevisionCity/7286/RANGERFARSIDE.GIF

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




-- 
Daniel Bush

http://blog.web17.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] Re: useful bash tricks thread

2009-02-08 Thread Daniel Bush
2009/2/9 Amos Shapira amos.shap...@gmail.com

 At the risk of being called an oldie, I keep using !-notation since
 the early tcsh days. E.g. !$ or !:2-3.

 You can also use things like

 !less:*

 to fetch the parameters of the latest less command.

 I can't type alt- because alt-shift is my keyboard language-switching
 combination, so I don't know how this compares with good old
 bang-notation.

 Other useful stuff:

 ^x^y will replace the first x on the previous line by y. Use a
 third ^ after y if it contains space. It's actually a short for
 !!:s/x/y/

 ...


I knew it.  I knew there were more of you out there! :)
That whole bang/caret substitute-a-pattern-and-then-run thing just scares me
though, plus its hard to type.  I'll stick with ctrl-r and vi-mode.  But
interesting...





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


[SLUG] Re: useful bash tricks thread

2009-02-07 Thread Daniel Bush


On Feb 6, 9:06 pm, Tony Sceats t...@fatuous.org wrote:
 It's been a while since there's been a thread like this, so I thought it
 would be fun :)

 so, have you got any?

 I've got 2 to share today:

 alt and then
 alt 


woo, that's kinda interesting.
It seems to pick the last word for each entry in the command-line
history?

Definitely second ctrl-r; I can't imagine a world without it.. Well i
can, I used to work with an older unix guy who used some older version
of bourne or c-shell and used !pattern (something like that) to run
previous commands.  No, never again.  Mind you, I set my shell to use
vi mode (set -o vi) which I think would freak out a lot of people.


I often have several files of related commands that I source into my
current shell.
This isn't a trick, more a set of conventions which I've found useful
to help keep me on top of things.
eg

  % . some_file.sh

This file would have the following format:

  h() {
less -EOF
VAR1: $VAR1
VAR2: $VAR2
...

func1 - do X
func2 - do Y
EOF
  }

  VAR1=some_val1
  VAR2=some_val2
  ...

  func1() {
...
  }
  func2() {
...
  }

Then you can simply do:
  % func1 ...
to run your routine.
  % h
will list the commands and their descriptions assuming you've
documented them.
There are number of plain words you can use for your function names:
go,show,build,change,list,check,log,update,start,stop etc

You might do this to parcel up a bunch of related commands for some
area or thing.  For instance, managing a database.  'go' might take
you to conf directory or put you into the database shell etc etc  It's
also a good place to stash notes if you're learning something or
documenting it - either as comments or in the h() or simply in the
functions themselves. Listing things like relevant locations and
filenames as shell VARS is good documentation too.

My other even more OT tip: if you use the commandline a lot and you
haven't tried screen, try it and become the super nerd you were
always meant to be.

--
Daniel Bush
--
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] useful bash tricks thread

2009-02-07 Thread Daniel Bush
Sorry, meant to post this to the list...

2009/2/8 jam j...@tigger.ws

 On Saturday 07 February 2009 10:00:05 slug-requ...@slug.org.au wrote:
  It's been a while since there's been a thread like this, so I thought it
  would be fun :)
 
  so, have you got any?
 
  I've got 2 to share today:
 
  alt and then
  alt 
 
  for interactive shells, works kinda like ctrl r or !$ - that is, it
  searches your history but in a strangely useful but different way

 The petrol in this car  meaning this message is too vague - BASH does
 not
 do any of this READLINE in bash does so say do:
 set -o vi
 and all the above is completely false, and vi stuff applies instead

 So 'when using bash in emacs mode you can ... bla bla'

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




-- 
Daniel Bush

http://blog.web17.com.au
http://github.com/danielbush
http://web17.com.au

If we set aside all thoughts and see, there will be no such thing as mind
remaining separate; therefore, thought itself is the form of the mind. Other
than thoughts, there is no such thing as the world. ~ Sri Ramana Maharshi
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Fwd: [SLUG] useful bash tricks thread

2009-02-07 Thread Daniel Bush
I'll get this right eventually...

2009/2/8 jam j...@tigger.ws

 On Saturday 07 February 2009 10:00:05 slug-requ...@slug.org.au wrote:
  It's been a while since there's been a thread like this, so I thought it
  would be fun :)
 
  so, have you got any?
 
  I've got 2 to share today:
 
  alt and then
  alt 
 
  for interactive shells, works kinda like ctrl r or !$ - that is, it
  searches your history but in a strangely useful but different way

 The petrol in this car  meaning this message is too vague - BASH does
 not
 do any of this READLINE in bash does so say do:


Well, yeah, readline is used by bash.  But bash often seems to have it by
default (there's usually a whole section for it in the manpage).



 set -o vi
 and all the above is completely false, and vi stuff applies instead


I don't have any trouble using ctrl-r with (readline's) vi mode but I think
atl- is more problematic. Guess I'm getting the best of both worlds.


 So 'when using bash in emacs mode you can ... bla bla'

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



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


[SLUG] Re: Sharpening an image.

2009-01-09 Thread Daniel Bush
wbenn...@turing.une.edu.au wrote:

 I've a file taken with a mobile phone.

 The detail is execrable.

 It's important to identify a couple of faces in the file.

 I've asked around. The best I have is to go through the file, select a
 critical frame, download it and use The Gimp to sharpen a given face.

 First off, can this be done?

I haven't tried loading video files into gimp (I'm assuming you mean
some sort of video file right?).
I know that you can convert frames to pictures using mplayer:

  mplayer video_file  -vo png -ss 1:00:00 -endpos 4

This will approximately play from 1hr to 1:00:04 and capture the
frames as png images in the current directory (I haven't actually
tested it so you might need to add the compression option in (-vo
png:z=0 etc).  There's also jpeg which has more options in my version
of mplayer.

You may need to check which -vo's are supported:
  mplayer -vo help


I think you can also apply filters on the video using -vf including
unsharp mask:
  mplayer -vf help
A random example:
  mplayer video_file  -vo png -vf unsharp=l7x7:1.5 -ss 1:00:00 -endpos
4

See the man page for mplayer.

Other ways of sharpening the resulting images might include: getting
gimp to batch process them (haven't done this); or using imagemagick's
'convert' to sharpen the images using something like the -sharpen
option in a simple shell script.


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


[SLUG] Re: hosted blogging account with open backend.

2008-12-07 Thread Daniel Bush


On Dec 7, 9:57 pm, Ben [EMAIL PROTECTED] wrote:
 I want to open up a blog quickly using a hosted blog system, eg.
 blogger, livejournal etc.

 Some time in the future I want to extract the data (posts and
 comments) out of the blog and convert it to my own system (probably
 written in django, or using some other system).

 What hosted system will be easiest to extract the data from in the
 future (I'm happy trying to write code to talk to database APIs, but
 would prefer not trying to automate page scraping).


I've been meaning to put some stuff up too and shared your concerns.
I'm trying out blogger (google).  There is a RESTful api for uploading
and pulling down articles and also comments (I think).

http://code.google.com/apis/gdata/overview.html
http://code.google.com/apis/blogger/

I found the docs a bit confusing, but I've tested it using curl.  eg
for POSTing a new article (something very roughly like this):

curl -H Authorization: GoogleLogin auth=$Auth \
 -H Content-Type: application/atom+xml \
 -d @example_post.xml \
 https://www.blogger.com/feeds/$blog_id/posts/default

You need to authenticate and get an auth token and know your blog id.

I'm guessing wordpress has got similar.

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


[SLUG] Re: network manager over writes resolv.conf

2008-11-23 Thread Daniel Bush


On Nov 24, 4:18 pm, david [EMAIL PROTECTED] wrote:
 Hi Jeff...

  From my original post:

   System/Preferences/Network Configuration GUI tool fails with the following
   message:
  
   Updating connection failed: nm-ifupdown-connection.c.82 - connection update
   not supported (read only)
  

 So now that the lovely clever gui tool doesn't work, what do I do next? go 
 back
 to the old fashioned config files that I was comfortable with? I can't because
 they are now mysteriously over-written or silently ignored!


If it comes to that, there must be a way to disable network manager?
Not saying you should, but I confess to having done this when I got a
new laptop earlier this year.

NM was working on my system but occasionally it wouldn't and when this
happened I was hosed especially with wireless.

I think what I did was to go into /etc/dbus-1/event.d/25NetworkManager
and 26NetworkManagerDispatcher and disable the start scripts (ubuntu
8.04)
That's probably totally totally wrong but it works for me.
My resolv.conf hasn't been eaten since the 29-Mar-08.

I have a shell script for switching between wireless and wired modes
(involving wpa_supplicant etc) on top of the ifup-ifdown-etc/network/
interfaces stuff.

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


[SLUG] Re: Steve Ballmer live rally Sydney November 6

2008-11-04 Thread Daniel Bush


On Nov 2, 6:40 am, Robert Collins [EMAIL PROTECTED] wrote:
 On Sat, 2008-11-01 at 23:23 +1100, Gerard Kelly wrote:
  Hey All,

  Microsoft's CEO Steve Ballmer will be hosting a live rally in Sydney
  on
  November 6th.
 ...
  Make a note in your diary now and be watching at the dawn of a new age of
  freedom.

 ...

 In what psychotic world did you imagine this was ontopic for a linux
 users group list?


I, for one, welcome our new cloud computing o...
...oh forget it  :)
--
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] laptop sound playing out onboard speaker headphones

2006-11-30 Thread Daniel Bush

Hi Sonia,

On 30/11/06, Sonia Hamilton [EMAIL PROTECTED] wrote:

I have a problem with sound on my laptop, that commenced with my upgrade
to Ubuntu Edgy - any hints on how to troubleshoot it?

The problem is that when I plug in headphones, the sound keeps playing
out the laptop speakers, thus annoying other people who have to listen
to my atrocious taste in music :-)


Try removing the pcspkr kernel module.  Check if it's there using
lsmod.  I had the same problem but when I remove it, the sound no
longer leaks from the speakers when I have my headphones in.  I use
'rmmod pcspkr' to do this.  However, when I inserted it in again using
modprobe and then removed it again, the sound problem did not go away.
So there is more going on here perhaps.

I nice side effect of removing this module is that you will also
remove the heart-attack-inducing console beep problem as well.

Daniel.
--
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] laptop sound playing out onboard speaker headphones

2006-11-30 Thread Daniel Bush

On 30/11/06, Daniel Bush [EMAIL PROTECTED] wrote:

Hi Sonia,

On 30/11/06, Sonia Hamilton [EMAIL PROTECTED] wrote:
 I have a problem with sound on my laptop, that commenced with my upgrade
 to Ubuntu Edgy - any hints on how to troubleshoot it?

 The problem is that when I plug in headphones, the sound keeps playing
 out the laptop speakers, thus annoying other people who have to listen
 to my atrocious taste in music :-)

Try removing the pcspkr kernel module.  Check if it's there using
lsmod.  I had the same problem but when I remove it, the sound no
longer leaks from the speakers when I have my headphones in.  I use
'rmmod pcspkr' to do this.  However, when I inserted it in again using
modprobe and then removed it again, the sound problem did not go away.
 So there is more going on here perhaps.


Maybe I need to correct this.  I think the problem is when I come out
of suspend.  The pcspkr is not inserted, but the sound comes out of
the speakers with my earphones in, once again.

Daniel
--
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] tailing, following and filtering

2006-11-22 Thread Daniel Bush

On 23/11/06, Craig Dibble [EMAIL PROTECTED] wrote:

Matthew Hannigan wrote:
 On Thu, Nov 23, 2006 at 08:23:37AM +1100, Penedo wrote:

 What's wrong with tail -f syslog | grep ...?

 Buffering


more or less



less is better than more
--
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] tailing, following and filtering

2006-11-22 Thread Daniel Bush

On 23/11/06, Penedo [EMAIL PROTECTED] wrote:

On 23/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 tail -f /var/log/syslog |grep something |grep -v but-not-this |less

Make it | less -F +/re-to-highlight so you can always ^C to scroll
back through the output then type F again to get back to the bottom
and tail from there.



Not sure about the 'less -F'.  In my version '-F' is different to 'F'
- the latter being pressed after less is up and running.  'F' works
like 'tail -f' but 'less -F' does something else.  I like using F not
least because you can search and highlight values.

But I couldn't get it to work like the 'tail -f ... | grep ... '
paradigm - ie using grep to filter on the lines: less -some_switch |
grep

Daniel
--
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] can ruby run perl/python libraries?

2006-11-16 Thread Daniel Bush

Hi Sonia,

On 17/11/06, Sonia Hamilton [EMAIL PROTECTED] wrote:

I'm thinking of learning Ruby ...

Yay! Another rubyist!
One thing I can say, if you like oop, you will probably like ruby.


- is there an easy way of running Perl and
Python code/libraries from Ruby? I've googled and browsed manuals in
Dymocks Library ^H^H^H Bookshop, can't seem to find an answer.


This cropped up on the ruby talk list with regards perl in late
September - http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/217173.
Looking at the thread I'm not sure if there was a consensus -
certainly no magical wrapping utility was mentioned when I last
checked.

You can run perl from C.  And you can run/use C from ruby so if you're
desperate you can bolt something together that way, maybe after a
couple of beers.

Some of the more common things in perl are replicated, sort of, in
ruby.  There is a CGI module and also dbi/dbd for instance, but the
latter is nothing like as complete as perl.  You might want to check
out rubyforge.org, as well as the Pragmatic Programmer's Guide book
which takes you through some of the more common modules which come
with ruby.


Reason I ask is that I want to learn Ruby for Ruby on Rails, but there's
so much good stuff in the existing Perl and Python libraries/cpan.



Definitely recommend you try rails out, and get used to its brand of
MVC - you may not need whatever it is because rails comes with a lot
of stuff but it takes time to exploit all of it  (including some of
its conventions).  I usually install ruby from source (esp. on debian
systems), and then set up rake and gems from source as well.  Then use
the gem utility to install rails and database stuff.  Ruby gems will
also handle multiple versions of rails.


(Yes I know about Python/Django, but Rails seems to have better
doco/manuals at the moment).

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



Daniel
--
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] Can't seem to save the size of firefox browser under Gnome.

2006-11-16 Thread Daniel Bush

On 17/11/06, Michael Lake [EMAIL PROTECTED] wrote:

Michael Lake wrote:
 Whenever I start Firefox it starts full screen and I have to drag the
 edges to make it smaller. I have made it the size I want and Under
 Desktop/Preferences/Sessions I have set clicked Save the current
 session. It says Your session has been saved. Alas I login again and
 Firefox is full screen.



Do you un-maximize (restore) it or do you resize it from a maximized
state?  Are you using metacity or sawfish?  I can resize a maximized
window in sawfish, not sure about metacity.  It may be in auto-expand
mode when you first load it up because it is maximized.  Just a
guess.

I'm using gnome in ubuntu 6.10.  No full screen problems with firefox.
 I launch it manually.

Daniel
--
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] dualling with dell

2006-11-12 Thread Daniel Bush

Michael and Sridhar, thanks for your posts.

Sridhar, I'm a complete laptop n00b but I wanted to ask you if your
cores are on 46% or ~1MHz when idling (my spec is 2.13MHz cores)?
And have you noticed any heat issues (in comparison to windows)?  I
went for a meaty graphics card but now I'm wondering if this may be a
problem in future.  It feels like the system  runs hotter in linux
than in windows which is a concern.

---
Separately, for the benefit of anyone taking the plunge with dell,
here is what I did ( I'll exclude things like defragmenting and having
a boot cd with qt_parted  to do the partitioning etc):

I ended up putting ubuntu 6.10 on the 3rd primary partition of my dell
inspiron 9400.  I installed grub to the boot sector of this partition
and not the MBR - you have to be pretty careful about how you tell the
ubuntu 6.10 desktop installer to do this, there is just one text box
where you type in the grub location and by default it is the mbr so
you have to override it using grub notation (you should probably also
opt for manual partitioning when the installer asks to ensure you have
the choice).

The dell MBR remains preserved.  It's not too bad actually: all it
does is select the active partition and invokes its bootloader.
Having made the 3rd partition active (using a sysrescue cd) with grub
in the boot sector, the dell MBR invokes grub.  Grub in turn can boot
ubuntu or win XP on the second partition.

The dell utility partition remains intact as the first partition; and
I can view its contents in gnome.  The installer program tried to
re-format it because it thought it was damaged FAT16 but I stopped it
from doing this.

I was just not brave enough to mess with the HPA at the end of the
disk.  A word of caution: if you press the media direct button, it
will boot mediadirect (I think this requires the dell mbr), which
includes messing with your partition table to make the hpa visible.
When you log out of md it un-messes with it, but it will make the
second partition active, so you won't see grub next time you boot,
you'll just get windows.  Solution is to either make the 3rd partition
active again or maybe configure the windows bootloader - I've opted
for the former.

I also removed the recovery or DSR partition; dell provide a utility
which you can run from windows to do this.


Daniel
--
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] core 6

2006-11-08 Thread Daniel Bush

On 09/11/06, Lloyd Gall [EMAIL PROTECTED] wrote:

Hey guys.

Do you guys mail out fedora core 6 DVD's? Is there a fee involved?



Regards Lloyd Gall

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



Try elx.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


[SLUG] dualling with dell

2006-11-02 Thread Daniel Bush

Hi Folks,
Anyone here who can offer advice on dual booting a modern dell laptop
(inspiron 9400) whilst preserving at least some of the dell
functionality?

I've done some research on this [1], and it looks like I have
1) a dell-based MBR
2) a dell utility partition at the front of the disk
3) winXP in the 2nd parition
4) a dell system recovery (symantec-based image) partition (DSR) at
the end of the disk
5) a hidden partition that won't be detected by the bios (a process
called 'hpa') which is right at the end of the disk which allows you
to use dell media direct (play dvd's without loading a full os).
A diagram of this setup is on the mediadirect link below ([1]).

I'm interested to know if people are putting grub in the MBR or trying
to preserve the dell MBR, because if you use grub, you are probably
going to lose the functionality for both the utility and rescue
partitions.
I can see a method for how to use the windows bootloader - instead of
grub in the mbr -  to boot linux (in linuxdevcenter article [1]), but
is this going to work on top of the dell mbr?  Is it chainloading or
something?

The utility partition looks replaceable; also the dell resouce cd may
do a similar job to this utility so it seems superfluous.

The dsr partition looks irreplaceable.
However I have a dell winxp disc and a dell resource cd which suggests
that, if I really wanted to, I could re-install windows and the
drivers without using the rescue partition or any of the dell stuff
that was originally on my disk.  It would be less convenient, but good
enough.  And there are alternatives.

Then there's the hidden mediadirect hpa partition which might be a gig
or two.  Has anyone done anything with this on their modified systems?

Whilst I'm trawling for advice: I can't seem to get a consensus on the
size of the swap partition.  I have 2gb of ram.  How much of an issue
is swap?

Some thoughts from anyone who has been or currently is in the trenches ?
Thanks,
Daniel.


[1]
http://www.goodells.net/dellrestore/
http://www.goodells.net/dellutility/index.htm
http://www.goodells.net/dellrestore/mediadirect.htm
http://www.linuxdevcenter.com/lpt/a/6554
--
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] scripting question

2006-10-17 Thread Daniel Bush

Hi

On 17/10/06, Sonia Hamilton [EMAIL PROTECTED] wrote:

I've written a small script that archives email - it works, but I was
wondering if there's any better way to write it (apart from using
another language).

Damn.


The script is:

 for i in z_bak:7 root:14 y_spam_definite:56 ; do
 mydir=${i%:*}
 mydays=${i#*:}

$mydir is the directory to cleanup, $mydays is the # of days I want to
keep email. Is there any better way of writing the for loop to go thru
the 2 sets of values?


Not that I can see - mildly curious to know if there is.  AFAIK Bash
only has 1-dimensional arrays (in my version), certainly no hashes.
The above script looks quite compact along with those annoying
substitution operators that I can never remember.

I tend to use 'case' if I'm shelling - which is far more verbose:

for mydir in z_bak root y_spam_definite ; do
 case $mydir in
   z_bak)
 mydays=7
   ;;
   foo|bar|baz)
 mydays=100
   ;;
   *)
  echo $0: Bad mail directory used : '$mydir' 2
   ;;
 esac
done



Here is a crazy version using arrays:

expires=(
z_bak:7
root:14
y_spam_definite:56
)

for (( i=0; i${#expires[*]}; i++ )); do
 j=${expires[$i]}
 mydir=${j%:*}
 mydays=${j#*:}
done

It's kinda lost some clarity at this point (!).  What I was trying to
do was to put the delete settings at the top in a simple list for easy
configuration.
(I've used arrays before in a script which stores my sometimes
numerous working directories in a file so that I can call these up and
jump back and forth between locations more easily)

Daniel.
--
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] My system can't find Java tools

2006-10-02 Thread Daniel Bush

Hi Andrew,

There seem to be quite a lot of resources on the web for shell.  Shell
is a programming language with conditionals and loops; you could for
instance write a webserver in it if you really wanted to.
You could start with
http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html which looks
quite good.

Worth checking out the original classic book The Unix Programming
Environment - if you ever see it.  It's quite expensive but gives you
an idea of unix and the shell and how it all came about.

On 01/10/06, Andrew Dunkin [EMAIL PROTECTED] wrote:

If you have time, could you possibly explain what the change to
/etc/bashrc/ that you suggested did and why it fixed the problem.


The original line said PATH=stuff.
We changed it to PATH=$PATH:stuff.
By including $PATH, we preserve what was already in PATH before this
line is executed by the shell.  Failing to preserve what was in PATH
prior to the execution in this line is what caused you a problem.
The line is badly written.  The line inside java.sh is relatively
well-written.

(You have to append a variable name with '$' when used on the RHS of
the above example; this tells the shell to insert the value of PATH
into the RHS; similarly you say echo $PATH to view the value of
PATH)


You made a comment earlier in this exchange of emails as follows;
It still wouldn't do what you wanted because it would be setting the
PATH variable of a subshell running off the shell you logged in to and
NOT the shell you are typing into.
This made little sense to me as I do not understand how shells and
subshells work.


That was badly worded.


Could you briefly explain what your comment meant. Even if I don't
understand your response, it will guide me in further research.


To start with, you have shell.  This allows you to interact with the
linux system (the kernel)  to run commands and access files etc.

The shell has at least 2 major modes - interactive and batch-file mode.

When you login to the command line, you are using bash interactively.
It displays a prompt and you type names of programs in it, hit return
and  it then gets the system to execute.  eg ls to list directory
contents.  So the shell mediates between you and the os.

You can also write shell scripts like your java.sh and store these in
files on your system.
To execute these, you have to invoke another shell and you do this
from your existing interactive shell
eg  % bash java.sh
'bash' is a new shell; it's a new, separate instance of the same
program as the interactive shell you logged in to; because you are
running it from your shell, it is referred to as a subshell.  It is
not interactive because it has been given 'java.sh' to execute.  It
will execute this and return its status to the interactive shell.

That is why 'bash java.sh' or 'sh java.sh' does not work as intended.
It only modifies the the subshell executing java.sh.

The use of 'export' in java.sh is significant; it puts the shell
variable into the execution environments for processes which are
executed by the shell executing java.sh.  In the case of 'bash
java.sh', 'export' is only working with respect to the subshell and
any processes it executes not your interactive shell.

When you're reading up on this be aware of environment variables vs
shell variables (use of 'export' , 'set' , 'printenv' , 'env'';
subshells vs using '.'; special shell variables like PATH etc

cheers,
Daniel.
--
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] My system can't find Java tools

2006-09-29 Thread Daniel Bush

G'day Andrew,
Yeah, I think I can probably see it.
In your /etc/bashrc you have a line near the bottom:

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/share/pvm3/.

If I'm right, thats your prob.

Change to
PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/share/pvm3/

In my previous response I was going to mention that if PATH was being
clobbered, the culprit might be identifiable from your existing PATH
ie the pvm3.

It seems to bear this out.

And don't forget to clobber the person that put that line in :D

Cheers,
Daniel.

On 29/09/06, Andrew Dunkin [EMAIL PROTECTED] wrote:

Daniel,
Thanks. Still no success, but here is the latest.

# HERE IS MY ORIGINAL .bash_profile
#
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
   . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
#

#
# I THEN EDITED .bash_profile AS FOLLOWS,  LOGGED OUT  IN;
#
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
   . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
export PATH=$PATH:/usr/java/j2sdk1.4.2_07/bin/

## THIS DID NOT WORK. JAVA COMMANDS NOT FOUND.
##

##

## SO I EDITED IT AS FOLLOWS, LOGGED OUT  IN;

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
   . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH=$PATH:/usr/java/j2sdk1.4.2_07/bin/
unset USERNAME

## THIS DID NOT WORK.  JAVA COMMANDS NOT FOUND.
#


## I THEN EDITED IT AS FOLLOWS, LOGGED OUT  IN;
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
   . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/java/j2sdk1.4.2_07/bin/

export PATH
unset USERNAME
## THIS DID NOT WORK EITHER. JAVA COMMANDS NOT FOUND.
#

#
Below are my original files;
/home/user/.bash_profile
/home/user/.bashrc
/etc/bashrc
/etc/profile

Can you see anywhere where the PATH is being reset in any of these?
I am not quite sure how to interpret the contents of these files.
Can you think of any other edits that may work?
#
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
   . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME


#
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
   . /etc/bashrc
fi
###


#
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ `id -gn` = `id -un` -a `id -u` -gt 99 ]; then
   umask 002
else
   umask 022
fi

# are we an interactive shell?
if [ $PS1 ]; then
   case $TERM in
   xterm*)
   PROMPT_COMMAND='echo -ne \033]0;[EMAIL PROTECTED]:
${PWD}\007'
   ;;
   *)
   ;;
   esac
   [ $PS1 = \\s-\\v\\\$  ]  PS1=[EMAIL PROTECTED] \W]\\$ 

   if [ -z $loginsh ]; then # We're not a login shell
   for i in /etc/profile.d/*.sh; do
   if [ -x $i ]; then
   . $i
   fi
   done
   fi
fi

unset loginsh
# PVM environement
export PVM_RSH=/usr/bin/rsh
export PVM_ROOT=/usr/share/pvm3
export PVMD_NOHOLD=ON
export PVM_TMP=/var/run/pvm3
export XPVM_ROOT=/usr/X11R6/lib/xpvm/
export
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/share/pvm3/
##

#

# /etc/profile -*- Mode: shell-script -*-
# (c) MandrakeSoft, Chmouel Boudjnah [EMAIL PROTECTED]

loginsh=1

# Users generally won't see annoyng core files
[ $UID = 0 ]  ulimit -S -c 100  /dev/null 21

if ! echo ${PATH} |grep -q /usr/X11R6/bin ; then
   PATH=$PATH:/usr/X11R6/bin
fi

if [ $UID -ge 500 ]  ! echo ${PATH} |grep -q /usr/games ; then
   export PATH=$PATH:/usr/games
fi

umask 022

USER=`id -un`
LOGNAME=$USER
MAIL=/var/spool/mail/$USER
HISTCONTROL=ignoredups
HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z $INPUTRC -a ! -f $HOME/.inputrc ]; then
   INPUTRC=/etc/inputrc
fi

# some old programs still use it (eg: man), and it is also
# required for level1 compliance for LI18NUX2000

Re: [SLUG] My system can't find Java tools

2006-09-25 Thread Daniel Bush

Hi Andrew

On 25/09/06, Andrew Dunkin [EMAIL PROTECTED] wrote:

I installed Java SDK 1.4.2_07 a year or so ago on my Linux system in;
/usr/java/j2sdk1.4.2_07/

In
/etc/profile.d/
there is a file named java.sh
the contents of this file are as follows;
export PATH=$PATH:/usr/java/j2sdk1.4.2_07/bin/

I believe this script is supposed to execute at login and allow Java
tools to be used from any directory.
It all worked fine. I could execute Java commands from any directory.

Recently I connected a router to provide ADSL connectivity to the
Internet.
When I did this I noticed that my command prompt changed from;
[EMAIL PROTECTED] username]$
to
[EMAIL PROTECTED] username]$

As soon as the router was connected I found I could no longer get Java
commands to work from anywhere.
All I get is error messages such as;
bash: java: command not found

What has happened? Has an environment variable been changed?


Well, it looks like your PATH variable no longer contains the path to
your java progs.  Which means that java.sh isn't being run when you
log into your shell OR maybe it is, but then your settings are being
overwritten by some other script which is resetting your path
variable.



Here is the result of echo $PATH;
[EMAIL PROTECTED] username]$ echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/share/pvm3/



This confirms your PATH is not updated.


I tried executing java.sh as follows;
[EMAIL PROTECTED] profile.d]$ java.sh
bash: java.sh: command not found



It doesn't know where to find java.sh.  It will look at $PATH for this
and there is no path to where java.sh is stored (ie /etc/profile.d/).
So trying to execute java.sh like the above won't work.
But, you probably don't want to have /etc/profile.d in  your path
because it is meant for configuring your shell at login time.


I thought this comand would cause the script to execute, but it did not.
How do I execute this script?


If you executed it like this:

sh /etc/profile.d/java.sh

It still wouldn't do what you wanted because it would be setting the
PATH variable of a subshell running off the shell you logged in to and
NOT the shell you are typing into.

At your command prompt, you could do this:
. /etc/profile.d/java.sh

The '.' means to execute the file in your current shell.  This should
update your PATH.  Or you could manually execute the contents of
java.sh at the prompt which is what you did here:



I then manually executed the contents of java.sh as root by executing
the line of code contained in it as a command from the command prompt as
follows;
[EMAIL PROTECTED] username]# export PATH=$PATH:/usr/java/j2sdk1.4.2_07/bin/
Then root could access Java commands OK, but username could not.

I then manually executed the contents of java.sh as username using the
same method.
[EMAIL PROTECTED] username]$ export
PATH=$PATH:/usr/java/j2sdk1.4.2_07/bin/
Then username could access Java commands OK.

It seems that execution of the java.sh script at login is not working.
Could this be asscociated with the change in host from localhost to
myISP when I connected the router? This is after all the event that
seemed to trigger this entire problem. How do I cause Java tools to
automatically be accessable from all directories as they once were?



The problem might be a side-effect of the change but it isn't really
the same issue.

I assume you are using bash?
/etc/profile.d is used by /etc/profile.  Also see /etc/bashrc.
For whatever reason, your java.sh is not being run when your shell is
configured at login time or you PATH variable is being clobbered by
some other script.

A quick fix would be to modify your personal bash profile file and
test it to see if it works:

This is usually in
/home/user/.bash_profile.

Add the code from java.sh into the bottom of this file.
ie export PATH=$PATH:/usr/java/j2sdk1.4.2_07/bin/

When you log in after making the change check PATH:

echo $PATH
Or try a java command.

Then look around in /home/user/.bash_profile, .bashrc , /etc/bashrc,
/etc/profile to see if your PATH variable is being reset somewhere.

Rgds
Daniel.
--
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] Problem with Apache after upgrade: how do I turn off Jakarta or gte a mod_so.info file?

2006-09-19 Thread Daniel Bush

G'day Michael,

On 19/09/06, Michael Lake [EMAIL PROTECTED] wrote:

Hi

I got my apache working via a cludge. I moved the mod_jk.so in 
/usr/lib/apache/1.3/
to one level up :-) Hence apache ain't looking for it no more.
I also did a apache-modconf apache-perl disable mod_sk
which didn't complain. apache then started OK.

Now what should I do?



Sorry can't help much.

I had to set up mod_jk and mod_jk2 on apache2 last year (the latter is
deprecated).  From your post I can't tell how much you know about it.
Basically we used it to connect to tomcat, so that on certain url's
apache would pass thru the request.
If you are also running Tomcat there in the background, you might have
broken something or someone's java project (or at least the connection
to it).

I didn't know there was any connection with perl although it looks
like you are using perl to configure apache (?) which I can't help you
with.

Can't help on the .info thing.
For mod_jk setup, I had a LoadModule directive which pointed to the
mod_jk.so file, and then several other things besides including links
to tomcat connector files:
   LoadModulejk_module
/usr/local/tomcat5.0-connector/native/apache-2.0/mod_jk.so
   # Declare the module for IfModule directive (remove this line on
Apache 2.0.x)
   #AddModule mod_jk.c

   # Where to find workers.properties
   JkWorkersFile /usr/local/tomcat5.0-connector/conf/workers.properties
   ... etc ...
(this was a non-debian apache setup)


Rgds
Daniel.
--
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] OOPS .. contd.

2005-12-15 Thread Daniel Bush
On 12/15/05, Adam Felix Bogacki [EMAIL PROTECTED] wrote:
 Do you have an /etc/rc.d/rc.sysinit file or similar?Tux:/# find -name rc.sysinit -print./opt/ltsp/i386/etc/rc.sysinitI
should mention that rc.sysinit is very redhat-ish. With a
debian-like system you are more likely to have something like
/etc/rcS.d/set up scripts. Which looks like what you've
got. So I think I might be confusing you more with regional linux
differences. I really don't know about using the ltsp rc.sysinit
you mentioned; that's a thin-client software or something - it's not
part of your system proper. 

In general it sounds like there are some fundamentals going wrong with
your system (not least file permissions, mounts and partitions) which
is good in one sense, because the fix might not be too hard and might
get everything working properly all of a sudden. 

Sorry, I can't untangle it - too many things to track.

Daniel

ps with the old kernel, if you compiled it, you might find it wherever
you built it and it might have an 'x' in its name: vmlinux* -
presumably uncompressed.
-- 
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] man pages without the colour

2005-12-03 Thread Daniel Bush
On 12/3/05, Matthew Hannigan [EMAIL PROTECTED] wrote:
On Fri, Dec 02, 2005 at 10:13:03PM +1100, Daniel Bush wrote: Thanks Ken. I forgot about directly piping it like that. But I still got the colour in less.I was stumped for a while before trying
 my famous sed mangling-script again: man xyz | sed -e 's/.^H//g' | less and lo! crisp white manpages did materialise before me! Ugly hack though.I think the standard thing to use is
col -bIt has roughly the same effect as that sed.
Yup. That's neater. Thanks.
So my current solution is to re-write man using a bash function which I've put in my .bash_profile file:
---
function man() {
 if [ -z $1 ]; then

echo No arguments provided. 2
 else
 /usr/bin/man $* | col -b | less
 fi
}
---

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

[SLUG] man pages without the colour

2005-12-02 Thread Daniel Bush
Hi Folks,Does anyone have a way of turning off the wretched colouring used by the manpage system (specifically on debian) ?It conflicts with the colour backgrounds I'm using so, ironically, all the bits it is highlighting like titles are virtually unreadable -  it's like they assume everyone uses a white terminal or something.
Colour in manpages is one bit of progress I can do without.(I'm aware of nroff and groff and /etc/manpath.config; even tried to mangle their output using sed)Thanks,Daniel
-- 
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] man pages without the colour

2005-12-02 Thread Daniel Bush
On 12/2/05, Ken Foskey [EMAIL PROTECTED] wrote:
On Fri, 2005-12-02 at 20:14 +1100, Daniel Bush wrote: (I'm aware of nroff and groff and /etc/manpath.config; even tried to mangle their output using sed)try man xyz | lessman is context aware and if it not a console (ie pipe) it possibly will
not highlight.Thanks Ken.I forgot about directly piping it like that.But I still got the colour in less. I was stumped for a while before trying my famous sed mangling-script again:
 man xyz | sed -e 's/.^H//g' | lessand lo! crisp white manpages did materialise before me!Ugly hack though.(The ^H may or may not have something to do with the -c flag for nroff)Daniel.
-- 
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] OOPS .. 2.6.14 install via Gentoo Live/SysRescue CD

2005-11-30 Thread Daniel Bush
Adam,
There's not much help I can give. But I've added some comments below. 
On 11/29/05, Adam Felix Bogacki [EMAIL PROTECTED] wrote:
I found I had a kernel problem after trying to install dependencies for'scribes' in succession when on rebootI could not get back into my 2.6.5 linux drive.An early error message was ..Error inserting genrtc
(lib/modules.2.6.5-1-686/kernel/drivers/char/genrtc.ko): Device orresource busy./etc/init.d/syslog start.. and laterKernel panic: VFS: Unable to mount root fs on unknown-block(0,0)

Are you sure there is no way you could get 2.6.5 back up and
running rather than trying to compile and boot a new kernel on an
already-broken system based on 2.6.14 as you tried below?

...
After a bit of fiddling with /etc/lilo.conf I finally manged to bootinto my own drive with the following messages
which I reproduce manually in some detail in the hope that they meansomething to someone ..---
Not running depmod because /lib/modules/2.6.14 is not writableLoading modules ..grep: error while loading shared libraries libpcre.so.3: cannot openshared object file: No such file or directoryFATAL: Could not load /lib/modules/2.6.14/modules.dep: No such file or
directoryCreating device-mapper files[screen moves .]/etc/rc5.d/S19autofs: line33: basename: command not found...
... 
Debian GNU/Linux testing/unstable Tux tty1Tux login: adamPassword:
-.. so I was in on tty1 at run-level 1I quickly found that only my Linux root and WinXP partitions were
auto-mounted - both specified in /etc/lilo.conf- and I had to manually mount all other partitions except swap (which Icould not quite work out how to do).
swapon / swapoff
You can use it on files too. (Also see mkswap - not that I think you need it here, though).

Do you have an /etc/rc.d/rc.sysinit file or similar?
You can see how the bootup shell script uses swapon and the 'mount'
command to do stuff (like mounting root dir read-only before going
read-write).
Finally,Tux: /home/adam/linux-2.6.14# make modules_installif [ -r System.map
 -a -x /sbin/depmod ] ; then /sbin/depmod -ae -FSystem.map 2.6.14; fiTux: /lib/modules# ls0.0.0 2.4.18-bf2.4 2.4.25-1-686 2.6.14 2.6.5-1-686Tux: /lib/modules/2.6.14# lsbuild modules.ccwmap modules.inputmap
 modules.seriomap sourcemodules.dep modules.isapnpmap modules.symbolskernel modules.alias modules.ieee1394map modules.pcimap modules.usbmap.As it now stands, I can boot into WinXP on which this is written and
2.6.14 at willbut the latter is text mode (init 1),I have to mount other partitionsmanually,have no access to the internet preventing a dist-upgrade, and no X-server.
If you mean runlevel 1, then is your networking script file
('network') in /etc/rc1.d (or similar) prefixed with a K or an S?
On my system it is a 'K' - which means any networking will be killed
(an 'S' means it will be started if not already on). Runlevel 1
on my system has a lot of K's and not a lot of S's. (The shell script
file that manages changes in runlevels on my system is /etc/rc/rc.d.)
You can start your rc* scripts manually using something like
  ./XXXnetwork start ( or 'restart')
(in the directory the file is in or just go to init.d). There's also often /sbin/service (in redhat at least)

Also, telinit can be used to change runlevels. (see man
page) Might be better to run that than starting up stuff in
isolation. However, it looks like all your /etc/rc* scripts are
failing to run which probably relates to your mount problem -- really,
really not sure..

/etc/fstab exists and I don't understand why it does not mount allpartitions at start-up.

This may relate to the sysinit file I was mentioning about above (or it may not).
There is a cryptic note in my sysinit file saying that contrary to
standard usage, file systems are NOT unmounted in single user
mode. Anyway, this hints to the fact that changing runlevels may
not only change the services but may possibly also change what is
mounted.

Only other things I can think of are:
 mount -a
will try to mount everything in fstab.
 mount -a -t nocomma-list of file system types 
will mount all available systems except those types that come after
'no'. You might see stuff like that in your sysinit file.


Check /etc/mtab to see what was mounted at startup and any other invocations of 'mount' that you ran after that.
Check /proc/mounts to see mounts...
I have correctly AFAIK set up /etc/init.d/network but there is nointernet connection.

Dumb question: you did start it? (as per a previous comment above). 
Are your interfaces up? (ifconfig)
I feel I've achieved something but have not yet arrived at a working system.
You really sure you can't resurrect your old system?

Daniel
-- 
SLUG - Sydney Linux User's Group Mailing List - 

Re: [SLUG] Help Me - C codes

2005-11-27 Thread Daniel Bush
On 11/27/05, Beav Petrie [EMAIL PROTECTED] wrote:
Sluggers,

I run these codes I copied from a tutorial book.
The print out is 24, correct factorial of 4 (4*3*2*1).

But y is 0 (y  1) finally and return value of 1 so how is it
24 instead of 1 is printed ? 

Please help me understand. Many thanks.

Do not flame me, please. I am a newbie.

Beav



Hi Beav,

Factorial is a recursive function.

So, what happens when you say 

 factorial(4) (in main) ?



Your factorial function returns y*factorial(y-1), so you get:

 factorial(4) = 4 * factorial(3).



Now you have to solve factorial(3), which also uses y*factorial(y-1), so:

 factorial(3) = 3 * factorial(2)



So substitute this back into the previous _expression_:

 factorial(4) = 4 * ( 3 * factorial(2) )

Keep solving factorail for y = 2,1...



Eventually you get

 factorial(4) = 4 * ( 3 * ( 2 * 1 * factorial(0) ) ) 

and as you said,

 factorial(0) returns 1 (as it should mathematically ie 0! )

Hope that helps.

Daniel
-- 
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] Help Me - C codes

2005-11-27 Thread Daniel Bush
On 11/28/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:







I thought by definition y! = y * (y-1) * (y-2) * 
... * 1

so the function should be:

int 
factorial(int 
y){ if 
( y 
=1){ 
return 1; 
} 
else 
{ 
return (y * factorial(y - 
1)); 
}}


yiz


I think you mean y==1 not y=1. I love getting that wrong.
I've had hours of fun with that type of error (in _javascript_).
IIRC, 0! = 1. There's a reason for it somewhere. This is satsified by the original function definition.
I think you might get infinite recursion if you try factorial(0) for a version using y==1.
-- 
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] C Gurus

2005-11-22 Thread Daniel Bush
On 11/22/05, Crossfire [EMAIL PROTECTED] wrote:
[snip] U ...  Coding 3. #include stdio.h #include stdlib.h #include string.h
 char * somefunction() { char *string2 = some words; return string2; } int main (void)
 { char *string; string = somefunction(); printf (\n\nString is: %s\n\n, string); return 0;
 } O Plameras was once rumoured to have said: After somefunction() returns, it has the address of the first character in some words. I assign that address to string. I print the contents of that address up
 to character '\0'. This is done by printf. This is a fundamental concept you're missing.No, you're missing it.Here's a slightly nastier example[1] whichdemonstrates why what you're doing is wrong and should not be done.
---BEGIN---#include stdio.h#include stdlib.h#include string.hchar *somefunction(){auto char string2[] = some words;return string2;
}voidanotherfunction(){auto inti,r[50];/* build a 'random' sequence on the stack to prove the point. */for (i = 0; i  50; i++) {r[i] = (i*13)%256;
}}int main (void){char *string;string = somefunction();anotherfunction();printf (\n\nString is: %s\n\n, string);return 0;
}---END---string still contains a pointer to the start of the string somewords, right?Now, before chickening out and running it, predict the outcome.This is why you don't return pointers from stuff defined in local
subroutine scope.C.[1] I expect Benno and Erik to immediately spot the subtle difference. ;)--SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Wow, I remember when this thread had just 3 messages.
Anyway, just trying to clarify from the above code:
string2 is a pointer to an automatic variable - a character
array? Very bad to pass this address back to main().
But if you had said
 char * string2 = some words
or even
 auto char * string2 = some words
it will work (at least as I've just tested with gcc) because you've
initialised a pointer to a string literal, which pretty much is set in
stone for the life of the program. (Nor can you alter its contents)
So:
 1) char string2[] = string literal; 
 - string2 is created
with separate location (an address on the stack in the above code) to
string literal and string literal is copied into it.
 2) char *string2 = string literal; 
 - string2 holds an address of string literal which is not on the stack

Daniel.

-- 
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] python/irc ?

2005-11-07 Thread Daniel Bush
On 11/8/05, Mark Johnathan Greenaway [EMAIL PROTECTED] wrote:
On Tue, Nov 08, 2005 at 04:55:52PM +1100, David wrote: I'm trying to learn Python, and running into some really simple problems. Is there a newbie oriented #python on irc somewhere? or something similar?
 Google was unhelpful :(Yes, there's a #python channel on irc.freenode.net. There's a goodcollection of introductory material at
http://www.python.org/doc/Intros.html--Mark--SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/Subscription info and FAQs: 
http://slug.org.au/faq/mailinglists.html

I know irc was the topic but in terms of general resources
diveintopython.org also looks very good for beginners and up.
(http://diveintopython.org/toc/index.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] postgresql-dump catch-22 ?

2005-05-21 Thread Daniel Bush
Hi Adam,
I remember having trouble going from postgres 7.2 to postgres 7.3 when i
upgraded distros.
I was using redhat at the time.
I think, I uninstalled the new version (7.3) - which was failing to
start because of the older format databases I was using - and
reinstalled the old version (7.2).
Running as 7.2, I then dumped the databases I had been using:
pg_dump -U user_name database_name dump_file
I must have taken a backup of the raw files too as insurance and then
deleted them and installed 7.3 as a completely clean install.
Then after the new postmaster was up and running, I reinstalled the
databases with something like
psql -U user_name database_name dump_file
(You have to create the database first using 'createdb' at the shell or
CREATE DATABASE as the sql prompt.)

I don't know if that's the way it's meant to be done but I got there in
the end.

Cheers,
Daniel.

On Sat, 2005-05-21 at 19:29, Adam Bogacki wrote:
 Hmm .. I seem to have reached a catch-22.
 
 I had 7.2 installed, apt-upgraded to 7.8.4
 I tried to apt-remove and then reinstall postgres, which may have just
 removed parts of 7.2
 When I try to run 'postgresql-dump', it fails telling me it cannot start
 the postmaster.
 
  Tux:~# su -s /bin/bash - postgres
  [EMAIL PROTECTED]:~$ postgresql-dump -t db.out -dcivlp $PGDATA/../data.save
  Stopping and restarting the postmaster
  /var/lib/postgres/dumpall/7.2/postmaster -D /var/lib/postgres/data  -p
  5431 -o - d0
  /var/lib/postgres/dumpall/7.2/postmaster: error while loading shared
  libraries: libssl.so.0.9.6: cannot open shared object file: No such
  file or directory
  Failed to start the postmaster
  [EMAIL PROTECTED]:~$ nohup postmaster logfile 21 /dev/null 
  [1] 9291
  [EMAIL PROTECTED]:~$  postgresql-dump -t db.out -dcivlp $PGDATA/../data.save
  Stopping and restarting the postmaster
  /var/lib/postgres/dumpall/7.2/postmaster -D /var/lib/postgres/data  -p
  5431 -o - d0
  /var/lib/postgres/dumpall/7.2/postmaster: error while loading shared
  libraries: libssl.so.0.9.6: cannot open shared object file: No such
  file or directory
  Failed to start the postmaster
  [1]+  Exit 1  nohup postmaster logfile 21 /dev/null
  [EMAIL PROTECTED]:~$ ps ax | grep postmaster
   9428 pts/4S+ 0:00 grep postmaster
  [EMAIL PROTECTED]:~$ ps -ef | grep postmaster
  postgres  9430  9135  0 20:09 pts/400:00:00 grep postmaster
 
 But when I try to start the postmaster
 
  Tux:~# /etc/init.d/postgresql restart
  Stopping PostgreSQL database server: postmasterpg_ctl: could not find
  /var/lib/p ostgres/data/postmaster.pid
  Is postmaster running?
  .
  Starting PostgreSQL database server: postmaster(FAILED)
  ERROR: The database is in an older format that cannot be read by
  version 7.4 of PostgreSQL.
 
  Run postgresql-dump to dump the old database and to reload
  it in the new format.
  *** READ /usr/share/doc/postgresql/README.Debian.migration.gz FIRST! ***
 
  The version 7.4 postmaster cannot be started until
  this is done.
 
 .. it tells me to run postgresql-dump.
 
 I confess to being a postgres newbie, but there has to be a way around.
 
 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


Re: [SLUG] I wish to lowercase a character in a sed script

2005-03-13 Thread Daniel Bush
Michael Lake wrote:
Hi all
I have a titles.html file from someone that has several hundred 
authors listed in a table. e.g. trtd class=col1a 
href=111_12.htmlAgrawal, B.M. and Kumar, Virendra/a/td

At present the above link goes to the top of that file (the contents 
of that journal issue) but I want the link to directly go to the 
authors article in that directory. There are already name anchors in 
the file but they are lower case such as: a name=agrawal/a

The script below will take extract the authors name from after the 
link so that a href=111_12.htmlAgrawal, B.M becomes
a href=111_12.html#AgrawalAgrawal, B.M

but the name anchors in the many journal files are all lower case like 
this:
a name=agrawal/a

thus my links don't work.
#!/bin/bash
# trtd class=col1a href=111_12.htmlAgrawal, B.M. and Kumar, 
Virendra/a/td
# trtd class=col1a href=111_12.html#AgrawalAgrawal, B.M. and 
Kumar, Virendra/a/td
cat titles.html | sed 's/col1a 
href=\(.*\)\.html\([A-Z][a-z]*\),/col1a href=\1.html#\2\2,/' 
 test.html

How can I lower case the anchors i.e. #Agrawal to #agrawal? I know 
that tr can do that but the above is in a sed script adn I can't use 
tr there.
sed does not have a lower function.
Maybe I have to do in two passes somehow?

Ouch.  Do you have to use sed?
If you have perl installed, you could replace
   sed '...'
with
   perl -ne '...'
and you could probably solve the problem with something like:
   cat titles.html | perl -ne 'm/\.html([^,]{1,}),/; $name=lc($1); $_ 
=~ s/\.html/\.html#$name/; print $_;'
That may be clumsy by perl standards, but I think it works at least if 
you have one instance per line in the html file.

--
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] How do I mount an audio Cd ?

2005-03-12 Thread Daniel Bush
Rod Butcher wrote:
I have some audio cds I need to edit. How can I mount them so I can open
the audio track in an audio editor, or at least copy the track to .wav ?
I get
/dev/cdrom: Input/output error
mount: /dev/cdrom: can't read superblock
if I try to mount it
On windows I used to be able to see the audio tracks as files in the
file browser.
thanks
Rod
---
Brought to you by a penguin, a gnu and a camel
 

On my redhat9 -based system I have cdparanoia already installed.
To rip track 2, you do something like:
   cdparanoia 2-2 output.wav
More options listed on the manpage.
--
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: Insert text at the beginning of a file

2004-12-15 Thread Daniel Bush
Dan Treacy wrote:
[EMAIL PROTECTED] wrote:
Ouch
a problem begging for perl as a solution!
James

Probably, but seeing as though my shell skills are half a step above 
totally crap and my perl skills are 4 steps below shell it is :-)

And thanks everyone for your suggestions I haven't had a chance to 
test any of them out. maybe tonight.

Dan.
If you're talking about inserting text at the beginning of a file, than 
perl has a tidy way of doing it all for you:

$ perl -pi -e s/^/foobar\n/ if ($.==1); test.file
That's pretty easy!
See the 'perlrun' manpage.
Doesn't seem to work if test.file is empty ie 0 lines.
Nice variation where you can say '-i.orig' and you will have the 
original stored with a '.orig' extension, or whatever you want.
--
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] iptables (debian)

2003-12-21 Thread Daniel Bush
Hi Rene,
That's bang on the money!
And for a bonus, you've told me how to get a separate firewall log file without
having to do too much extra work.  
You've seriously made my day. Thanks.

My thanks also goes to Andrew and Julian for helpful extras in earlier posts.
Cheers, 
Daniel.

On 18:37 21-12-2003, Rene Cunningham wrote:
 On Sun, Dec 21, 2003 at 02:26:40PM +1100, Daniel Bush wrote:
  example (iptables 'seems' to print this both to tty and
  /var/log/messages... )
  -
IN=ppp0 OUT= MAC= SRC=63.154.36.125 DST=203.206.0.244 LEN=48
  TOS=0x00 PREC=0x00 TTL=110 ID=12283 DF PROTO=TCP SPT=3830 DPT=135
  WINDOW=8760 RES=0x00 SYN URGP=0
IN=ppp0 OUT= MAC= SRC=63.154.36.125 DST=203.206.0.244 LEN=48
  TOS=0x00 PREC=0x00 TTL=110 ID=12305 DF PROTO=TCP SPT=3830 DPT=135
  WINDOW=8760 RES=0x00 SYN URGP=0
  -
 
 You need to configure klogd to display messages with loglevels lower
 than what your logging with iptables. Any sane firewall shouldnt be
 logging these messages lower than KERN_WARNING (4).
 
 To configure klogd the debian (sid) way edit /etc/init.d/klogd and instead of
 KLOGD= use KLOGD=-c 3.
 
 Nifty trick is to log iptables stuff with --log-level debug, then throw
 all kern.=debug into a file via syslog. That way you have a nice
 firewall log that sits in a file. Dont forget to logrotate.
 
 -- 
 
 Rene Cunningham
 DCLabs Pty Ltd
 http://www.dclabs.com.au
 
 We are governed not by armies and police but by ideas.
   -- Mona Caird, 1892
 -- 
 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


[SLUG] iptables (debian)

2003-12-20 Thread Daniel Bush
Hi,
Just recently tried out debian on one of my old machines in place of a
redhat system I had been using for the past year.  But I am having
trouble with an iptables firewall script which keeps insisting on
spraying stuff to my terminal (tty1,2,3...) even though its being
syslogged into /var/log/messages with syslog priority of 'info' using a
LOG target.  
It doesn't just print to any tty; it assiduously finds the one I'm
currently on and prints to that (ie the one currently on-screen
locally).  It doesn't seem to happen when I log in remotely but still,
this is starting to get me down.

example (iptables 'seems' to print this both to tty and
/var/log/messages... )
-
  IN=ppp0 OUT= MAC= SRC=63.154.36.125 DST=203.206.0.244 LEN=48
TOS=0x00 PREC=0x00 TTL=110 ID=12283 DF PROTO=TCP SPT=3830 DPT=135
WINDOW=8760 RES=0x00 SYN URGP=0
  IN=ppp0 OUT= MAC= SRC=63.154.36.125 DST=203.206.0.244 LEN=48
TOS=0x00 PREC=0x00 TTL=110 ID=12305 DF PROTO=TCP SPT=3830 DPT=135
WINDOW=8760 RES=0x00 SYN URGP=0
-

(I compiled and installed a 2.4.13 kernel over the 'vanilla' 2.2.20 and
am wondering if the LOG facility of iptables and syslogd are the
problem.  Have also disabled any '(x)console/tty' items from /etc/syslog.conf )

It can't be a big thing.  Can anyone help?
Thanks, 
Daniel.

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