NUC Banana

Adventures with XBMC (Kodi): Intel NUC

In my previous post, I briefly explained the process that I went through to use XBMC (now Kodi) on an old computer.

My old computer didn’t actually die, but I struggled with it for well over a year. It would fail, I’d jiggle the components and it would live on. The Logitech Z5500 control pod is what failed after 7 years of enjoyment. Ideally you want an A/V Receiver that supports HDMI pass-through. I replaced the old home theatre with an affordable Yamaha package, sporting an RX-V375 Receiver, NS-PB120 Speakers, and a YST-SW216 10″ Subwoofer.

The NUC that I chose is the D54250WYK. The most powerful model at the time with an i5 processor. Opening the box you are welcomed with the famous Intel tune, which is a cute gimmick. I’ve dropped in 8GB of Kingston RAM, Intel Wireless AC card and an Intel 30GB mSATA SSD. The last items required are a Cloverleaf (C5) power cable and a Mini-HDMI to HDMI 1.4a cable. These Intel NUC’s are smaller than you think, its an incredible device. It even has an on-board IR sensor.

Make it Work

Of course, the Operating System I’ll be using is OpenELEC. You can download the latest release here. I’ll run you through my forum findings as best I can.

With the BIOS version available at the time of this post. The device would restart instantly when it tried to suspend. I managed to get it working by disabling all settings in the Power options. I then set ‘Wake on LAN from S4/S5’ to ‘Power On – Normal Boot’, and enabled the ‘Deep S4/S5’ setting. With this configuration I am able to send the device into a low power state. I am then able to wake it using the IR sensor and my Harmony 700 Remote. Intel actually responded right after I posted in the long running thread about the issue. There is a beta BIOS that appears to address the bug. I will update when it goes stable.

Once you have installed OpenELEC, you might notice that your remote does not work. The IR driver is not enabled by default. You’ll want to edit the file from another computer on your network using SSH. What is SSH?

After figuring out SSH, enter the following command to edit the file.

nano /storage/.config/

Then add the following lines to the file to enable the driver.


modprobe -r nuvoton-cir
echo "auto" > "/sys/bus/acpi/devices/NTN0530:00/physical_node/resources"
modprobe nuvoton-cir

If you find that your colours are washed out and you have an RGB ‘Full Range’ display like mine, add this line while you are there.

xrandr --output HDMI1 --set "Broadcast RGB" "Full"

Ctrl+X to Save and Exit. Then run this final command for good measure.

chmod 755 /storage/.config/

Now reboot your NUC and check to see if the changes have worked. I am assuming you already have a Windows Media Center SE profile installed on your Harmony Remote, or equivalent device. The remote should now control Kodi, and colours should be deeper.

That’s about all you need to do right now to get the Intel NUC running with Kodi. The rest comes down to personal preference. I might write some posts about more customisations I like to make in the near future.

WordPress Logo

How to Improve FeedWordpress

FeedWordPress is the best free plugin to syndicate posts from WordPress RSS feeds. Syndication is not the best practice, but it suits the needs of a client and their site network.

However, there is some minor issues. There is no built in duplicate post detection. This can create a mess when syndicating multiple feeds that may contain the same posts. Also, a default category is not assigned to posts if there is no matching category on your site. Place the below filter in your themes functions.php file to correct these issues.

 * FeedWordPress - Detect duplicates and prepare the syndicated post.
 * @param array $post
 * @param SyndicatedPost $syndicatedpost
 * @return array|null
add_filter('syndicated_post', function (array $post, SyndicatedPost $syndicatedpost) {

    // --- Duplicate Detection

    if (!$syndicatedpost->fresh_content_is_update()) {
        global $wpdb;

        $duplicate_post = $wpdb->get_row($wpdb->prepare("
            SELECT ID FROM $wpdb->posts
            WHERE post_status = 'publish' AND post_type = 'post' AND post_title = %s
            AND ( post_date BETWEEN DATE_SUB( %s, INTERVAL 2 HOUR ) AND DATE_ADD( %s, INTERVAL 1 HOUR ) )
            LIMIT 1
        ", [
            $post[ 'post_title' ],
            $post[ 'post_date' ],
            $post[ 'post_date' ]

        // Is it a duplicate post?
        if (!empty($duplicate_post)) {
            return null;

    // --- Prepare Syndicated Post

    // Assign the default category when a post has no categories.
    // No idea why FeedWordPress doesn't do this by default.
    if (empty($post[ 'tax_input' ][ 'category' ])) {
        $post[ 'tax_input' ][ 'category' ][] = intval(get_option('default_category'));

    // Syndicated posts will include a 'read more' from the source site at the
    // end of their excerpts. Strip that out.
    $post[ 'post_excerpt' ] = preg_replace("/(&hellip;|&#8230;) <a href=.+<\/a>/", '', $post[ 'post_excerpt' ]);
    $post[ 'post_excerpt' ] = preg_replace("/\\[&hellip;\\]/", '', $post[ 'post_excerpt' ]);
    $post[ 'post_excerpt' ] = trim($post[ 'post_excerpt' ]);

    return $post;
}, 10, 2);

Lastly, we don’t want search engines to index these articles, they aren’t original content on our site. I also make use of Yoast WordPress SEO, we’ll use that to our advantage.

 * Yoast WordPress SEO - Hide Syndicated Posts, and Sign Up form from Search Engines.
 * @return void
add_action('template_redirect', function (): void {
    if (!function_exists('YoastSEO')) {

    $noindex = false;

    // Don't index Syndicated posts from FeedWordpress
    $is_syndicated = false;
    if (function_exists('is_syndicated')) {
        $is_syndicated = is_syndicated();

    if (is_single() && $is_syndicated) {
        $noindex = true;

    if ($noindex) {
        add_filter('wpseo_robots_array', [ YoastSEO()->helpers->robots, 'set_robots_no_index' ], 10, 2);
WordPress Logo

Add a Custom Login Logo to WordPress

Below is all you need to customise the login page of WordPress. Add it to the bottom of your functions.php.

 * Custom Login Logo for WordPress

add_filter( 'login_headerurl', 'tsg_login_headerurl' );
add_filter( 'login_headertext', 'tsg_login_headertext' );
add_filter( 'site_icon_image_sizes', 'tsg_site_icon_image_sizes' );
add_action( 'login_enqueue_scripts', 'tsg_login_enqueue_scripts' );

function tsg_login_headerurl()
    return get_bloginfo( 'url' );

function tsg_login_headertext()
    return get_bloginfo( 'name', 'display' );

function tsg_site_icon_image_sizes( $sizes )
    $sizes[] = 140;
    return $sizes;

function tsg_login_enqueue_scripts()
    <style type="text/css">
        body.login div#login h1 a {
            height: 140px;
            width: 320px;
            background-image: url(<?php echo get_site_icon_url( 140, get_bloginfo( 'template_url' ) . '/images/login-logo.png' ); ?>);
            background-size: contain;

There are plugins available that perform this task for you, but I don’t think it’s necessary to add a plugin just for this.

Transparent PNG format images work best.

Update 2017

I have upgraded this script to use the Site Icon. You just need to upload your image using Appearance > Customise > Site Identity.

Update 2019

WordPress deprecated ‘login_headertitle’ in favour of ‘login_headertext’.