Re: [Dorset] Next Bournemouth meet?

2010-11-27 Thread Natalie Hooper
I would not presume to make a decision for the group, particularly as I'm
fairly new to the group. However, I can make a suggestion of course ;-)

For me, the Broadway is by far the best venue as it's got the most frequent
evening bus service (No 3) and I also happen to live on route No 3 so that
is obviously extremely convenient for me and is therefore my preference.

As for the days, according to the answer given to Victor by the landlord, I
would suggest a Tuesday night then. This leaves us with 7th and 14th as 21st
is too near Xmas and I'm sure a lot of us are already booked then for
various Xmas parties and so on. Personally, I think I can do both, though
14th would be preferred as I've got to get up very early on the 8th so I'd
rather an early night in on the 7th.

So my suggestion would be Tuesday 14th December at the Broadway. What does
everyone think about that?



On 26 November 2010 20:57, Peter Merchant madsmad...@netscape.net wrote:

 On Wed, 2010-11-24 at 07:54 +, Natalie Hooper wrote:
  Has a date been decided for the next Bournemouth meet? Is the plan still
 to
  meet at The Broadway on a non-karaoke night?
 
 

 You asked the question, and a few suggestions have been made. Please
 take an executive decision and tell us where to meet, then Terry can
 post it.


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] network problems

2010-11-27 Thread Ralph Corderoy

Hi StarLion,

  tcp6   0   0 linux:ipp         [::]:*         LISTEN 1132/cupsd
  So my big question is what are all these connections that are
  established?
 
 mysqld is, as the process name suggest, the mysql database daemon
 running.  ...

I think you missed the Which I would expect bit.  :-)

Cheers,
Ralph.


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue

Re: [Dorset] dorset Digest, Vol 360, Issue 7

2010-11-27 Thread Brian R Masterman

Thanks Ralph,

http://en.wikipedia.org/wiki/Unix_domain_socket

That all makes sense now.

I was unnecessarily concerned.

Brian M.

--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


[Dorset] Sorting MP3s back into folders

2010-11-27 Thread Terry Coles
Hi,

I have around 600-700 audio tracks that I originally ripped from CDs into .ogg 
format for playing in Amarok.  All of these are organised in folders 
categorised by Artist and then Album.  Subsequent to this, I bought a plug-in 
car MP3 player, which didn't deal with .ogg and also couldn't handle folders, 
so I ripped everything again into MP3 format in a single directory.  I also 
spent quite a long time normalising all the audio because the (cheap) plug-in 
MP3 player couldn't cope with loud and high pitched notes at the same time.

