Liferea Trick #3: Use Feed Auto Discovery

Give a +1 if you found this post useful!

This is an easy one: Don't bother entering the exact feed URL when subscribing!

These days it is standard for websites to support feed auto discovery. Many blogs and websites actually do not add feed subscription icons and links anymore. The feed link is just included in the HTML markup and every aggregator can extract it. No need for you to look for it.

To make it even simpler combine with trick #2 and use drag&drop! On every websites whose feed you want to add just drag the favicon from the browser location bar into Liferea. Most browsers do interpret this as dragging the location. Do not even bother copying the URL.

Be lazy :-)

Liferea Trick #2: Drag and Drop URLs

Give a +1 if you found this post useful!

Maybe it is obvious, but you can of course use Drag&Drop to add feed subscriptions to Liferea.

You can drag

  • into the subscription list
  • onto the tray icon

and Liferea will create a new subscription.

You can also Drag&Drop any web sites URL and Liferea will try to auto-discover the feed URL from it.

Note that dragging URLs into the item browser pane or a browser tab will just launch the URL in the internal browser.

Liferea Trick #1: Middle Mouse Button Clicking

Give a +1 if you found this post useful!

For all the readers of this development blog I want to share same hidden usability things in Liferea. Today I want to start with using the 3rd mouse button.

Place Where To Use Middle Click

  1. Subscription List: Click on any subscription or folder to mark everything in the subscription or folder as read.
  2. Item List (on flag column): Click on the flag column to toggle the flag for an item without selecting it.
  3. Item Lists (except flag column): Click everwhere beside the flag column and you toggle the read status of the item even without selecting it.
  4. Browser View: In any browser view, be it a browser tab or the item view pane middle click any link to open it in a new browser tab within Liferea.

How To Debug PgBouncer

When you use Postgres with pgbouncer when you have database problems you want to have a look at pgbouncer too. To inspect pgbouncer operation ensure to add at least one user you defined in the user credentials file (e.g. on Debian per-default /etc/pgbouncer/userlist.txt) to the "stats_users" key in pgbouncer.ini:

stats_users = myuser

Now reload pgbouner and use this user "myuser" to connect to pgbouncer with psql by requesting the special "pgbouncer" database:

psql -p 6432 -U myuser -W pgbouncer

At the psql prompt list the supported pgbouncer commands with


PgBouncer will present all statistics and configuration options:

pgbouncer=# SHOW HELP;
NOTICE:  Console usage
	SET key = arg

The "SHOW" commands are all self-explanatory. Very useful are the "SUSPEND" and "RESUME" commands when you use pools.

Liferea 1.10.2 Released

This is a bugfix release fixing tray icon minimizing. It also adds seeking to the media player. Please upgrade.

The Changes:

* Patch SF #222: Make media player seekable
  (Simon Kågedal Reimer)
* Fixes SF #1102: Spelling error in man page
  (David Smith)
* Fixes SF #1104: liferea.desktop missing keywords
  (David Smith)
* Fixes SF #1105: Start Minimized to Tray Does Not Work
  (reported by bitlord)
* Fixes SF #1114: Crashes opening browser on item without link via popup
  (reported by Rich Coe, David Smith)
* Improved handling of broken Atom author information.
  (Lars Windolf)
* Removed dead Google Reader code to avoid doing requests to Google.
  Replaced with dummy source that even allows normal feed updates.
  (Lars Windolf)
* Added hint to FAQ on how to workaround broken Flash support
  (Lars Windolf)
* Dumping feedlist.opml with indentation for readability.
  (suggested by Christoph Temmel and Simon Kågedal Reimer)

MySQL Dump Skip Event Table

If your MySQL backup tool or self-written script complains about an event table than you have run into an issue caused by newer MySQL versions (>5.5.30) that introduced a new table "events" in the internal schema.

If you run into this you need to decide wether you want to include or exclude the new events table when dumping your database.

To skip: Due to a MySQL bug #68376 you have two choices. You can check documentation and add the logical option


which will cause the event table not to be exported. But the warning won't go away. To also get rid of the warning you need to use this instead:


And of course you can also choose just to dump the events table: Add the option


to your "mysqldump" invocation. If you use a tool that invokes "mysqldump" indirectly check if the tool allows to inject additional parameters.

/etc/sudoers.d Pitfalls

From the sudoers manpage:

[...] sudo will read each file in /etc/sudoers.d, skipping file names 
that end in ~ or contain a . character to avoid causing problems with 
package manager or editor temporary/backup files. [...]

This mean if you have a Unix user like "lars.windolf" you do not want to create a file


