Category > linux
Linus Ownz J00
Ahh, the sweet smell of Home.
Ahh, the sweet smell of Home.I screwed up Aquarionics. It's taking me days to get this new design uploaded, and in the meantime, Aquarionics is dead.
But I have had an entertaining day installing Linux Mandrake on my computer, only to remember that my modem is a Winmodem, and therefore not supported. Darn. Time for a new Modem.
Clever Spam.
I get quite a bit of spam. Spamassassin catches about 40 pieces per day. I look at most of it, mostly to see what types I'm getting most today. Yesterdays totals were:
- Misc: 21
- Leads, 100 Time Dated..FREE! (Cheap pencil refils with best-before dates)
- Colon Cleanse (Cheap, Clean punctuation)
- Viri: 4
- Search Engines: 2
- 419: 1
- Unrenderable Subject Lines: 14
- False Positives: 1
- Porn: 4
- TIGHT VIRGIN TEENS ON CAM (Young employees of Richard Branson go punting)
- free amateur xxx (Cheap remake of Vin Diesel movie)
- Safe sex with a bored housewife (Be still my beating heart)
But my favourite one is this one:
You're probably thinking to yourself, "Oh geez, not another
miracle diet pill!" Like you, I was +skeptical at first, but
my sister swore it helped her lose 23 pounds in just four weeks,
so I told her I'd give it a shot. I mean, there was nothing
Because the code - which Mutt displayed, not being a HTML Mail reader - was like this:
You're proba<!--PPSOjQ-->bly thinking to yourself, "Oh geez, not another<BR> mira<!--PPSOjQ-->cle die<!--PPSOjQ-->t pill!" Like you, I was +ske<!--PPSOjQ-->ptical at first, but <BR> my sister swore it helped her lose 23 pounds in just four weeks, <BR> so I told her I'd give it a shot. I mean, there was nothing <BR>
Meaning that Spamassassin failed to catch it because it contained the words "miracle diet pill", and was resorted to... lets see...
SPAM: -------------------- Start SpamAssassin results ---------------------- SPAM: This mail is probably spam. The original message has been altered SPAM: so you can recognise or block similar unwanted mail in future. SPAM: See http://spamassassin.org/tag/ for more details. SPAM: SPAM: Content analysis details: (15.9 hits, 5 required) SPAM: Hit! (2.4 points) 'Message-Id' was added by a relay (2) SPAM: Hit! (1.0 point) From: ends in numbers SPAM: Hit! (1.0 point) Subject: contains a question mark SPAM: Hit! (2.8 points) BODY: Offers a full refund SPAM: Hit! (1.9 points) BODY: Contains word 'guarantee' in all-caps SPAM: Hit! (1.5 points) BODY: Asks you to click below SPAM: Hit! (2.1 points) BODY: FONT Size +2 and up or 3 and up SPAM: Hit! (3.2 points) HTML-only mail, with no text version SPAM: SPAM: -------------------- End of SpamAssassin results ---------------------
Spamassassin good. I like Spamassassin :-)
Those who spoke on this:
Works
So, I can run Baldur's Gate 2, Unreal Tournament 2003 and The Sims on my new Linux install. I can listen to my mp3s, watch the DVDs, get things from my Digital Camera, send things to my MP3 player, read my mail, follow my RSS feeds and edit documents.
Finally, after four years, I can do everything under linux that I'm using windows for. The only thing I can see using windows for day to day now is those few games that don't like WineX.
The only blip on the horizon is an editor. Now, whilst I like and respect vim, I would prefer to have a graphical text-editor that will highlight html & php, preferably be able to load and edit files over an ftp connection, and ideally (though not critically) be open-source. Any ideas, world?
(and yes, non-geek stuff coming soon, this week's been a little unbalanced)
Those who spoke on this:
Pol:
Try Quanta which is an HTML editor with colouring. Vim does the colouring too (sorry).
Kwrite also does colouring, but not the FTP thing.
Aquarion:
There’s this thing, see, about me, Emacs, and barge poles…
Simon Willison:
My Linux adventures have only really just begun (I can read mail, web browse and that’s about it) but I’m already looking for exactly what you describe. Basically, I need an UltraEdit clone. GVim is pretty funky (it’s my main editor now) and Quanta is quite nice for HTML but I really want something with syntax highlighting, built in FTP / SCP and a distinct lack of archaic keyboard commands (or at least lots of GUI alternatives to help me out while I learn the thing).
Random Sigs In Slrn
Modified 2004-04-11 to use post_editor_command instead of editor_command since that works better
Modified 2004-04-29 to include signature compliance guidelines, and a possible line-end pitfall
- First, Catch your sigs. Best Sigs (or "tags") are either random lines that make just as much sense in context as they do out of it, Famous quotes from infamous people, or lines you stole off a website somewhere.
- Prepare text files.
The quotes need to be seperated by % signs, which is a bugger if you're using ones that are one line per quote. Personally, I've got a shell script like this:
which I can call with "#!/bin/bash read FOO while [ "$FOO" ] do echo -e "$FOOn%" read FOO donecat $file | fortunate > ~/.sigmonster/$file".It's important to note that these have to be in unix line format, rather than Dos/Windows (explaination). Plus, Signatures should not be more than four lines and a non-excessive line length (See your group FAQ for guidelines, they do change). Personally I prefix the quote part of my sig with an actual signature, so I have to go though each file and chop each sig to three lines or under.
Note I've put all my sig files in a directory all of their own, this makes life easier. Then we have to make databases of them. There is a util called "strfile" which comes with fortune (which we will be using in a sec) that does this. Make databases of all files (for FILE in ~/.sigmonster/*;do strfile $FILE;done). - Fortune favours the brave
Now we get fortune to randomly pick a line from any one of those files and display it. Like this: fortune ~/.sigmonster/ (Thoughout this, I've used ~/.sigmonster for the directory where I put the files. This is up to you, obviously). If this didn't work ("fortune:/ not a fortune file or directory") then something is wrong in step 2 - Set your sig
The first line of your signature will be read from ~/.signature, so I'd recommend putting something in there, probably the stuff you want to remain consistant across sigs. If you don't want anything to be consistant, make an empty file. - Live and Slrn
(Yes, these titles are getting worse). In your ~/.slrnrc file, you may have a line saying "set editor_command "vim +'set wm=72' +'set noai' +%d '%s'" or similer.If so, comment it out (prefix it with "%") andbelow that put in the following:set post_editor_command "FILE='%s';vim +'set wm=72' +'set noai' +%d $FILE;cat .signature >> $FILE; /usr/games/fortune ~/.sigmonster/ >> $FILE"
If you're feeling brave, you can merge your existing line with the new one, but I'd try mine first if I were you :-) - The Explaination
The post_editor_command declaration specifies what slrn is to do in the event of something needing to be edited - a message, for example. What I did there was replace the command with a script that edits the file, tacks a sig onto the end of it and sends it back to slrn for posting. The downsides of that script are that you don't see the sig before posting. That's because my setup has an auto-post formatter that makes my attributions right, but screws up my sig something chronic, so I have to add the sig afterwards. You could do it the other way around (tack on the sig then do the editing) by having this editor_command instead:set post_editor_command "FILE='%s';cat .signature >> $FILE; /usr/games/fortune ~/.sigmonster/ >> $FILE";vim +'set wm=72' +'set noai' +%d $FILE
Everyone loves Spam Statistics
This is a graph of my spam-count:

This is how I created my spam-count. It’s a combination of spamassassin, procmail, shell-script and PHP, and therefore full of Stuff Wot No Man Was To Wot Of. Or something.
First, I run spamassassin, which just generally rocks. All my email comes into one mailbox, aq which is at gkhs dot net. That includes every mailing list, every aquarionics dot com address, all my suespammers mail, and my hotmail account (via the really quite nice program, gotmail. It then gets fed though procmail which uses various script-fu to deposit mailing-lists into newsgroups on the local news server (I prefer reading discussion via usenet), and everything else gets sent though Spamassassin like this:
:0fw:/home/aquarion/logs/sa.lock
| /usr/local/bin/spamassassin
:0:
- ^X-Spam-Status: YES
$MAILDIR/spam/`date +%Y-%m-%d`
meaning that everything that SA thinks is spam gets forwarded to a mailbox within my spam folder with the name as the date. Most solutions I saw for this kind of statistics generation put all the mail into one box and then grab the date from it. For the way I’m doing it, that’s a waste of processing, plus it ignores Rule One: Spammers Lie. The date on the spam usually has no relation to the date you got it.
So, we now have a box called – for example – 2003-06-09 containing today’s Spam (On the second day of every month, a cron-job wraps all the last-month’s spam into a tarball and dumps it somewhere to rot). Every morning at 1:12am, the following runs:
#!/bin/sh
DATE=`date +%Y-%m-%d`
SPAMTODAY=`from -f ~/Mail/spam/$DATE | wc -l`
echo $DATE, $SPAMTODAY >> ~/logs/spam.log
(from is a program that displays the from: header of every mail in a mailbox. In this case, it generates one line per mail which is what we want). Giving us a file like this:
-<del>snip</del>-
2003-06-02, 328
2003-06-03, 134
2003-06-04, 130
2003-06-05, 152
2003-06-06, 125
2003-06-07, 123
2003-06-08, 267
-<del>snip</del>-.
Which we can do whatever we want with. In this case, a PHP script (or you can view that nicely formatted) which generates a graph.
And thats how I know I get about 100 to 300 pieces of spam every day.
Best yet, that’s the only way I know I get 100 -> 300 pieces of spam a day :-)
I have a weblog?
Lack of entries? Lack of life. My entire life at the moment seems to consist of Wake up, Go to work, Code, Go home, Dinner, Sleep, Wake up. Go to work, fix computers, go home, dinner, sleep…) with variations like reversing dinner and going home and having dinner in London with ccooke & ruthi,
The last few days have been mostly spent putting my new work setup together, which consists of a box running Gentoo Linux (named aziraphale) running enlightenment (I like enlightenment, it Just Does, but I’ll be switching to gnome tomorrow, when it’s compiled…) and vmware workstation, which in turn is running XP Pro (as crowley), which is our development environment. The main reason for that is that I have a backup of crowley on aziraphale, so when (not, not if. When) the XP install dies a nasty and horrible death (Our software has a couple of bugs atm, meaning that occasionally it’ll install itself and not be able to uninstall, and since it’s an IE thing this is complicated) I can just restore the working config, and keep coding.
This would be bad if they were both on one monitor, but usable. Fortunatly I found a spare graphics card, so right now I’m typing into OpenOffice on the little monitor to the right, whilst IRC, Mozilla and everything else runs on the 17, this was suprisingly easy to set up once I groked the XFree config file sufficently. Only problem is that VMWare appears to dislike running on a second monitor in maximized mode (moving to the edge of the screen which should take me to the first monitor wraps the pointer to the other side of the small screen unless you move reaaaaaaally slowly. All other screen edges are hard barriers, incuding and this is the annoying bit the opposite side of the monitor). On top of all this, I’ve been told that at some point I’ll be developing a cross-platform version of our s/w, so that looks to be fun.
Slightly worried about the direction of the nomic, mostly worried about people flooding the game with some rules that make actually doing things difficult. Mostly, though, I’m annoyed that I’ve spent more time administrating the game than I have playing it, and that people are trying to drag the admin into the game, which is exactly the oposite of what I wanted to do. If I’d wanted imperial nomic (A variant where an emporer decides wheather rules pass on the fly) I’d have proposed it. Bah.
The writing fails to happen. Three hours a day on a train, sitting down, would you may have thought have been perfect for writing, and this would be true if I had something to write on and with that wasn’t manual, until I can get nemo (my ancient laptop) a battery (100, roughly, that I can’t justify) that might change.
Or a powerbook. That’d help too. (My CEO was given a powerbook. Given. By a friend. Nevermind, a couple of years and I’ll be a millionaire.
(I was voted person mostl likely to be a millionaire before he’s 25 at school. This appears to have been inaccurate, so far, but I live in hope)
(Acutally, I live in Reading, but it’s close)
Software. AqWiki will get a release as soon as I can be bothered to package it, Nomic Rules Manager will get a cool name and a release some point very soon, and Aquaintances will get a release when I work out why it isn’t catching the errir that is fulling my mail box with cron errors.
Epistula will now not get a packaged release, probably, until I’ve convinced myself I don’t want to completely rewrite it in perl. It’s live code is still online, though.
Networks are weird
A query for the networking geeks in the audience…
- Box A runs Windows XP, it’s an Athlon 2000XP.
- Box B runs Debian Sarge, It’s an Athlon 1200XP.
- Box C runs Debian Stable, It’s a Celeron 300mhz.
Downloading a file from a HTTP server with Box A takes $time
Downloading the same file with Box B or C (Or similerly sized files from the same server, so no caching) takes $time/3
Downloading said amount of data from the same server with Box A running though a squid cache server on either B or C also takes $time/3
All are plugged into the same hub, behind the same router, on the same ASDL.
Why? And how can I fix this? (Apart from installing Linux on A, which is mostly a games box ATM, and dual boots to Gentoo anyway)
Those who spoke on this:
Senji:
My first thought is that the network cards in these machines have different fragmentation properties – can you try swapping two network cards?
Castellan:
I have just got adsl and I have been noticing a similar problem although my factor of speed reduction is more 10 than 3. I think we both use the same firewall (ipcop?) but strangely I am fairly sure this isn’t the cause of the problem. IE5 and 6 on W98 clients have no problem, nor does a DedRat file server controlled via Webmin, but my Moz1.5 on Win2K intermittently suffers this speed drop. Of course I am not a networking geek and so I am not really being much help but if I get any warmer I’ll email you.
Pingter:
Hmm, are you sure this isn’t a question from PuzzleDonkey? :-)
Have you tried switching the drives between machines to see… what happens.
Fear my debugging technique.
Those who spoke on this:
emma:
You’re in a twisted maze of Operating Systems, they all look alike.
legals
from ssta’s LJ
[smsie] Tron: about the only people NOT afraid of the MS legal division is the FSF legal division :)
[tron] smsie: Heheh
[smsie] everyone is afraid of the FSF legal division
[tron] smsie: And that’s only because they’re far more intelligent. :)
[smsie] Tron: nono, it’s because (a) they’re prety good lawyers and (b) they do it for free from a sense of zeal. ph33r the pro-bono lawyer with zeal. He’ll tie you up in court for a century and not care how much it’s costing you
[smsie] Tron: the FSF have armies of zealous pro-bono lawyers…so not only can they keep you in court forever…they can do it in shifts
[smsie] the FSF doesn’t have to be right....they just have to be convinced that they’re on the moral high ground
Packaging the future
What I want, you see, is for the requirement that a popular linux app support nine different packaging formats to go away. In this utopia, there would be *an* – for example – ‘Open Office for Linux i386’ in the UPF which you download and and it then hands a list of dependances to apt-get, rpmdrake, rpm or whatever which then translates them into packages and gets them by the current way.
Various people are doing the “One True Packaging” thing for distribution, not least Installshield – whose eponymous system is pretty much the standard for Windows applications, but all these have dependency problems, in that they all include every possible dependency in the package itself, meaning you’d end up downloading and installing a new JavaVM for every Java application you use.
Ideally – as Stephen pointed out when I mentioned this on IRC - this would be LSB based, so that it could see “Well, I don’t have that library, so I will ask apt for $(standardised name of application)”, and if it worked that way it’d be great, but the current system whereby everything is packaged separately for every distribution means that developing a major Linux application requires either understanding every variant on each package management system or a willingness to get the community to do all the work for you, and do it exactly how you want it to be done. And if a job’s worth doing…
All of which could be avoided with a little co-operation, which is something OSS people are meant to be good at.
Those who spoke on this:
Pol:
Gentoo Portage.
Not a packaging format, just a sensible method of dependancy checking.
It works for me. Even for binary packages.
Loopholes in Operating Systems
(Reposted here partially in response to Aquarius on the subject)
“Martin Underwood” wrote:
“Johnny” wrote:
“Conor” wrote:
It means your PC won’t become a trojan infested pile of stinking crap
That sounds like Windows to me, ever increasing in size too.
I’ve always wondered: do Linux and MacOS have any security loopholes? Is part of the problem simply that most virus writers direct their attentions to Windows because it is the most popular OS? I believe that XP is inherently more secure than Win 95/98, but is more prone to viruses because virus writers are concentrating on XP rather than Win9x. The same may be true of Linux and MacOS compared with XP.
For MacOS this is partially true, being less of a mainstream OS it doesn’t get so many viruses. Linux is slightly more preemptive and reactive, the theory is that since so much of it has source code open to public viewing, somebody somewhere will see any potential security vulnerability. In fact, Linux/Unix based systems do suffer from such exploits for similar reasons as Windows – and about as frequently – but the community as a whole tends to react far quicker and with much more honesty about the problem. (For example, see this, an archive of this year’s security announcements for Debian GNU/Linux).
On top of this, Linux has a couple of other advantages. Firstly, that usually the only “given” on any Linux system is the kernel itself, other functionality is supplied by a myriad of other packages. The mail server could be Exim, Sendmail, QMail or any one of a hundred others, for example, but for a Windows system you’re pretty much guaranteed to be running Exchange. Windows’ ‘cohesiveness’ – the property that makes it a much easier to use desktop system than any current *nix based one – is the very property that makes it an easier target, since you can pretty much predict what’s running on any given Windows box and target that.
Finally there are the Users. Most of the Linux user base are still relatively geeky people who are aware of the importance of keeping up to date with the security holes, whereas a frightening number of Windows users have the same sort of problem as Oscar above, that they don’t understand what they actually need to do or – in a more office based scenario – why they should care.
Of course, the fact that Windows users outnumber Linux users 100 to 1 (at least) doesn’t help either, plus a number of crackers will deliberately aim at the “Evil Empire” on purely ‘moralistic’ grounds.
Fear the fuckwits who think themselves on the side of “Good”.
Faithfully Yours,
AquarionFrom his Windows PC, though his Linux news server :-)
Those who spoke on this:
Aquarion:
Heh, didn’t see that one. I’ve now forgotten what the footnote said, so I’ve deleted the reference.
Rory Parle:
That doesn’t solve the mystery of what they meant though. They’re still waiting to be noted in my mind. Just another tiny thing to add to my quiet insanity.
sil:
“Windows cohesiveness the property that makes it a much easier to use desktop system than any current *nix based one is the very property that makes it an easier target, since you can pretty much predict whats running on any given Windows box and target that.”
Yep. That’s an additional point that I hadn’t thought to mention; when I build Windows boxen for people, I install Firefox instead of IE (to avoid spyware, and for lots of other reasons) and Eudora instead of Outlook (to avoid viruses, and because it’s free).
Today's Trick
Today's Spambeating Trick Of The Day:
zcat ~/mail/sentArchive/* | grep "(^To|^CC)" | perl -e "while (<STDIN>){print /(w*@[w|.|-]*)/; print "n"}" | sort | uniq | xargs --replace -exec echo "whitelist_from {}" >> /home/aquarion/.spamassassin/user_prefs
Where it fails:
When there is more than one address on the To: line.
Why I don't care:
I don't often send mail to more than one person.
Here and back again
Things that have happened in the last five days since ‘Threadnaught’:
- I’ve learnt that the secret to chocolate sauce is to shake the bottle with the lid closed.
- Brown shows up on white curtains, seven feet from the table where there was ice cream and a limited amount of chocolate sauce.
- And the carpet.
- Also the television, speakers, post and furniture.
- Do not follow Aquarius blindly when he says “Kernel-image-2.6.4-k7” as your laptop is not a K7 and this won’t work.
- 686 works better
- XF86 doesn’t like your laptop much.
- Project Utopia is Neat.
- Debian Rocks.
- It’s a good idea to pay your rent
- You should remember that you’re getting paid by cheque, and these take four working days to clear.
- My bank has just decided that cheques now take six working days to clear. The age of communication is upon us, and Halifax is going backwards. May it fuck off and die, and take my overdraft with it.
- Buying a Young Persons Railcard is cheaper than the discount it gives you for a ticket to Durham.
- ...yet despite already having a Railway Photo Card (for my Letchworth/London railcard) I need another photo card for the YP Railcard.
- I still don’t deal with photo booths well.
- Using the advice a model gave me on how to not look like a serial killer in passport photos makes me look like a male model.
- Who is also a serial killer.
- Train compains remain morons.
- RedDragDiva’s Mushroom Thing is really nice.
- It’s vitally important to take your keys when leaving the office
- Especially when the following day you can’t get out of the house because your girlfriend deadlocked the door (your keys for which are in London) and the back garden backs onto three other back gardens.
- The spare keys are in LC’s room, on the dresser.
- You moron.
I’m off to Durham for the weekend. TTFN
Those who spoke on this:
Pingter:
Yers, I noticed that 6 day cheque clearance right at the end of the updated T&Cs where I’m supposed to have given up reading it or something. Mumble mutter stupid bank. Fortunately only my Nan gives me cheques…
Ant:
I’m dying to know, what was the photo booth advice, as my passport photo booth pictures just make me look like an East End thug who’s lost a lot of weight.
Senji:
Cheques take longer to clear when you forget to pay them in and instead take them to Durham with you.
Xinerama-a-rama
How to get Dual Head working on Dell's Latitude c610
With one monitor plugged into the monitor port and the LCD display, you too can have a dual-head setup. It's great. You do it like this:
In XF86Config:
Section "Device" Identifier "radeon_one" Driver "radeon" BusID "PCI:1:0:0" Screen 1 EndSection Section "Device" Identifier "radeon_zero" Driver "radeon" Screen 0 BusID "PCI:1:0:0" EndSection Section "Monitor" Identifier "LCD" HorizSync 30-57 VertRefresh 43-72 Option "DPMS" EndSection Section "Monitor" Identifier "CRT" HorizSync 30-57 VertRefresh 43-72 Option "DPMS" EndSection Section "Screen" Identifier "LCD Screen" Device "radeon_zero" Monitor "LCD" DefaultDepth 24 SubSection "Display" Depth 24 Modes "1024x768" "800x600" "640x480" EndSubSection EndSection Section "Screen" Identifier "Monitor Screen" Device "radeon_one" Monitor "CRT" DefaultDepth 24 SubSection "Display" Depth 24 Modes "1280x1024" "1024x768" "800x600" "640x480" EndSubSection EndSection Section "ServerLayout" Identifier "Default Layout" Screen "LCD Screen" rightOf "Monitor Screen" Screen "Monitor Screen" InputDevice "Generic Keyboard" InputDevice "Configured Mouse" Option "Xinerama" EndSection
How to convert AMR files to MP3
The Nokia 7600 (And - I'm told - some Erikson phones) record in a format called "AMR". After a little digging, I was able to convert these to a usable format (MP3) on my Linux box. This is how I did it:
You will require:
- sox (via your package manager)
- lame (Or some other encoder, see below)
- The 3GPP reference converter files
The first is easy, sensible people should be able to apt-get install sox or whatever. The second may require some compiling and following instructions, the third is more complicated. The 3GPP FTP site appears to move around a bit, so links go outdated. I got it from here, but you might have more luck just searching google for "26104-520.zip".
You need to get that file, unzip it, unzip the zip inside it (It all unzips into the current directory, so you'd best put it somewhere on it's own first) and you'll get a series of c & header files. If you're using Linux (and the rest of this assumes you are) cp makefile.gcc Makefile and make it. xa.bi's site (Where I found the decoder existed) says you should do some playing with the files, but I've no idea what difference it makes. His site, btw, contains a much more advanced AMR converter than this, but I didn't need that kind of complexity. Put the resulting executables (encode and decode) somewhere useful, and remember where it is.
This is the shell script I used to make it go, you could edit it, or write your own.
#!/bin/bash
# By Aquarion - Aquarion@Aquarionics.com
# Do what you want with it, it's not rocket science.
##Change these:
#Wherever you put encode and decode when you compiled them:
CODEC=/home/aquarion/opt/mms
#Temporary directory. Chances are you've already got this set
#TEMP=/tmp/
#Where do the final MP3s go?
FINAL=mp3/
for file in *.amr; do
FILE=`echo $file | sed -e "s/.amr//"`;
echo -n "$FILE [AMR] -> [$TEMP]"
$CODEC/decoder $file $TEMP/$FILE.$TEMP > log.std 2> log.err;
echo -n " -> [WAV] "
sox -r 8000 -w -c 1 -s $TEMP/$FILE.$TEMP -r 16000 \
-w -c 1 $TEMP/$FILE.wav > log.std 2> log.err;
echo -n " -> [MP3] "
lame $TEMP/$FILE.wav $FINAL/$FILE.mp3 --silent \
--tt $FILE --ta $USER --tl Aquarionics --ty `date +%y`
echo " :-) "
rm $TEMP/$FILE.wav;
rm $TEMP/$FILE.$TEMP;
done
That script as written takes all .amr files in the current directory, turns them into .mp3 files and puts them in a subdirectory called "mp3" (which needs to exist before you run the script.)
And there you have it. If you want to convert them to oggs, you'll need to muck around with the "lame" line of the script a bit. Oh, and you'll probably want to change the album away from "Aquarionics" too.
Those who spoke on this:
asjkgcc:
who gives a fuck about linix. you fuck head!
Athos:
Hi Aquarion,
I have this problem: I dumped a VoIP call with AMR codec and tried to convert the AMR payload with the script but…. : invalid magic number.
Could you please help me?
regularguy:
Well, apparently, 2 more adults give one about Linux than give one about your opinion.
Halfwit.
zobi:
hey goddam dickhead, sounds like you can’t even spit (non talking about merely speaking) your own language) go fuck yourself on your winblows box and let us work on some real engineering, the one that requires languages abilities as well.
f*k you
jorma:
> xa.bi’s site (Where I found the decoder existed)
> says you should do some playing with the files,
> but I’ve no idea what difference it makes.
On my redhat 9 box decoder only segfaulted when makefile and decoder.c where not edited as told in the other article. After editing decoder worked fine.
Tor:
Yeah, I also had to edit as per xa.bi’s description.
After that it worked fine (otherwise it would try to
decode from the #!AMR magic number at the start of the file (as when transfered from e.g. a S-E phone), that’s why it would crash).
I installed ’decoder’ as /usr/local/bin/amr_decoder and then used just this simple script to convert to .wav format (which can be played directly by e.g. mplayer):
#!/bin/sh
if test $# -ne 2; then
fi
/usr/local/bin/amr_decoder $1 $1.raw
sox -r 8000 -w -c 1 -s $1.raw -r 16000 -w -c 1 $2
rm $1.raw
Max Littlemoore:
I am interested in going the other way.
I’m using Sarge with bluetooth and I have home grown samples I want to convert to amr to play on my my phone….
I am not too experienced with to codec tools so any help would be extremely appreciated.
A link perhaps? ... or maybe its simple and I’m missing the point.
Some help would be waxed lyrical about anyway.
Best Wishes
silvano:
the decoder always gives me the error
unknown TX frame type 8483
I tried various AMR input files, always with the same result. I’m using version 26073-600 of the
3GPP decoder.
hpn:
nice information. :)
The amr to mp3 conversion worked for me, alright. But how about vice versa?
I tried using the binary ‘encoder’, but I ain’t sure what the mode and the other options needed there ought to be. Help appreciated.
Thanks in advance.
xurizaemon:
i used ffmpeg to convert wav => amr
should be fine for mp3 => amr too
ffmpeg -i Fog.wav -acodec amr_nb -ac 1 -ar 8000 -r 8 fog.amr
CodEnemy:
good contribution (after your little digging) however, i think you should have had explained what does the three packages do instead of exposing your magic script.. which didn’t make it easier at all!!!
Tigggger:
Yes, For Windows I downloaded converter tool from miksoft.net. Works perfect and you can convert both ways amr to mp3 and mp3 to amr also various other sound and videaoformats.
Hope it can work for you too, Saludos desde Guatemala!
linad:
JESUS!! aint der no software to convert it :@
noonard:
I’m having a nightmae implementing this… The problem is the 3GPP decoder – it works fine for certain AMRs but I get segfaults for others (and yep – that’s after the modifications suggested). Truly bizarre, especially seeing as both seem to be in the same format to begin with!
Any ideas?!
A Nameless One:
Have you remove the optimizer? e.g. it shouldn’t say -O4 but -O2 or no -O at all.
Also the script isn’t space safe, So if th efiles got space in them that script will die. I really hope libavcodec will include this in the compiles per default in the future.
biagio:
On Fedora Core also I needed to apply the change suggested by xa.bi otherwise I had segmantation fault. Morever I had to modify the script substituting $TEMP varaible with “raw” otherwise sox get troubles (it seems that recognizes the file format by extention).
humble:
some small changes were done to
1. create .raw file as sox is more happy with
that2. handle spaces in original filename.
#!/bin/bash
- By Aquarion – Aquarion@Aquarionics.com
- Do what you want with it, it’s not rocket science.
##Change these:
#Wherever you put encode and decode when you compiled them:
CODEC=/home/humble/mydata/mms
#Temporary directory. Chances are you’ve already got this set
TEMP=/tmp
#Where do the final MP3s go?
FINAL=mp3/
for file in *.amr; do
FILE=`echo $file | sed -e “s/.amr//” -e “s/ /_/g”`; echo -n “$FILE [AMR] -> [$TEMP]” $CODEC/decoder “$file” $TEMP/$FILE.raw > log.std 2> log.err; echo -n “ -> [WAV] ” sox -r 8000 -w -c 1 -s $TEMP/$FILE.raw -r 16000 -w -c 1 $TEMP/$FILE.wav > log.std 2> log.err ; echo -n “ -> [MP3] ” lame $TEMP/$FILE.wav $FINAL/$FILE.mp3—silent —tt $FILE—ta $USER—tl Aquarionics—ty `date +%y` echo “ :-) ” rm $TEMP/$FILE.wav; rm $TEMP/$FILE.raw;done
m4kda:
or if you want a quick solution and you are not too bothered about privacy, the online http://media-convert.com/ will convert to/from AMR format.
Dayze
So, the week then.
Tuesday I got home from work at about 20:00 as usual. I discovered that atoll, my main server and home to my life, documents, music and email was thrashing at a 50.00 load average and the terminal was spewing out line upon line of “DriveSeek Failed” errors. This was not an unknown error, Atoll’s previous hard drive (Identical make and model) died in a similer way about a year and a half ago. The drive can read fine, but as soon as you try to write to it it thrashes the computer completely. I ended up buying the replacement drive (the one that has just died) and eventually (about two months ago) sent the old one off to be repaired. So I sat and swore at the drive for a while, redirected my email, powered off the computer, and wished I had more time to deal with this.
At this point, there was a doorbell. Nobody apart from the Jehovahs Witnesses and the Pizza People use our doorbell, so at 9pm this was unexpected.
It was, in fact, our neighbour. He was delivering a package that UPS had failed to.
It was the replacement hard drive.
The timing of this was so incredibly fortuitous that my immediate reaction was to install the drive and start copying the data. This was hastily kyboshed. The last thing I want to do is replace the dead drive with the same model that has died so faithfully twice before.
Wednesday I got atoll to stay together long enough to be able to edit /etc/fstab so that the broken partition (it was only one partition this time) was mounted read only, which means the server is back together until next month, when I can buy a new hard drive. Eventually, I decide to put the replacement 120 gig drive into my desktop, where it doesn’t matter so much if it dies. I resolve to do this at the weekend.
Thursday
Can you guess what happens Thursday?
- Everything works perfectly.
- The main server dies
- The main server explodes
- The hard drive in my desktop dies.
Anyone who went for the forth option can have a cookie.
This has been a bad hardware week.
Random screams of fear
Lack of posts. Here’s why:
My main problem with Zope is the documentation which is either a) for a version in advance of the one I’m using; b) has a prerequisite level I can only aspire to; or c) Doesn’t answer the question I have (like ‘What parameters do I feed it?’) whilst being the comprehensive, only documentation on the subject.
I’ve switched to KDE at work, because whilst I don’t like the interface, bloatedness or flakyness of it (esspecially JuK and Artsd, which I have to manually kill several times a day), the KIO system rocks (Basically, it allows me to open webdav documents with the filename ‘webdav:user@server/path/to/doc’, other documents over an ssh connection (fish:user@server/path/to/doc) or anything. There is absolutly no fucking way this should be part of the desktop environment, it should be split off from KDE so that everything, everybody, from curses to gnome to enlightenment should be able to (and should) use it.
Most of all, because the only text editor I can use with it is Kate, the KDE Advanced Text Editor, and I keep getting syntax errors because ”:wn” isn’t valid python. No, kvim doesn’t work. The Ubuntu (actually Debian in this case) package for AMD64 doesn’t actually include the kvim binary and I can’t get the thing to compile manually.
And now I have 10 minutes to get up and dressed before I have to go try to catch the bus. TTFN
- 2005-01-20 06:04:56
- By Aquarion
- From Casarufus, Letchworth
- More Journal Entries
- Filed under Those Who Evolve & Linux
Those who spoke on this:
sil:
Um…Gnome does all that webdav and ssh stuff as well, though? See the “Connect to server” dialog, or “Open Location”. Or did you mean “switched to KDE from Windows”, rather than “switched to KDE from Gnome”?
Aquarion:
Yeah, but it refused to talk to our webdav server, wouldn’t work from gvim, trashed files and was generally significantly less usable about it than KDE is. This is built into the standard file dialog, you can type “webdav://nicholas@zopeserver” into the dialog and get a list of all the files on the server as if it were a local drive
MP:
Why can’t you use gvim then? It still integrates into KDE to some extent, and I’ve never got kvim working at all on this box…
Making the Lexmark Z515 work under Debian Linux
Lexmark printers are notorious for being crapper than a crap thing on St Craps day, whilst playing Craps in a pile of crap on the planet “Crap” within the solar-system “Crap”, especially under Linux.
Nevertheless, I bought one. Because it was cheap.
(It does, I should warn potential followers in my footsteps, come with a half-filled colour cartridge and no black. Factor in another 15 (The same cost as the printer, fact fans) for a full black cartridge. Cheap printers are a false economy. Lesson ends)
Much of the work of getting this all working under Debian has already been done, and much of this article cribs liberally from the Gentoo Wiki article for the same thing.
These instructions are for Debian Sarge (That’s ‘Testing’) and so should also work with Ubuntu.
This is what you do:
Preparation:
apt-get install gs gs-esp cupsys printconf alien
(I love Debian)
Grab the Real Linux Drivers from Lexmark:
http://downloads.lexmark.com/cgi-perl/downloads.cgi?ccs=229:1:0:389:0:0&emeaframe=&fileID=1151
Installation:
Create a new directory, and put the file you downloaded above inside it. Lexmark’s drivers all extract to the current directory.
Be inside that directory
Bypass their horrible “auto install” script by running:
tail -n +143 z600cups-1.0-1.gz.sh > install.tar.gz
and then extract install.tar.gz (which also goes to the current directory)
You should now have a whole host of useless files and a couple of RPMs (Because we all know that everyone uses deadrat, don’t we? sigh) so we turn them into Debian packages using Alien:
alien *.rpm
And then “dpkg -i” on both of them to install. Make sure the printer is plugged in and turned on, and then run:
ldconfig
followed by:
/usr/lib/cups/backend/z600
Which should say something like:
direct z600:/dev/usb/lp0 "Lexmark Lexmark 510 Series" "Lexmark Printer"
Cups
Setting up cups is somewhat beyond the scope of this article, but what the hell.
Default install of cups doesn’t let anyone outside the local machine access the interface. If this is cool, great, otherwise edit the /etc/cupsd.conf file to let in anyone in 192.168.* or whatever your network’s on.
Cups interface is on http://localhost:631 (It’d be useful if the package mentioned that while it was installing, or something) the admin password is your root password (the username is ‘root’) so don’t, whatever you do, ever access CUPS admin over an Internet connection until you change that behaviour. It’s a stupid bloody default anyway.
So. Click “Administration”, “Add Printer”, Fill in stuff, “Lexmark” (Use the top one, rather than “USB #1 Lexmark” or whatever), Make is – duh – Lexmark, Model is the only one it gives you, Print a test page to make sure it’s working, if it isn’t, then “tail -f /var/log/cups/*log” to see why.
Have A Lot Of Fun.
Those who spoke on this:
MP:
Well, yes… Lexmark printers are crap. However, they are amazingly useful when you need a printer and don’t have one to hand. We currently have about 4 of the lying around…
nattie:
Wouldn’t that be drunken young employees of Richard Branson?
Aquarion:
Could Be…