I now have a new car with built in MP3 player :-)  It seems to play the MP3s 
fine, but it also seems to be expecting a hierarchical file structure, because 
when I hit the 'Title' button it spends quite while looking for folder names 
(which aren't there of course).  What I would therefore like to do is to sort 
all the files back into a folder structure again.

Does anyone know of a tool that can do this?  I know it can be done with a 
bash script, but I'm not sure of the best way to do it.  I've found a few 
things out:
*  The tool id3tool can identify the key elements in the ID3 tag and 
presumably by looping through all the files in the directory I could write 
them into folder names.
*  I found reference to another tool, which is apparently better, called 
id3info, but that isn't in the Ubuntu repositories.
* I found reference to another tool that claims to do the whole thing.  It is 
called Sort MP3 and is a perl script, but the link is dead.

So.  Is a bash script the best approach, or is there a better way?  The 
filenames are descriptive, but not consistent, so they don't really help.

-- 
Terry Coles
64 bit computing with Kubuntu Linux


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread John Carlyle-Clarke

On 27/11/10 13:41, Terry Coles wrote:

Hi,

I have around 600-700 audio tracks that I originally ripped from CDs into .ogg
format for playing in Amarok.  All of these are organised in folders
categorised by Artist and then Album.  Subsequent to this, I bought a plug-in
car MP3 player, which didn't deal with .ogg and also couldn't handle folders,
so I ripped everything again into MP3 format in a single directory.  I also
spent quite a long time normalising all the audio because the (cheap) plug-in
MP3 player couldn't cope with loud and high pitched notes at the same time.

I now have a new car with built in MP3 player :-)  It seems to play the MP3s
fine, but it also seems to be expecting a hierarchical file structure, because
when I hit the 'Title' button it spends quite while looking for folder names
(which aren't there of course).  What I would therefore like to do is to sort
all the files back into a folder structure again.

Does anyone know of a tool that can do this?  I know it can be done with a
bash script, but I'm not sure of the best way to do it.  I've found a few
things out:
*  The tool id3tool can identify the key elements in the ID3 tag and
presumably by looping through all the files in the directory I could write
them into folder names.
*  I found reference to another tool, which is apparently better, called
id3info, but that isn't in the Ubuntu repositories.
* I found reference to another tool that claims to do the whole thing.  It is
called Sort MP3 and is a perl script, but the link is dead.

So.  Is a bash script the best approach, or is there a better way?  The
filenames are descriptive, but not consistent, so they don't really help.



Terry, doesn't Amarok have an option to sort everything into directories 
by tag for you?  It used to...



--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread Terry Coles
On Saturday 27 Nov 2010, John Carlyle-Clarke wrote:
 On 27/11/10 13:41, Terry Coles wrote:
  So.  Is a bash script the best approach, or is there a better way?  The
  filenames are descriptive, but not consistent, so they don't really help.
 
 Terry, doesn't Amarok have an option to sort everything into directories
 by tag for you?  It used to...

If there is, I can't see it.  Amarok is very good at sorting tracks into 
categories and displaying everything there is to know about them, but I can't 
see anything that would provide an output function to create a hierarchical 
file structure from track data in a single source directory.

-- 
Terry Coles
64 bit computing with Kubuntu Linux


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread Sean Gibbins
On 27/11/10 13:41, Terry Coles wrote:
 Does anyone know of a tool that can do this?

Hi Terry,

An alternative approach to yours might have been:

- Copy the music directory to an alternative location (i.e. 'cp ~/Music
~/Music_copy')
- Point Sound Converter (or Sound Konverter for KDE types) at the new
root music directory (i.e. ~/Music_copy)
- Convert all the files from ogg to mp3 (the default is I believe to
place them in the same directory as they were found in, but opt for this
if not), ensuring that you have checked the 'delete original' option

Sean

-- 
music, film, comics, books, rants and drivel:

www.funkygibbins.me.uk


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders [correction]

2010-11-27 Thread Sean Gibbins
On 27/11/10 14:15, Sean Gibbins wrote:
 On 27/11/10 13:41, Terry Coles wrote:
 Does anyone know of a tool that can do this?
 Hi Terry,

 An alternative approach to yours might have been:

 - Copy the music directory to an alternative location (i.e. 'cp ~/Music
 ~/Music_copy')

Sorry, that will need to be 'cp -aR ~/Music ~/Music_copy'

Sean

-- 
music, film, comics, books, rants and drivel:

www.funkygibbins.me.uk


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders [correction]

2010-11-27 Thread Ralph Corderoy

Hi Sean,

 Sorry, that will need to be 'cp -aR ~/Music ~/Music_copy'

-a includes -R so just -a would do.  ;-)

Cheers,
Ralph.


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread Terry Coles
On Saturday 27 Nov 2010, Sean Gibbins wrote:
 On 27/11/10 13:41, Terry Coles wrote:
  Does anyone know of a tool that can do this?
 
 Hi Terry,
 
 An alternative approach to yours might have been:
 
 - Copy the music directory to an alternative location (i.e. 'cp ~/Music
 ~/Music_copy')
 - Point Sound Converter (or Sound Konverter for KDE types) at the new
 root music directory (i.e. ~/Music_copy)
 - Convert all the files from ogg to mp3 (the default is I believe to
 place them in the same directory as they were found in, but opt for this
 if not), ensuring that you have checked the 'delete original' option

ATM, I'm trying to find a way that doesn't involve ripping the files afresh or 
converting from the .oggs.  It may be a bit OTT, but I went to a lot of 
trouble to rip the MP3s from the original sources and then normalise them.  If 
I convert from .ogg, there will probably be a slight conversion loss and if I 
rip again, I may find it necessary to normalise them again.  Amarok does this 
'on the fly' so to speak, but if my car doesn't, then some tracks will be 
ridiculously loud and some too soft for use in a car, even if the decoder can 
cope with loud and high pitched passages.

-- 
Terry Coles
64 bit computing with Kubuntu Linux


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread Terry Coles
On Saturday 27 Nov 2010, Terry Coles wrote:
 On Saturday 27 Nov 2010, Sean Gibbins wrote:
  On 27/11/10 13:41, Terry Coles wrote:
   Does anyone know of a tool that can do this?

OK.  I've started trying to put together a script that will sort my tracks.  
I've found two useful scripts on the web; one to create a list of filenames in 
a directory and one to parse out the ID3 tags.  I've started with the list of 
filenames, but I have a problem.

All of the existing files have been autogenerated by various tools and have 
filenames like:

12 - Largo, from _the New World_.mp3

When I just put one of these files into a Test directory and run the filename 
script:

#!/bin/bash
directorytols=$1
for filename in $( ls $directorytols)
do
 if [ -d $filename ] ; then
  echo Directory: $filename
 elif [ -h $filename ] ; then
  echo Symlink: $filename
 else
  echo File: $filename
 fi
done

I get:

te...@beige:~/Scratch/Test$ ./ListDirectory MP3s
File: 12
File: -
File: Largo,
File: from
File: _the
File: New
File: World_.mp3

Clearly, this script is stumbling over the spaces in the filenames.

Normally, I never put spaces in filenames, precisely to prevent problems like 
this, but I didn't generate this filename (and I have over 600 files like 
this).  Any thoughts on how to fix this?

-- 
Terry Coles
64 bit computing with Kubuntu Linux


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread Sean Gibbins
On 27/11/10 17:14, Terry Coles wrote:

---8---

 OK.  I've started trying to put together a script that will sort my tracks.  
 I've found two useful scripts on the web; one to create a list of filenames 
 in 
 a directory and one to parse out the ID3 tags.  I've started with the list of 
 filenames, but I have a problem.

 All of the existing files have been autogenerated by various tools and have 
 filenames like:

   12 - Largo, from _the New World_.mp3

 When I just put one of these files into a Test directory and run the filename 
 script:

 #!/bin/bash
 directorytols=$1
 for filename in $( ls $directorytols)
 do
  if [ -d $filename ] ; then
   echo Directory: $filename
  elif [ -h $filename ] ; then
   echo Symlink: $filename
  else
   echo File: $filename
  fi
 done

 I get:

 te...@beige:~/Scratch/Test$ ./ListDirectory MP3s
 File: 12
 File: -
 File: Largo,
 File: from
 File: _the
 File: New
 File: World_.mp3

 Clearly, this script is stumbling over the spaces in the filenames.

 Normally, I never put spaces in filenames, precisely to prevent problems like 
 this, but I didn't generate this filename (and I have over 600 files like 
 this).  Any thoughts on how to fix this?


Sorry to be lazy and just dump the text on you, but hopefully you can
adapt it:

#!/bin/bash

O=$IFS
IFS=$(echo -en \n\b)
for each in `ls -1 *.wav`
do
sox --norm $each -r 44100 -b 16 resampled_$each
done
IFS=$O

Right, off to cook the tea, so HTH!

Sean

-- 
music, film, comics, books, rants and drivel:

www.funkygibbins.me.uk


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread Terry Coles
On Saturday 27 Nov 2010, Sean Gibbins wrote:
 Sorry to be lazy and just dump the text on you, but hopefully you can
 adapt it:
 
 #!/bin/bash
 
 O=$IFS
 IFS=$(echo -en \n\b)
 for each in `ls -1 *.wav`
 do
 sox --norm $each -r 44100 -b 16 resampled_$each
 done
 IFS=$O

Thanks.  I've got the list of filenames out.  Onward and upward!

 Right, off to cook the tea, so HTH!

I only have to eat mine :-)

