Autostart mythtv (using restartscript)

mythbox:~$ sudo vim /usr/local/bin/

## Automatically restart mythfrontend if it fails.
## Loop the call of mythfrontend.

while [ /bin/true ]
        killall mythfrontend
        killall mythlogserver
        killall mythlcdserver
        mythfrontend -v playback >> /tmp/mythfrontend.log
sleep 2

mythbox:~$ sudo chmod 755 /usr/local/bin/

First enable Automatic login from the gnome Settings panel.
Schedule the script to start after login (using gnome)

mythbox:~$ vim .config/autostart/restartmythtv.desktop

[Desktop Entry]
GenericName=Restart mythfrontend
Comment=Restart mythtfrontend when it crashes

Restart the computer

Kodi and Mythtv

Note: this blog was previously written for XBOX media centre (XBMC). It has been replaced by Kodi since a long time. Please read kodi instead of xbmc below.

In 2010 I wrote:
I recently tried XBMC on one of my mytfrontends. I must say, I was impressed by the user interface.

To run xbmc besides mythfrontend I had to do some tweaking to this mythbuntu frontend. To install, first add these lines to /etc/apt/sources.list

deb jaunty main
deb-src jaunty main

Kodi can nowadays be found in the stable repository of Debian.

Continue reading

Mythtv – Adjust progress bar

# vim /usr/share/mythtv/themes/MythCenter-wide/osd.xml

Find “osd_status”

<window name=”osd_status”>
<fontdef name=”medium” face=”Droid Sans”>

And change:




Restart mythfrontend

The progress bar will show up on top of the screen. This will keep the subtitles visible when pausing and unpausing recordings.

View files within fog image

Recently I moved from Win 8.1 to W10. Unfortunately I forgot to save my office product key…..Happily I had an fog image of this machine.
Question, can one restore the files inside this container without using fog? (which restores it back to the original device)
YES you can.
First decompress the “fog” file and write it to a file in raw file:

# apt-get install partclone pigz
# cat d1p2.img | pigz -d -c | partclone.ntfs -C -r -s -O foo.img –restore_raw_file

  • d1p2.img = the original image
  • pigz = to decompress the image
  • partclone.ntfs = to restore the image to a ntfs partition type

Partclone v0.2.73
Starting to restore image (-) to device (foo.img)
Calculating bitmap… Please wait… done!
File system: NTFS
Device size: 109.2 GB = 26655231 Blocks
Space in use: 48.6 GB = 11859567 Blocks
Free Space: 60.6 GB = 14795664 Blocks
Block size: 4096 Byte
Elapsed: 00:00:04, Remaining: 00:09:40, Completed: 0.68%, 4.99GB/min,
current block: 90541, total block: 26655231, Complete: 0.34%
Complete 100%

Then mount foo.img with OSFmount
ext use the productkey viewer from Nirsoft to open the SOFTWARE registry hive.
(Note: The Nirsoft tool needs to be started with Admin rights)

Debian Jessie upgrade breaks Thunderbird connection to courier-imap-ssl

After upgrading of my e-mailbox running courier-imap-ssl, I discovered that connecting with Thunderbird just failed.

In /var/log/syslog:

imapd-ssl: couriertls: accept: error:14094417:SSL routines:SSL3_READ_BYTES:sslv3 alert illegal parameter

In Thunderbird, pressing CTRL+SHIFT+J shows the Thunderbird error console. It showed me information that something was wrong with some DH-parameter.

Following:, I generated a new keyfile using:

# export DH_BITS=2048 && mkdhparams

After generating a new “/etc/courier/dhparams.pem” and restarting courier-ssl by executing: /etc/init.d/courier-imap-ssl restart, I still could not connect with Thunderbird…

Then I discovered that in: /etc/courier/imapd-ssl, the parameter TLS_DHPARAMS could be set. I suspected that the pem-file for some reason could not be found by courier-imap-ssl. A bit strange of course, because it had never been a problem, until now.

So I added:


After restarting courier-imap-ssl once again I discovered that this addition indeed solved my problem.

For future convenience I changed the BITS value in /usr/sbin/mkdhparams


automatic security upgrade

Its purpose is to keep the computer current with the latest security (and other) updates automatically. If you plan to use it, you should have some means to monitor your systems, such as installing the apt-listchanges package and configuring it to send you emails about updates. And there is always /var/log/dpkg.log, or the files in /var/log/unattended-upgrades

To install these packages, run the following command as root:

apt-get install unattended-upgrades apt-listchanges

To activate unattended-upgrades, you need to ensure that the apt configuration stub /etc/apt/apt.conf.d/50auto-upgrades contains at least the following lines: 

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

This file can be created manually or by running the following command as root:

dpkg-reconfigure -plow unattended-upgrades

The default configuration file for the unattended-upgrades package is at /etc/apt/apt.conf.d/50unattended-upgrades. The defaults will work fine, but you should read it and make changes as needed.

  • # editor /etc/apt/apt.conf.d/50unattended-upgrades

This section controls which packages are upgraded:

  • Unattended-Upgrade::Origins-Pattern {
        // ...

You should at least uncomment the following line:

  • Unattended-Upgrade::Mail "root";

messed up locales

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “en_US.UTF-8”
are supported and installed on your system.


sudo dpkg-reconfigure locales

Choose: en_US.UTF-8
Then put:


in /etc/environment

Log off and log on again

Check and repair mysql database tables with myisamchk (and mysqlcheck)

Useful after systemcrash:

When Mysql is not running:

 myisamchk –silent –force –fast –update-state /var/lib/mysql/bugs/*.MYI

myisamchk –safe-recover –force –sort_buffer_size=2G –key_buffer_size=2G /var/lib/mysql/*/*.MYI

-s, –silent option: Prints only errors. You can use two -s to make myisamchk very silent.
-f, –force option: Restart myisamchk automatically with repair option -r, if there are any errors in the table.
-F, –fast option: Check only tables that haven’t been closed properly.
-U –update-state option: Marks tables as crashed, when it finds any error.

When Mysql is running (which is kind of slow)

mysqlcheck –repair –all-databases




3ware Raid Controller Switch of autoverify

To switch of the autoverify feature on a 3ware controller which can be a real performance killer do the following:

From the console, enter the 3ware cli and first check the current status

tw_cli /c0/u0 show autoverify

/c0/u0 Auto Verify Policy = on

As you can see the autoverify feature is on Auto Verify Policy = on. If your raid controller is also c0 and you unit is u0 you may use the following command. Please check this first with the command:

tw_cli /c0 show

Do not just copy and paste. If c0 doesn’t work try a higher number it depends on which pci slot your controller is in.

tw_cli /c0/u0 set autoverify=off

Setting Auto-Verify Policy on /c0/u0 to [off] … Done.

Check the autoverify settings:

tw_cli /c0/u0 show autoverify

/c0/u0 Auto Verify Policy = off

That’s it no more autoverify. Please make sure to check you raid status regularly to detect problems.