Installing maildrop on CentOS 5

I have been in the process of migrating my websites from a couple of dedicated machines to a VPS (Virtual Private Server) which has a fairly minimal base install of CentOS 5 on it. My existing mailserver runs on Gentoo Linux, running Postfix, courier-imap, maildrop, Spamassassin and ClamAV, with the mail accounts and aliases handled …

Read more

New_Face failed error when using Mplayer

After upgrading from openSUSE 10.2 to openSUSE 10.3 I got the error message New_Face failed. Maybe the font path is wrong. Please supply the text font file (~/.mplayer/subfont.ttf) when starting up MPlayer to watch video files. MPlayer would run fine and show the video and play sound ok, but the on screen display would fail to display anything; the subfont.ttf it was trying to find is what was used for the on screen display.

New_Face failed. Maybe the font path is wrong.

The error message that was displayed when starting up MPlayer.

no on screen display

No on screen display text showing.

I can only guess that the compiled in settings for MPlayer had changed with this version on openSUSE, or it had done something to the configuration files or font files during the upgrade which caused this issue.

After a quick search for the above error, and then some messing around with font and configuration files, I managed to work out that MPlayer checks a number of locations to determine which font to use, in the following preference order:

  • user defined configuration file: ~/.mplayer/config
  • common system configuration file: /etc/mplayer/mplayer.conf
  • user defined font file, or symbolic link: ~/.mplayer/subfont.ttf
  • system defined font file, or symbolic link: /usr/share/mplayer/subfont.ttf

The exact location of the system configuration files will vary depending on your Linux distribution; for example /usr/share/mplayer above may instead be at /usr/local/share/mplayer. Doing locate mplayer.conf and locate share/mplayer from the command line should help you to find them.

To find the TTF fonts on your system, do locate .ttf and you’ll be returned with a list of files found that have .ttf in them, similar to the following extract:

/usr/share/fonts/truetype/albw.ttf
 /usr/share/fonts/truetype/albwb.ttf
 /usr/share/fonts/truetype/albwbi.ttf
 /usr/share/fonts/truetype/albwi.ttf
 /usr/share/fonts/truetype/andalemo.ttf
 /usr/share/fonts/truetype/andybol_.ttf
 /usr/share/fonts/truetype/andyreg_.ttf
 /usr/share/fonts/truetype/ansbi___.ttf
 /usr/share/fonts/truetype/ansb____.ttf
 /usr/share/fonts/truetype/ansi____.ttf
 /usr/share/fonts/truetype/ans_____.ttf
 /usr/share/fonts/truetype/arblwgl.ttf
 /usr/share/fonts/truetype/arial.ttf
 /usr/share/fonts/truetype/arialbd.ttf
 /usr/share/fonts/truetype/arialbi.ttf
 /usr/share/fonts/truetype/ariali.ttf
 /usr/share/fonts/truetype/ariblk.ttf
 

It’s then just a matter of selecting which font to use, and adding the following line(s) to the appropriate configuration file:


font=/usr/share/fonts/truetype/arial.ttf
subfont-text-scale=2.5

Note that’s it’s possible to change the size of the font in the on screen display using the “subfont-text-scale” property as show in the above example.

If you instead prefer to use a symbolic link to the TTF file, although I would recommend you use the configuration files instead as you then also have control over the font size, you would do this, substituting the correct paths:


ln -s /usr/share/fonts/truetype/arial.ttf ~/.mplayer/subfont.ttf
OR
sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/mplayer/subfont.ttf

the problem is fixed

The problem is fixed and the on screen display text is now showing.

Please note: if you are using GMPlayer (the GUI version of MPlayer) then you don’t need to resort to editing text files or creating symbolic links. If you right-click the player and select “Preferences” and then select the “Font” tab, you can set the font and scale there.

Yum sqlite database disk image is malformed error

When trying to install something this morning using yum on a CentOS 5 machine, I got the error message “_sqlite.DatabaseError: database disk image is malformed” as shown below:

$ yum install vsftpd
 Loading "installonlyn" plugin
 Setting up Install Process
 Setting up repositories
 base100% |=========================| 1.1 kB00:00
 updates100% |=========================|951 B00:00
 centosplus100% |=========================|951 B00:00
 addons100% |=========================|951 B00:00
 extras100% |=========================| 1.1 kB00:00
 Reading repository metadata in from local files
 Traceback (most recent call last):
 File "/usr/bin/yum", line 29, in ?
 yummain.main(sys.argv[1:])
 File "/usr/share/yum-cli/yummain.py", line 94, in main
 result, resultmsgs = base.doCommands()
 File "/usr/share/yum-cli/cli.py", line 381, in doCommands
 return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
 File "/usr/share/yum-cli/yumcommands.py", line 134, in doCommand
 return base.installPkgs(extcmds)
 File "/usr/share/yum-cli/cli.py", line 539, in installPkgs
 self.doRepoSetup()
 File "/usr/share/yum-cli/cli.py", line 109, in doRepoSetup
 self.doSackSetup(thisrepo=thisrepo)
 File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 341, in doSackSetup
 self.pkgSack.excludeArchs(archlist)
 File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 331, in excludeArchs
 sack.excludeArchs(archlist)
 File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 587, in excludeArchs
 cur.execute(querystring)
 File "/usr/lib/python2.4/site-packages/sqlite/main.py", line 244, in execute
 self.rs = self.con.db.execute(SQL)
 _sqlite.DatabaseError: database disk image is malformed

This is easy to fix by issuing the following command:

yum clean all

After running this I got the following message, and I was able to install software again using Yum:

Loading "installonlyn" plugin
Cleaning up Everything

This error could happen on any Linux distribution that uses Yum for package management, such as Red Hat Enterprise Linux, CentOS 5, Fedora and its derivatives.

Inadvertent upgrade from openSUSE 10.2 to openSUSE 10.3

I had installed openSUSE 10.2 on my primary desktop machine (which has a dual core 64 bit AMD processor) in December 2006, but there never seemed to be any updates available in the little Yast Online Update taskbar applet which is supposed to alert you to updates and security patches etc. I found this a …

Read more

Create RSA and DSA Keys for SSH

Private and public RSA keys can be generated on Unix based systems (such as Linux and FreeBSD) to provide greater security when logging into a server using SSH. The ssh-keygen command allows you to generate, manage and convert these authentication keys.