The evil thing is neither sudo nor visudo warns you about the mistake and the rules just do not work. And if you have some other definition files with the same rule and just a file name without a dot you might wonder about your sanity :-)

How to Get Flash Working with WebkitGTK3

With the switch to GTK3 all Webkit using applications like Epiphany, Liferea, devhelp, yelp and others lost Flash support. The reason is that Linux-Flash is GTK2 only! And of course there won't be new releases from Adobe ever. So we have the following compatibility situation for Liferea

Uses Flash Status
GTK2 + WebkitGTK2 any native Flash Works
1.10 GTK3 + WebkitGTK3 v1.8 32bit native Flash Broken
1.10 GTK3 + WebkitGTK3 v1.8 64bit native Flash Broken
1.10 GTK3 + WebkitGTK3 v1.8 32bit Flash + nspluginwrapper Works
1.10 GTK3 + WebkitGTK3 v2.0 any native Flash Works

The WebkitGTK+ solution for the Flash problem was implemented in version 2.0 by having a second process linked against GTK2 to run browser plugins while Webkit itself is linked to GTK3. This makes Flash work again.

But the currently widely distributed WebkitGTK3 v1.8 does not have this feature yet and fails to use the native flash.

nspluginwrapper Workaround

The only workaround is to use nspluginwrapper to run the 32bit version of Flash. This is guaranteed to work on 64bit platforms. It might not work on 32bit hardware, sometimes also because nspluginwrapper is not available there. The steps to install it are:

  1. Install nspluginwrapper. On Debian
    apt-get install nspluginwrapper
  2. Download 32bit Flash .tar.gz from Adobe
  3. Extract /usr files according to the Adobe instructions
  4. In the tarball directory run
    nspluginwrapper -i -a -v -n

    to install the plugin

Now all WebkitGTK3 using applications should be able to run Flash. Ensure to restart them and check command line output for any plugin errors.

Upgrading to WebkitGTK3 2.0

If you can try upgrading to WebkitGTK3 2.0 (e.g. Debian Experimental).

PHP preg_match() Solutions for Typical Tasks

This post is to give an overview of when and how to use preg_match(). You will find that several task descriptions actually tell you not to use preg_match() which often is the first solution we think of when not knowing the PHP specific "best solution".

Extract date with preg_match

Format: DD.MM.YYYY

preg_match('/(?P<day>\d{2})\.(?P<month>\d{2})\.(?P<year>\d{4})/', $string, $result);

Format: MM/DD/YYYY

preg_match('/(?P<month>\d{2})\/(?P<day>\d{2})\/(?P<year>\d{4})/', $string, $result);

Format: YYYY-MM-DD

preg_match("/(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})/", $string, $result)

All three examples take the date to parse from $string return the day, month and year values in the $result hash. On successful matching $result will contain a result like:

array('year' => 2013, 'month' => 08, 'day' => 01);

Match IP with preg_match

To match an IPv4 address you can simply use:
preg_match("/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/", $string, $result);

But as explained on StackOverflow this won't work for IPv6 and there is a better solution:


And for IPv6


Match Hostname with preg_match

Again a solution from StackOverflow, note that you need to do several checks for characters, total length and part length. For perfect RFC compliance this is propably not enough, but still good enough to untaint a hostname string:

function is_valid_domain_name($domain_name)
    return (preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $domain_name) //valid chars check
            && preg_match("/^.{1,253}$/", $domain_name) //overall length check
            && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name)   ); //length of each label

Match Email Address with pgreg_match

First: Do not try to develop something yourself!. If you still think you can start reading this LinuxJournal article and the respective RFCs. This is of course more complex than the host name matching as an email address usually contains one.

The IMO most interesting solution in PHP is to use checkdnsrr() and was described by this devshed article. It boils down to

  1. Sanity checking characters
  2. Extracting host name
  3. Testing host name by MX record lookup with checkdnsrr()

So this solution even gives up one checking the hostname syntax by just resolving it. This solution of course only works if you do not have to do too many checks per second. This might not be a good solution for massive checking without having a DNS cache in place.

When you still want to do only syntax matching try to use the PHP filter

filter_var($email, FILTER_VALIDATE_EMAIL)

Match HTTP URL with preg_match

Another case of do not try. Use the PHP filter instead:

filter_var($url, FILTER_VALIDATE_URL)

Extract HTTP URL with preg_match

Another case of do not try. Use the PHP function parse_url() instead. The example from the PHP manual shows how:



and it returns an array with all the parts:

    [scheme] => http
    [host] => hostname
    [user] => username
    [pass] => password
    [path] => /path
    [query] => arg=value
    [fragment] => anchor
Syndicate content