Friday, 28 December 2012

xbmcfreak installation

I have an ASRock Ion 330HT PC with a 32GB Corsair SSD which I'm using as a media server.

Installation of XBMCFreak LiveCD 10:

Download from http://www.xbmcfreak.nl/downloads-10series/ and burn to CD

Boot up, choose Install LiveCD and walk through the installation.

For partitioning the hard-drive I chose to use Guided - use entire disk. (I initially tried LVM but this failed - I didn't really bother to find out why)

The installation takes about 5 or 10 minutes; be patient with the blank blue screen that is displayed while it installs.

Post installation configuration:

Mount NAS on NFS:

add nas ip-address to /etc/hosts
$ 192.168.1.12 nas

create mount point in fs
$ sudo mkdir /mnt/raid

install nfs client
$ sudo apt-get install nfs-common portmap

mount nfs
$ sudo mount -o rw,async -t nfs4 nas:/mnt/raid /mnt/raid

make it premanent by adding mount command to /etc/fstab
$ nas:/mnt/raid /mnt/raid nfs4 rw,async




Sunday, 9 December 2012

Puppet - open source configuration management

http://puppetlabs.com

Open source job schedulers

Open source job scheduler

http://www.sos-berlin.com/modules/cjaycontent/index.php?id=62&page=osource_scheduler_introduction_en.htm

GNU Batch

http://www.gnu.org/software/gnubatch/

Thursday, 29 November 2012

Pattern recognition algorithms

Boost based Computer Vision and Pattern Recognition Library implements many useful algorithms such as Principal Component Analysis, Eigen solver, etc.

http://boostcvpr.sourceforge.net/

Saturday, 17 November 2012

windows/fedora dual boot - update grub2

After kernel updates the grub boot menu will include both the new kernel version and the previous kernel version.

Remove old kernels (keeping 2)


$ yum install yum-utils
$ package-cleanup --oldkernels --count=2



Update grub's boot menu


It's probably a good idea to make a backup of the old grub.cfg file

$ grub2-mkconfig -o /boot/grub2/grub.cfg

This will update the grub config used to load the boot menu.

You can customize the menu order by renaming the 10_* entries in /etc/grub.d/

Customize the boot order:

Find the menu entries:

$ grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2

Set the default menu entry:

$ grub2-set-default 'one-of-the-above-menu-entries'

Check to see if it worked:

$ grub2-editenv list

Sunday, 4 November 2012

gtest - google unit testing framework

Primer

http://code.google.com/p/googletest/wiki/Primer

Simple test case

#include <gtest/gtest.h>

TEST(TestSuite, TestCase1)
{
    ASSERT_TRUE(expr);
}

TEST(TestSuite, TestCase2)
{
    ASSERT_TRUE(expr);
}

Get the main function for free

Link gtest_main.cc and you get RUN_ALL_TESTS free

What to do if a test fails

Abort the test on expression failure:

    ASSERT_TRUE(expr);

Continue the test on expression failure:

    EXPECT_TRUE(expr);

Floating point comparison:

    ASSERT_FLOAT_EQ(val1, val2);
    ASSERT_DOUBLE_EQ(val1, val2);
    ASSERT_NEAR(val1, val2, epsilon);

    EXPECT_FLOAT_EQ(val1, val2);
    EXPECT_DOUBLE_EQ(val1, val2);
    EXPECT_NEAR(val1, val2, epsilon);

Command line options

Repeat tests (useful for finding subtle race conditions)

    --gtest_repeat=1000 

Enter the debugger upon test failure

    --gtest_break_on_failure

Generate an xml report "foobar.xml"

    --gtest_output="xml:foobar"

Only run some tests

    --gtest_filter=TestSuite* // runs all suites matching TestSuite*
    --gtest_filter=TestSuite*-*.*2 // runs all suites matching TestSuite* except cases ending in '2'
    --gtest_filter=Foo*:Bar* // separate different reg-ex's with ':'