Twitter Fishing

Go fishing with @FishingFritz, the charming twitter bot. Experience the recreational silence, thrilling decisions and a lucky reward. Join by tweeting #beaucoupfish, that’s all.

The idea is simple: rebuilding a fishing experience on Twitter. I never ever went fishing, but I suspect that the whole thing comes down to:

  1. Throwing out the bait
  2. Wait and relax
  3. React when a fish has bitten
  4. Success

These steps can be easily transferred to a Twitter bot, named Fischers Fritze. This bot let’s you experience waiting, surprise and success outside of a fishing boat.

read it

MPD and alsa devices

I faced a problem with addressing the right alsa card with mpd. the logfile showed me:

ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
May 20 18:28 : output: Failed to open "USB Behringer" [alsa]: Failed to open AL$
May 20 18:28 : player_thread: problems opening audio device while playing "rapp$
Audio File Library: WAVE MPEG layer 3 data format is not supported [error 0]

after running:

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I found out my card to be hw:1,0 … and the

aplay -D hw:1,0 test.wav

was successful

but mpd didnt like it in its mpd.conf… the alias finally did the trick. running

aplay -L
    Discard all samples (playback) or generate zero samples (capture)
    PulseAudio Sound Server
    HDMI Audio Output
    Direct sample mixing device
    Direct sample snooping device
    Direct hardware device without any conversions
    Hardware device with all software conversions
    USB Audio CODEC, USB Audio
    Default Audio Device
    USB Audio CODEC, USB Audio
    Default Audio Device
    USB Audio CODEC, USB Audio
    Front speakers
    USB Audio CODEC, USB Audio
    4.0 Surround output to Front and Rear speakers
    USB Audio CODEC, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
    USB Audio CODEC, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
    USB Audio CODEC, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
    USB Audio CODEC, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
    USB Audio CODEC, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
    USB Audio CODEC, USB Audio
    Direct sample mixing device
    USB Audio CODEC, USB Audio
    Direct sample snooping device
    USB Audio CODEC, USB Audio
    Direct hardware device without any conversions
    USB Audio CODEC, USB Audio
    Hardware device with all software conversions

my mpd.conf finally looks like:

audio_output {
        type            "alsa"
        name            "USB Behringer"
        device          "default:CARD=CODEC"
#       device          "hw:0,0"        # optional
        format          "44100:16:2"    # optional
        mixer_device    "default"       # optional
        mixer_control   "PCM"           # optional
        mixer_index     "0"             # optional

the help is documented here:

A1TV and MythTV

Beware, Mythtv 0.25 (the version of mythbuntu 12.04) does not support watching IPTV Channels in LiveTV, see here. Luckily, recording works.

Introduction and Overview

In this tutorial I explain how you can use Mythtv (a free Media Center software for Linux) with A1 TV (an Austrian IPTV service), formerly known as aonTV). Why do you want to do this when you already have a working Settop Box sitting under your TV? Mythtv turns your PC into a digital recorder with the following features:

  • watch and record TV shows
  • Pause and rewind live TV (time-shift)
  • connect several frontends and backends to your system
  • a webfrontend makes recording scheduling and administration easy
  • open source
  • several plugins for creating a customized media center
  • automatic detection of commercials
  • schedule recordings automatically (e.g. once a week, every day, find once)
  • watch DVDs and your video collection
  • also Mac support, but no Windows for the moment
  • and my picture’s quality is better than the settop box!

The tutorial basically shows how I configured my system and does not claim to be the only or most elegant solution. It still is your own risk to follow my example. The tutorial covers different aspects, which may or may not be relevant for your own setup. The provided link literature should in any case point you towards the right directions for problem solving. You should definitely check it if some of my comments are not so clear to you.

Mythbuntu Installation

For the operating system, I now use Mythbuntu 11.10 (get it here). Mythbuntu gives you the advantage of installing a lightweight Mythtv installation right away – lightweight because it is using Xfce instead of Gnome.

