June 7, 2011
ssmtp and aliasing the TO-address
I ran into a rather annoying problem today, Gentoo had pulled in ssmtp and it had started to send out mails, but since root@localhost didn’t really go anywhere everything got sent to my host’s support address, which they weren’t very happy about (sorry).
My setup up to then had been using nailx (portage: mail-client/nail) as a mailx replacement since it supports sending mails straight to an SMTP server but since I already had ssmtp now (which I didn’t know about when I set this up) I figured I’d try setting that up correctly so I could finally be rid of the dead.letter files in my homedirectories. Setting up ssmtp to send mail to an smtp server proved fairly trivial, however aliasing “root” to something more useful proved a bit harder, or rather, the information on how excatly to go about it proved to be fairly hard to find at least if you don’t know what you’re looking for.
My first intuition was to use ssmtp’s revaliases, unfortunatley that doesn’t quite work as it aliases the from-address, not the to-address. A bit of Googling later I found out about /etc/mail/aliases but that file isn’t supported by ssmtp at all (although it oddly is present on my system).
In the end it turned out I needed to use mailx (portage: mail-client/mailx) instead of nailx to provide the mail program so I then could edit /etc/mail.rc like this:
alias root root<root@myremoteaddress.be>
This of course also works for accounts other than root and it seems to work just fine. I’m sure the nice folks at Benesol will be able to appreciate it.
June 3, 2007
GNU Emacs 22.1 released!
This morning I check in on #fvwm and the first thing I notice is the following:
03/06|01:03:06 < Hun> theBlackDragon: aaaaaaaaaaah!
03/06|01:03:13 < Hun> e22 has been released!
So I run off to the Emacs homepage, but nothing to be found about a new release. Hmm.
So what can you do? Check usenet of course, and sure enough on gnu.emacs.devel (e-mail addresses removed for obvious reasons):
From: David Kastrup <*@*> Subject: Re: Cygwin binaries for Emacs-22.1 released! Newsgroups: gmane.emacs.devel To: Angelo Graziosi <*@*> Cc: emacs-devel@gnu.org Date: Sat, 02 Jun 2007 21:18:05 +0200
Angelo Graziosi <*@*> writes:
> Cygwin binaries for 22.1 release here: > > http://www.webalice.it/angelo.graziosi/Emacs.html
I was going to mouth off about premature announcements and being careless about release numbers, but checking on the ftp server have found that the tarball for Emacs 22.1 has been uploaded.
Did I miss the announcement on this list?
-- David Kastrup
And sure enough, there it was, on the GNU FTP server, all shiny and new: an Emacs 22.1 tarball, the changes from 21.x are a little bit too numerous to sum up here, I’d say just upgrade or read the ChangeLog.
September 19, 2006
Yes, I’m still here…
People who have played Baldur’s Gate 2 might recognize the quote, but anyway, I’m still around and I thought I had some interesting things to tell, and a little explanation for some weird/pathetic behaviour over the past months…
I’ve bought myself three new IT related books:
- Aspect-Oriented Software development by Ivar Jacobson and Pan-Wei NG (Addison Wesley)
- Ruby Cookbook by Lucas Carlson and Leonard Richardson (O’Reilly)
- The Art of SQL by Stephane Faroult with Peter Robson (O’Reilly)
So I’ve got quite some extra reading to do 😉
It’s been some time since I last really used Ruby and I must say that the language’s documentation has improved a lot over the last few years.
While we’re on the subject of Ruby, Thomas has announced that FvwmRuby is as good as finished, I’ve been looking forward to this ever since he announced he was working on it about a year ago, now I might finally get around to coding FvwmMpd as an FVWM module, yay 🙂
On a personal level I’m still struggling with what started nearly three months ago. I still can’t really grasp what happened and I’m still struggling with it on a daily basis. It’s really hard to understand how somebody you think actually cares about you, for which you think you mean something, can just replace you when the next best guy comes along. And then I haven’t even mentioned the amount of lies, half truths and whatsnot…
For some reason I always have to think about this song by The Crüxshadows (Even Angels Fall):
Sorrow sings her kisses in silence and adjusts the blinds to keep the light from mocking everything I feel She dances slowly a silhouette upon the curtains but her eyes seem to cry only empty tears I beg for comfort with inadequate verse it meant so much to me.... and so little to her and I am sinking into a mountain of self pity why can't I simply disregard all the things I feel? "where is my angel," "where is my angel," "where is my angel, when I need him most?" "where is my angel," "where is my angel," "where is my angel, tell me now where did he go?"
Oh well, it makes me think of a good number of other songs as well, but anyway… It makes you wonder who you can still trust if even the person you trust most on this planet treats you like … I dunno… like you’re disposable? Like you’re nothing or nobody?
Good thing I still have friends to support me and community work and projects to immerse myself in, keeps a man going through hard times. So thank you all, you know who you are!
August 2, 2006
Using MPD and Icecast to stream audio
So what prompted me to do this in the first place? I tend to switch back and forth between my laptop and my desktop quite often and since both are in different rooms I like to have the same music playing on both…
Since I already used mpd to play my music from a remote Samba share I decided I might as well use that box to play it too and use a webinterface to control mpd and just stream the audio so I could listen to it from basically anywhere.
To make this work you’ll need a couple of things that you can probably install in a distribution specific way:
- MPD from SVN (the release version won’t work at the time of writing)
- Icecast, I used version 2.3.1
- the Apache webserver with a working PHP configuration for phpMp
- phpMp itself
Let’s start by setting up Icecast, after you have installed it you’ll have to edit the configuration file, which is an XML file that by default resides in /etc/icecast2/icecast.xml. In this file you’ll want to replace all occurences of ‘hackme’ with decent passwords. You’ll also want to set hostname to the hostname of the box icecast is running on. You can also change the port icecast uses here if you want to, though the default should be just fine. So much for setting up Icecast, let’s move on to MPD.
First you’ll have to do the default configuring of MPD, set up your music directory etc. once that’s done we are going to configure MPD to send it’s output to our Icecast server.
audio_output { type "shout" name "DragonStream" host "localhost" port "8000" mount "/stream.ogg" password "hackme" quality "5.0" # bitrate "128" format "44100:16:1" # # Optional Parameters user "source" # description "here's my long description" # genre "jazz" } # end of audio_output
Most of the options here are fairly self explanatory, name can be anything you want to call your stream and is what most clients will show you, the port is the port your Icecast server runs on. Mount defines the URL you can find your stream on, being icecast_hostname:icecast_port/mount. The quality option sets the quality of your stream, 5 is CD quality, alternatively you could set the bitrate option, but since this version of icecast only streams in Ogg Vorbis format it might be handy to just leave it as I suppose it’ll stream variable bitrate then (though I’m just wildly guessing here). There should be no need to change the format. Description and genre are optional and do what it looks they do: define the genre and description of your stream for clients that display use information.
I won’t go into the details of installing or configuring Apache and/or PHP as that’s such a huge and distro specific topic that I won’t even start to bother, so I assume you have a working Apache + PHP setup. So download phpMp, extract it somewhere in your webroot and open the config.php file, there are only two things of interest here: host and port, check if those are correct and close the file.
You should now be able to start playing songs from your phpMp interface and listen to them using some streaming client that supports Ogg Vorbis, like Winamp or XMMS, be aware that you can’t start listening to the stream if you’re not playing something, that’ll just give you an error.
You’re also not constrained to using phpMp, you can use any MPD client to connect to your MPD server, you just have to make sure you secure your server enough if you allow external connections. You can do this by disabling bind_to_address (just comment it out) and use the password directive to set a password.
All in all I like the flexibility this setup gives me, the only real issue is that pausing MPD disconnects Icecast clients.