-- 
Terry Coles
64 bit computing with Kubuntu Linux


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Next Bournemouth meet?

2010-11-27 Thread Victor Churchill
On 27 November 2010 08:55, Natalie Hooper nataliehoo...@virginmedia.comwrote:


 So my suggestion would be Tuesday 14th December at the Broadway. What does
 everyone think about that?


+1. Actually I am equally happy with the preceding date if people prefer. It
helps that I can walk home from there ;-)


-- 
best regards,

Victor Churchill,
Bournemouth
--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread John Carlyle-Clarke

On 27/11/10 14:03, Terry Coles wrote:

On Saturday 27 Nov 2010, John Carlyle-Clarke wrote:

On 27/11/10 13:41, Terry Coles wrote:

So.  Is a bash script the best approach, or is there a better way?  The
filenames are descriptive, but not consistent, so they don't really help.


Terry, doesn't Amarok have an option to sort everything into directories
by tag for you?  It used to...


If there is, I can't see it.  Amarok is very good at sorting tracks into
categories and displaying everything there is to know about them, but I can't
see anything that would provide an output function to create a hierarchical
file structure from track data in a single source directory.



I definitely recall it in the older version .. the 2.x series perhaps? 
This gives some clues:-


http://ubuntuforums.org/archive/index.php/t-762270.html