The basic installation of Mythbuntu is easy. The only thing which requires your brain is the partitioning. Since 1 hour of recorded video is approximately 1.3 gigabyte you should have enough space. My filesystem consists of a 10gb system partition on / (ext4), 1gb swap space, the rest (ext4) for /home. The larger harddrive sdb1 250gb is mounted at /home/mythtv and also formatted to ext4. This is the place where I want Mythtv to store its recordings.

During the installation of Mythbuntu the basic settings for Mythtv are configured. Choose primary backend with frontend when asked. You may already enable the propietary driver for your graphics card if available. Most parameter can be defined later on in the Control Center, so I suggest skipping them for the moment.

For best results connect your PC to the TV using a HDMI cable. check if your display is configured correctly. I needed to change my resolution manually to 1920×1080 using Nvidias system tool by choosing the correct resolution and writing it to the X Conf File. Additionally, make sure you installed all system updates. This may take some time…

Existing Ubuntu installation

For a standard Ubuntu installation I recommend to use the Mythbuntu Control Centre, which makes the various options easily accessible. Install the package mythbuntu-control-centre by opening a terminal and running sudo apt-get install mythbuntu-control-centre.

Watching A1 TV with VLC

First of all, you should check if you can watch A1 TV with your machine. Connect it to the router via LAN cable, download this file and try to open it with vlc. It takes some time until the stream opens! if you can watch TV this way we can move on.

A static IP will make your life easier, because your mythbox can always reached with the same address in the network.

  • right-click on your network manager in the top bar.
  • choose Edit Connections
  • select the Wired connection and press Edit
  • under iPv4 Settings choose method Manual and enter the following data:
    • Address:
    • Netmask:
    • Gateway:
    • DNS Servers:
  • finish it off with save. Your machine is now known as in your network.


Before we start with configuring Mythtv, two more items need to be dealt with. First, a channel list for A1 TV programs is required – here is mine (alternative with HD channels by Hannes). Customize it to your needs. For explanation, the @ sign is not needed for mythtv but for vlc. In addition, the XMLTVIDs I use in my file are only relevant for people who want to use the xmltv grabber for the Electronic Program Guide.

Second, it is a good idea to create directories, where Mythtv stores its recordings. Create the directories on a larger partition: one directory for livetv and one for recordings. In my case I created /home/mythtv/livetv & /home/mythtv/recordings.

sudo mkdir /home/mythtv/livetv; sudo mkdir /home/mythtv/recordings

Please keep in mind that the Mythtv Backend is run by the user mythtv and not by your own user account. As a result, the user mythtv needs read and write permissions for these directories:

sudo chown -R mythtv /home/mythtv/livetv; sudo chgrp -R mythtv /home/mythtv/livetv;
sudo chown -R mythtv /home/mythtv/recordings; sudo chgrp -R mythtv /home/mythtv/recordings
sudo chmod 775 /home/mythtv/recordings; sudo chmod 775 /home/mythtv/livetv

Adjust the path and the user to your situation! The result should be owner and group: mythtv, allowed to create and delete files.

MythTV Setup

  • Start the Mythtv Backend Setup under System


  • change both IP addresses, to the one defined previously – in my example this

aontv_backend02 aontv_backend03

Capture Cards

  • create a new capture card, choose Network Recorder as card type and provide the path to the .m3u (you can use mine or the one provided by Hannes which includes HD channels as well If you have the .m3u file on your PC, point to it in the form of

  • increase the Tuning Timeout to about 1300. The rest is ok.


Video Sources

create a new Video Source, name the source “A1TV” (you can be creative here), but select no grabber for the moment.


Input Connections

  • choose the Video source to the just created A1 TV, select Scan for channels, confirm the already given path to the .m3u, the channels are now written to the database. Nothing can be seen and the progress bar remains at 0 percent but it works. Check if you find the channels in the Channel Editor.
  • Also define a starting channel for LiveTV. The rest of the default configurations is fine.


Storage directory

  • under default, define the directory where Mythtv should store the recordings (e.g. /home/mythtv/recordings)
  • do the same for Livetv (e.g. /home/mythtv/livetv). Both directories must already exist and the permissions need to allow writing for mythtv
  • Close the Mythtv Backend Setup with Esc.
  • You can cancel the mythfilldatabase prompt now.

Test it

The time has arrived to test your new Media Center. Start the frontend and hit Watch Livetv! The first channel should show up after little delay. Test as well the mythweb plugin by starting your browser and directing it to this link: http://localhost/mythweb (remote machines use the Backend’s IP instead of localhost, e.g. Why not start your first test recording? Go to mythweb and schedule a recording for a certain channel in the near future… leave your mythbox running… and then check if the recording worked. It did? Perfect!

Connect other frontends

  • In Ubuntu install the Fronted with the package mythtv-frontend.
  • You will be informed that your user needs to be added to the mythtv group when starting the frontend for the first time; confirm the dialog; log out and log in again.
  • For connecting remote frontends to your primary backend, you need to know the MySQL password. The easiest way to find this password is to look in the backend setup under General on the first page. Additionally, the IP address is required. We already configured the IP of the backend to be reachable via LAN in Mythtv. The IP was in my example. The details need to be included in the the remote computer’s frontend.


If you cannot connect to a remote backend, then its MySQL installation is most likely not configured for remote connections. To change this:

  • open a terminal and run sudo gedit /etc/mysql/my.cnf
  • in this file, comment (which means add a # sign at the beginning of this line)

    # bind address =
  • and then restart mysql with sudo /etc/init.d/mysql restart

Electronic Program Guide

commercial alternative:

The EPG used by the Aontv settop boxes is at the moment not to accessible by Mythtv – so we need to improvise. offers legal EPG data for an annual charge of 18 Euro. The service is quite comfortable and the configuration is easy with MythTV. However, note that not all TV channels of A1 TV are provided by both grabbers featured here (e.g. Puls 4).

  • get your own contract here
  • open your MythTV Backend Setup and go to Video Sources
  • create a new Video Source named A1TV, if not already done
  • choose Parts of Europe (commmercial)
  • press configure
  • insert the pin you received after your registration at epgdata
  • insert time zone – local should be fine
  • you can select each channel you need EPG data for… or you can save some time by entering all
  • after the configuration is over, go to the next chapter, called input connections
  • there you have to link the recording device with the newly created video source
  • close the backend and let mythfilldatabase run


  • the step of configuring the grabber in mythtv seems kind of broken, so I ran the command tv_grab_eu_epgdata –configure and copied the file from /home/stefan/.xmltv/tv_grab_eu_epgdata.conf to /home/.mythtv/A1TV.xmltv and made it executable
  • another day I needed to rename the configuration file ~/.mythtv/.xmltv to ~/.mythtv/A1TV.xmltv and change the permission so the usermythtv is able to open the file
  • it takes quite some time until all the data is written to the database… but if successful you should see the data here http://localhost/mythweb/tv/list.

free alternative: TV Movie Grabber

Another (cheaper) workaround is the usage of a free xmltv grabber, I tried: the TV Movie grabber. First of all, install some packages needed for using xmltv and compiling the grabber:

  • open a terminal and run

    sudo apt-get install xmltv build-essential checkinstall libxml2-utils unzip
  • visit the site and download the grabber, an archive named something like tvmovie-xmltv-1.2.tar.gz
  • move into the directory of the downloaded grabber and extract it with the command:

    tar xzf tvmovie-xmltv-1.2.tar.gz
  • move into the newly created directory and look out for the file tables.cpp

In the tables.cpp, the channels for the grabber are defined. The easiest way is simply to replace the file with this one or the one provided by Hannes including Servus TV and Puls 4

Alternatively, you can configure the grabber’s channel list yourself. Each channel needs to be configured with an XMLTVID in the grabber and in the mythtv database. What we want to achieve is that the XMLTVIDs of the grabber match the XMLTVIDs of Mythtv, so the right program information can be linked to the right channel. In the file tables.cpp the XMLTVIDs of the grabber can be included. It is easy to edit the file with a standard text editor. Look at the already configured entries in the file and start to make your own; remove the entry NULL and insert your XMLTVID instead, e.g.

{ "Arte", NULL, "" , "010" }
{ "Arte", "", "" , "010" }

Of course, only the channels provided by A1 TV should get an XMLTVID (so remove unnecessary entries).

On the Mythtv side, XMLTVIDs can be entered and changed in the Channel Editor of the Backend. Following the above example, the XMLTVID for the channel Arte becomes XMLTVIDs may already be set in the .m3u file for Mythtv. If you used my .m3u file you can also use my tables.cpp, as the entries are already made and match those of my m3u file.

Once you replaced the tables.cpp, open a terminal, move into the newly extracted directory and compile the grabber by running (English howtoGerman howto):

  • ./configure
  • make
  • sudo checkinstall
  • confirm the first question with y
  • type in a description for the installed grabber, e.g. “grabber for mythtv” or “mythtv’s grabber” or “grabber” or “xmltv grabber” or you come up with a good idea yourself
  • and confirm the suggested package values.

Now, the grabber is compiled and installed. Next, start the Mythtv Backend Setup and select Video Sources:

  • choose the TV Movie clickfinder grabber (xmltv) as grabber


  • select Configure
  • you will be asked if a specific channel should be included, you can safely type all and press Enter here, in order to include all configured channels at once.
  • close the mythbackend and let mythfilldatabase be run when you are asked for it (or run mythfilldatabase yourself in a terminal) – This command loads the program information to the Mythtv database.

Open a browser and surf to your web frontend. Click on Listings. If you see the names of lots of TV shows for the different channels, you did it!

automatically receive EPG data

For downloading EPG data automatically, enable the Automatic Program Guide data option in the backend General. I changed themythfilldatabase Program command to mythfilldatabase from usr/bin/mythfilldatabase. You may also disable the Run mythfilldatabase at time suggested by the grabber and define the time and frequency the grabber should run. You can pass additional arguments like

 -- --days 14

for getting the program guide for the next 14 days. (It used to be the option –max-days 14 which stopped working for me in 0.25.)

If the times of the TV show listings are not displayed correctly: open the backend setup, select General and change your local time zone to auto(or configure the hours manually if that doesn’t work).

  • for letting the user mythtv run mythfilldatabase automatically, i had to copy the A1TV.xmltv file from my user to /home/mythtv/.mythtv and change the owner to user mythtv.



Problems & Troubleshooting

  • In Mythbuntu in contrast to Ubuntu I needed to install the packages libxml2-utils and unzip manually, see here.
  • Some warning message about: mythfilldatabase –manual – your grabber does not provide channel numbers, so you have to set them manually was not relevant for me – I simply ignored it.
  • If the compilation fails try to extract the archive again (after you backed up your customized table.cpp).

Some tweaks for Mythtv

(?? Samba+Mythbuntu /etc/samba/smb.conf – path videos in backend and frontend)

  • Mythvideo is a plugin I highly recommend, because you can use it to watch DVDs and play your media files. It is installed by default in Mythbuntu. All official plugins are available in the Mythbuntu Control Center. Some of my modifications:
    • I recommend setting up a separate directory for media files and configure the permissions similar to the livetv and recordings directory.
    • Install the libdvdcss2 codec for DVD playback in the Control Centre.
    • Then choose this directory as video directory for the mythvideo plugin (In the frontend: Utilities > Setup > Media Settings > Video Settings > General Settings).
    • For some movies to work, I needed to change the file type associations for .avi from the default command to Internal (Utilities >Setup > Media Settings > Video Settings > File Types)
    • You can also share the directory with Samba for making it available to other devices in your LAN. Right-click on the folder, thenSharing Options. Select all options for sharing the directory to everybody on the LAN.
  • Change the default theme to something prettier. Other themes are easily installable via the Mythbuntu Control Center. Then, choose your favorite in the frontend: Utilities > Setup > Appearence. It may be worth to set also the font size and the date format in this category. Also check the OSD theme and the default font size under Utilities > Setup > TV Settings > Playback OSD.
  • Configure the time to record before and past a scheduled recording under Utilities > Setup > TV Settings > General.
  • You can skip the CPU intensive commercial detection for those channels not broadcasting commercials during shows. Set those channels as commercial free in the backend under Channel Editor. – or simply disable the commflag job (where??).
  • Define how much space should be left free by mythtv under Utilities > Setup > TV Settings > General.
  • “Confirm Exit” is something I don’t like, easily to disable in Utilities > Setup > General.

Wake On Lan

You probably don’t want to stand up from your convenient couch and start your mythbox by using your own hands – how oldschool! After a few modifications, you are able to start your PC via network (English howtoGerman howto).

  • Check your bios for Wake-On-Lan features. You may have to enable this function in the Bios first.
  • On the mythbox, install the package ethtoolsudo apt-get install ethtool
  • with

     sudo ethtool eth0

    you can see how the options are currently set. (replace eth0 with your network interface)

  • look out for supports wake-on and wake-on (see

    man ethtool

    for details)

  • with

    sudo ethtool -s eth0 wol g

    you can activate to listen to magic packets

  • if this setting does not survive the next reboot, look archive
  • test wake on lan with the wakeonlan package on another machine on the same LAN.
  • the wakeup command is

     wakeonlan 00:0c:6e:34:0f:08

    (use ifconfig to find out your MAC address)


  • insert the line

    ethtool -s eth0 wol g

    in /etc/rc.local between # By default this script does nothing. and exit 0 – while eth0 being the card reachable in the LAN!

  • Additionally, open the file /etc/init.d/halt and change the entry NETDOWN=yes to NETDOWN=no

Programmed Wake-Up – ACPI Wakeup

One of the first things I deselect is to automatically launch the frontend after reboot – this is not nice if your system is supposed to shutdown automatically.

One of the disadvantages of the mythbox is that it must be running for recording. A 24/7 server is neither environmentally friendly nor economically friendly and it is not necessary. You can configure your mythbox to wake up just a few minutes before a recording is scheduled. Your motherboard has to support this feature, but hardly any modern motherboards is not capable of waking up by alarm. For boards manufactured after 2000 the wakeup at a specific time and date should work. Furthermore, the mythbox can be configured to automatically shutdown, if it has nothing to do – how nice!

See those links for further information on ACPI wakeup: – good article but outdated method: /proc/acpi/alarm

the new way

  • check your bios settings, if you find some rtc alarmwakeup alarm, sth similar
  • grep -i rtc /var/log/kern.log

    should give you some insights

  • test your wakeup settings by setting an alarm five minutes in the future by running:
sudo sh -c "echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm"
  • check the times written with
cat /proc/driver/rtc
  • shutdown you system and see if it works

If the test was successful you can write the settings to the mythtv backend. (under General)

  • Wakeup time format: time_t
  • Command to set Wakeup Time: sudo sh -c ”/usr/bin/ $time”
  • now we compose the wakup script and save it as /usr/bin/
#$1 is the first argument to the script. It is the time in seconds since 1970
#this is defined in mythtv-setup with the time_t argument

echo 0 > /sys/class/rtc/rtc0/wakealarm      #this clears your alarm.
echo $1 > /sys/class/rtc/rtc0/wakealarm     #this writes your alarm
  • make the script executable
sudo chmod +x /usr/bin/
  • for shutdown permissions of the user mythtv, run
sudo visudo

and put this line right at the end of the file:

%mythtv ALL = NOPASSWD: /sbin/shutdown, /bin/sh, /usr/bin/

the information is taken from, there are some more details on how to get the stuff working. these settings did the job for me.

the old way

My older system (asus p4pe) worked with the old method of NVRAM is supported (more info here and here):

  • Install the package nvram-wakeup
  • Run the command sudo nvram-wakeup -D and see if the motherboard is recognized – For the possible problem with /dev/nvram: nvramshould be enlisted in the /etc/modules file followed by a restart.
  • take a look at the BIOS settings. The wakeup alarm in my BIOS must be changed for a date (other boards may need to have the alarm being disabled – try different settings and test what works for you)

Check, if it works by setting the wakeup time to 10 minutes in the future :

/usr/sbin/nvram-wakeup -s $((`date +%s` + 10 * 60))

If you have troubles with permissions for /dev/mem then you probably need to use sudo.

So far so good. If the wakeup command requires administration rights, the mythtv user must be equipped with some special rights.

  • run sudo visudo in a terminal
  • add the following string

    %mythtv ALL = NOPASSWD: /sbin/halt, /usr/sbin/nvram-wakeup

    to the very last line of the file. These are the commands for shutting down and for setting the wakeup alarm for the mythtv user. While editing the file make sure there is just one entry of mythtv (reference). Here is a sample:

# /etc/sudoers
# This file MUST be edited with the 'visudo' command as root.
# See the man page for details on how to write a sudoers file.

Defaults        env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
%mythtv ALL = NOPASSWD: /sbin/halt, /usr/sbin/nvram-wakeup

It’s now time to configure Mythtv under Utilities > Setup > General.

  • I always deselect the Block shutdown before….
  • Set a time for the seconds of idle time before the system is automatically brought down – 600 seconds for me
  • Configure the time for the system to wait for the next scheduled recording and how many minutes before the recording the alarm is set. You can leave the default values
  • The wakeup time format is time_t for the nvram method and the command to set wakeup time is sudo /usr/sbin/nvram-wakeup -s $(($time +300)).
  • The server halt command is a simple sudo shutdown -h now.

In any case, take a look at the provided screenshot and read the explanations for the available options in Mythtv.


Prevent shutdown during ssh connection

  • create the file /usr/bin/mythshutdowncheck
  • this code checks if a user is connected via ssh or if xbmc is running:
# MythShutdownCheck
# checks to see if any other user is
# logged in before idle shutdown
# returns "1" if yes, stopping shutdown
# returns "0" if ok to shutdown

# xbmc
# ps aux | grep xbmc | grep -v -c grep

# to not shutdown during mythcommflag process, uncomment the following line
# ps ax | grep -v grep | grep -q mythcommflag && exit 1

# mpd plays a song?
song=$(mpc current)
# echo "$song"

if last | head | grep -q "pts/.*still logged in"   # check for active *remote* login?
#	echo "user logged in via ssh"
	exit 1
elif ps aux | grep xbmc | grep -v -c grep
#	echo "xbmc is running"
	exit 1
elif [ -n "$song" ]
# echo "mpd is playing"
        exit 1
#	echo "mpd is not playing, xbmc is not running and no user is logged in"
	exit 0

the basis for this code originates from: I modified it to check as well if mpd is playing a song and if xbmc is running.

  • make the script executable

     sudo chmod +x /usr/bin/mythshutdowncheck
  • adapt the permissions with

    sudo visudo

    and add the command /usr/bin/mythshutdowncheck to the already added line.

  • in the mythtv backend, add the pre-shutdown command /usr/bin/mythshutdowncheck

Remote Control via Lirc

What is missing for a true media center is a remote control. I recommend buying your own on the internet, but be sure to check for its compatibility with linux i.e lirc. I’ve bought a USB remote control for one of Microsoft’s Media Center software, which I highly recommend ( English lirc howto German lirc howto.

In my case the configuration was easy using the Mythbuntu Control Centre. Under Infrared Devices select the configuration files for your remote; mine Windows Media Center remotes.

Customize the remote buttons to your hands. First, you must find out how the remote’s buttons are recognized by your system. This information is found in the file /etc/lirc/lircd.conf. It is possible that this file only holds links to other configuration files of remotes, which you should read instead! In those .conf files a name is allocated to each button’s infrared code, e.g.

      begin codes
          input                    0xD02F
          energy_saving            0xA956
          power                    0x10EF
          tvradio                  0x0FF0
          av_mode                  0x0CF3
          one                      0x8877

Similarly, in the ~/.lircrc file the buttons’ names are allocated to actions or again links are provided to the actual files (e.g. the .lirc directory). In essence, the .lircrc defines what happens when a certain button is pressed. Each program may have its own file, per default mythtv’s lirc commands are set in ~/.lirc/mythtv. Have a look at mine. As you can see, important variables are the name of the remote, the program the command is executed in, the button pressed and the action to execute. Just follow the example and use the keybindings of Mythtv for your own customized remote.

These keypresses are only active if mythfronted is running. If you want to start the program with the remote, you can use the irexec program, which simply executes commands on keypresses.

  • Open the file .lircrc in your home directory
  • Copy these lines beneath the other entries
  • Configure the button and the remote you want to use.
  remote = mceusb
  prog = irexec
  button = KEY_HOME
  config = mythfrontend &

The & sign is necessary to make irexec available during Mythtv.

If irexec does not start automatically, you can initiate the daemon at startup by running irexec -d (list it under Applications > Settings > Session and Startup in Mythbuntu and under Application Autostart with the command irexec -d).

IR Transmitter

You have external devices like your TV or an amplifier you want to control with your mythbox’s remote? With the necessary hardware (IR eye, transmitter), you can pass on custom IR commands to these devices. Just plug in your IR eye and point it to the IR receiver of your device in short distance.

  • You need a .conf file which holds the button codes of the external device’s remote. Either you look for it here or here or you make it yourself with irrecord.
  • Choose the transmitter driver, again in the Mythbuntu Control Center. Mine is the Microsoft Windows Media Center V2. Now, the lirc device should be correctly set in the /etc/lirc/hardware.conf file.
  • Include your remote .conf file in etc/lirc/lircd.conf (but change the path and filename).
include "/usr/share/lirc/remotes/custom/custom.conf"
  • check if it is working:
    • restart lirc by

      sudo /etc/init.d/lirc restart

      and start irexec again by running

      irexec -d

      (if it isn’t already running)

    • Then send a command to your device by executing (reference):

      irsend SET_TRANSMITTERS 1
      irsend SEND_ONCE RM-S325 vol+

      adjust the number of the transmitter, the name of the remote (here: RM-S325) and the name of the button (here vol+). You should now see some reaction of the device.

  • Make a script out of these commands. This may look like this:
irsend SEND_ONCE RM-S325 vol+
  • Don’t forget to make each scripts executable.
  • and finally link the script to a button of your remote in ~/.lircrc using irexec
    remote = mceusb
    prog = irexec
    button = VolUp
    config = /home/stefan/Desktop/
    repeat = 0
    delay = 0
  • That’s it. After restarting lirc and irexec, check if your keypresses are transmitted correctly.


watch TV on your PC, old firmware

For setting up an Internet and an IPTV connection, I use 2 network cards. Other scenarios with different router firmwares are possible. Since only the firmware for the Thomson Speedtouch 585v7 was running flawlessly for me, I chose to buy a network PCI card for less than 10€. If you have a newer firmware you do not need the second network interface! However, please note that Aontv currently only allows two IPTV streams, and only if you own two settop boxes. You can watch a show with one settop box and record another program with your mythbox.

You can find out if you are able to watch IPTV and Internet with the same connection by trying to open this .m3u playlist with VLC. It often takes some time until the picture comes up, so don’t be too impatient. If you don’t see anything you should proceed with the method outlined below or maybe update the router’s firmware further reading.

The plan is to have one card accessing the Internet while the second card uses the IPTV stream. As a consequence, the different areas for each card need to be defined, i.e. by creating static routes. Additionally, the two cards need to get static IPs for being identifiable. So let’s start:

  • Install the second network card. But do not yet connect it to the router tutorial.
  • Make sure that in the first step only the card for the internet connection is hooked up to the router. (Be aware that the TG585v7 is preconfigured with the ports 1&2 providing Internet and the ports 3&4 Aontv respectively. So choose one of the first ports!)
  • Check your internet connection, which should already be configured automatically after plugging in the cable.
  • Open the terminal and run ifconfig. Your output should be similar to this one:
stefan@earl:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:24:01:31:71:8b  
          inet addr:  Bcast:  Mask:
eth1      Link encap:Ethernet  HWaddr 00:0c:6e:34:0f:08  
  • You will see that only one card is up and running – the one which was given an IP by the router. Note the card’s name In my example above that’s eth0 with the IP
  • Right click on the network symbol on the upper panel and choose edit connections
  • Double click on Auto ethX (the network interface) we just identified. You can also compare the mac address to see if it is the correct interface.
  • Change the Connection name to something like static_internet,
  • Go to IPv4 Settings
  • Choose Manual as Method – for setting a static IP.
  • Click Add and fill in the following values manually: IP: Masq:; Gateway (default for the aon router); DNS Server is the same: and click ok
  • The connection is now quit and reestablished – confirm that the configuration is working by checking the internet. You now have a static IP address for this network interface – – you may need to physically disconnect and reconnect the network cable, if it is not working!
  • Now, connect the second network card with the Aontv ports of the router (3, 4)
  • Again: right-click on the network symbol > Edit Connections > choose auto eth1 (the second device, you may rename to static_aontv) >IPv4 Settings > Method: Manual > Add and fill in the following values for the second card: IP: Masq; Gateway0.0.0.0 (is only needed to silence the system), no dns is needed
  • Click on routes
  • Add a first entry: IP: and a second entry with IP:, confirm with ok, then apply
  • That’s it. Install vlc if necessary (e.g. sudo apt-get install vlc) and try the following .m3u playlist with it. The channels should show up after some time. Check also if the internet is working while watching TV. The final test is a restart… just to make sure! – Congratulations!


  • Please note that you should not allocate the same IP to 2 different interfaces in one LAN. If you want to watch Aontv on another computer as well, use another IP of the same network instead, e.g!
  • Make sure the settop boxes are not running! Keep in mind: maximally 2 streams can be watched simultaneously.

Links – osalliance – where I learned about mythtv+aontv – net culture lab wiki – valuable infos – fantastic site for aon and aontv related topics – windows solution for static routes of aontv and internet – aontv wiki, check out the forum


Custom Launcher for Unity

I wanted to create a custom launcher for ubuntu unity oneiric, in order to start my own shell script HORST. I learned it from here:

  • create a new document named HORST
  • open it with gedit and fill it with
[Desktop Entry]
Name=My Server
Comment=Login to my server
Exec=gnome-terminal --disable-factory --sm-client-disable --class=HORST -e "sh /home/stefan/Documents/Linux\ Scripts/"
  • rename the file to HORST.desktop
  • drag it to the launcher bar
  • that’s it

Connecting to the FTP server of the university of Vienna in Ubuntu (9.10)

  • In your Main Menu, go to Places → Connect to Server
  • As Service type choose FTP (with login)
  • Server:
  • User Name: a<your matriculation number>

If you want you can create a bookmark, which keeps the settings and creates a direct link to you FTPserver:

  • check Add bookmark
  • give it a name to remember, for instance: “FTP Uni Wien” (what a nice name!)

Then hit Connect and enter your unet password in the new window. For convenience you probably want to save it right away.

That’s it, now you can conveniently browse and edit your directories.