linux:

links:

gfs2:
http://www.linuxdynasty.org/howto-setup-a-quorum-disk.html - HowTo setup a Quorum Disk
http://www.linuxdynasty.org/howto-setup-gfs2-with-clustering.html - How to set up GFS2 with clustering

http://linux.die.net/ - handy linux references, man pages online etc
http://www.dest-unreach.org/socat/ - socat like netcat but does unix sockets too :-)



my random linux thoughts / scripts / crap (this is mainly a place for me to store my own rubbish):


listen to bbc radio without that iPlayer contraption... aka another rjf bodge script...

my bbc iPlayer 'replacement' (ha ha) for bbc radio 1..6 :-P (requires mplayer)... simple command line bbc radio player for linux. just wraps around mplayer which does a decent job at playing real streams without the bloat :-)

***UPDATE*** BBC have changed the way the iPlayer links work now. The above script won't work anymore. Simply use the following commands for each station:

Radio 1
mplayer -playlist 'http://www.bbc.co.uk/radio1/realaudio/media/r1live.ram'
Radio 2
mplayer -playlist 'http://www.bbc.co.uk/radio2/realmedia/fmg2.ram'
Radio 3
mplayer -playlist 'http://www.bbc.co.uk/radio3/ram/r3g2.ram'
Radio 4
mplayer -playlist 'http://www.bbc.co.uk/radio4/realplayer/media/fmg2.ram'
Five Live
mplayer -playlist 'http://www.bbc.co.uk/fivelive/live/surestream.ram'
6 Music
mplayer -playlist 'http://www.bbc.co.uk/6music/ram/dsatg2.ram'
Radio 7
mplayer -playlist 'http://www.bbc.co.uk/bbc7/realplayer/dsatg2.ram'

or use the modified script <<<HERE>>>

Or save yourself £70 - £100 and odd on a "DAB" radio. DAB radio is crap and not fit for purpose. The sound quality is terrible because it's Mpeg Layer 2 often at 128kbps - basically, it's based on a specification more than 15 years old! Instead, use your el' cheapo MP3 player and download the BBC Radio programs you want to listen to on the go from either the live stream or "listen again" using mplayer...

Simply :

strace -o /var/tmp/bbc -f -s4096 -p `pidof firefox`

(replace fiirefox with your browser of choice)

Click the streams you want to record, let it play for only a second or two and close the window.

CTRL-C the strace process.

perl -ne 'if (http.*(http.*Bridge_uk.*\.ram)) { print $1."\n";}' /var/tmp/bbc | sort | uniq

This'll give you the RealPlayer playlists you need...

Then simply save to the file name of your choice (as WAV) example:

mplayer -quiet -cache 32 -vc dummy -vo null -ao pcm:file=JonathanRoss21stNov.wav -playlist "http://www.bbc.co.uk/iplayer/aod/playlists/qp/2z/n0/0b/RadioBridge_uk_1000_bbc_radio_two.ram"

Once this is done (and you can run as many of these as you like simultaniously) convert the WAV file to the compressed format of choice. For radio I'd normally go for .5 to 1 quality vorbis ogg:

oggenc -q 1 -o
JonathanRoss21stNov.ogg JonathanRoss21stNov.wav

Then rm the original WAV file.

Simple. Listening in the car is much better now as no signal loss, no expensive receiver required etc etc. Stock up on the shows you like and leave out the dross.


simple recursive mp3 to ogg encoder perl script

i got fed up with clunky massive gui crap to do this kind of thing (all the converters I have tried fell over when given a massive collection of mp3's) so I have cobbled together some proper filth in perl in a few minutes to do on the fly mp3 convertion - handy for transfering from my existing collection of mp3's to a portable player with not a lot of memory. It's not going to win any beauty contests and it requires mpg321 and oggenc to be installed and in the right places. It does sod all regarding tags because I didn't require it but I might add something if I can be bothered.




ALSA Loop back in Linux...

After wanting to capture audio from various application in Linux I recently found my Debian Lenny EEE 701 to be without the snd-aloop.ko required for alsa loop back.

So as a quick how-to....


Make sure the debian module assistant's installed. If not...

aptitude install module-assistant

m-a prepare

m-a update


see a soted list of modules...

m-a -t list | grep -E '^[^ ].*\(' | cut -d " " -f 1 | sort

alsa-source is what we're after...

m-a a-i alsa-source


let it finish.
arecord -D hw:1,1  -f cd noise.wav
once done

modprobe snd-aloop

and we're done with that...

Then to capture said app, it's easy to just set the default sound device to be the new loop back...

create .asoundrc in your home directory

it should contain something like this...

pcm.!default {
    type hw
    card 1
    device 0
}

we might need to restart alsa, I can't remember but since we've loaded new modules it can't hurt.

Then simply start the application up. Get it ready for making gwhat ever noise you're after capturing then simply do something like....

arecord -D hw:1,1  -f cd noise.wav

Start the app noise.

Ctr-C arecord when done.

Winner.

Handy commands for playback when default alsa card is set to hw:1,1(loopback)...

mplayer -ao alsa:noblock:device=hw=0.0 file.wav

or

aplay -D hw=0,0 -f cd file.wav

etc...


HOME