Of course, the feature may have been dropped from the KDE4 version.

--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread Sean Gibbins
On 27/11/10 20:43, Ralph Corderoy wrote:
 That's enough wandering toff optic.  :-)

Not at all Ralph - I was basically repeating something I had stumbled
across that did the trick, and had no idea how it worked, so all this is
very interesting - thanks for taking the time to post it!

Sean

-- 
music, film, comics, books, rants and drivel:

www.funkygibbins.me.uk


--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] Sorting MP3s back into folders

2010-11-27 Thread John Carlyle-Clarke

On 27/11/10 20:43, Ralph Corderoy wrote:


Hi Terry,


#!/bin/bash
directorytols=$1
 for filename in $( ls $directorytols)
 do
  if [ -d $filename ] ; then
   echo Directory: $filename
  elif [ -h $filename ] ; then
   echo Symlink: $filename
  else
   echo File: $filename
  fi
 done


The problem here is that the output of ls is then parsed by the shell
and that, by default, splits on spaces amongst other things, hence Sean
re-defining IFS (Input Field Separator).

The shell can glob itself avoiding the need for ls if the directory is
changed first, e.g. by using *.

 #! /bin/bash

 cd ${1?}
 for f in *; do
 if [[ -h $f ]]; then
 echo symlink: $f
 elif [[ -d $f ]]; then
 echo dir: $f
 elif [[ -f $f ]]; then
 echo file: $f
 else
 echo unknown: $f
 fi
 done

There's a few other changes.  I've swapped the order of the -d and -h
tests because -d will succeed if its argument is a symbolic link that
links to a directory.  As it was the code only spotted symlinks to
non-directories.

And by using [[]] instead of [], both bash built-ins, the parsing of
words within them is different meaning I don't need to quote $f inside
the [[]] even if it contains spaces, linefeeds, etc.  I still need to
quote $f with double-quotes, allowing the variable expansion but
avoiding separation on any whitespace the value may contain, when I want
to pass it as a single word to another command, e.g. echo or mv.

Once upon a time there was just test(1), an external program that sh
would call.  It had -f to test for a file, etc.  The sh knew nothing of
these tests and just checked the exit value of the test command like any
other.  There's a certain elegance in that.  Then some bright spark had
the idea of hard linking the test executable as a file called '[' so
instead of writing

 if test -f $f; then

you could use brackets;

 if [ -f $f ]; then

(The code changed to want a close bracket.)  I'm not so sure it was an
improvement.  :-)

Later, as machines got bigger some shells decided to implement test's
functionality themselves, to save the fork/exec overhead per invocation
but they had to keep the parsing of test/['s arguments identical to when
it wasn't a built-in, else the differing behaviour would cause problems.
This meant you still had to quote variables, e.g. test -f $f.

So when later shells came along, e.g. Korn shell, it introduced [[]] and
deliberately didn't parse its arguments in the same way, removing the
need to quote the variable in the above case.

That's enough wandering toff optic.  :-)



I agree  with Sean, it's an interesting digression :)

http://mywiki.wooledge.org/BashGuide/TestsAndConditionals has some good 
stuff on the differences between the test types.


Also http://mywiki.wooledge.org/BashFAQ/031

I think it would be a good rule of thumb to say you probably want to use 
[[ ]] for most tests, unless you're doing arithmetic in which case (( )) 
is the one.  The main reason to use [ ] is portability/backwards 
compatibility.


It's also probably a good rule of thumb to say that when using a 
variable in a script that contains a file name, you should quote it 
unless there's a very good reason not to.


e.g. mv $filename $destination

I really suggest reading this document: it's excellent.

http://mywiki.wooledge.org/BashPitfalls

It covers most of the issues already discussed and many more.



--
Next meeting:  Somewhere quiet, Bournemouth, ???day 2010-12-?? 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue