06 January 2014

542. gnucash 2.6 on debian wheezy by compiling

Update 7/1/2014: Gnucash 2.6 is now in Jessie

Original post:
"Why would you want to compile gnucash yourself", you might ask. "Because version 2.6, which is currently in SID, allows you to attach files to transactions and that's the bee's knees", I might respond.

I use gnucash to manage my grants. Attaching purchase orders, receipts and invoices would be great. Well, now you can, but not in version 2.4 which is the one found in wheezy and jessie.
I've built so many things on my main desktop that I'm not sure about the exact requirements for gnucash. I've provided a list of packages that I suspect gnucash needs in this post, but it might not be exhaustive.

sudo apt-get install build-essential libglib2.0-dev libgtk2.0-dev guile-2.0-libs libgnomecanvas2-dev libgoffice-0.8-dev guile-2.0-dev libxml2-dev libxslt-dev swig libwebkit-dev libdbd-mysql libdbi-dev libofx-dev python-dev
mkdir ~/tmp/gnucash -p
cd ~/tmp/gnucash
wget http://downloads.sourceforge.net/sourceforge/gnucash/gnucash-2.6.0.tar.bz2
tar xvf gnucash-2.6.0.tar.bz2
cd gnucash-2.6.0/
Options detected/selected ------------------------- gnucash version ...... : 2.6.0 Build for host ....... : x86_64-unknown-linux-gnu Optional components... : dbi ofx Extra Warnings ....... : -Wdeclaration-after-statement CPPFLAGS ............. : CFLAGS ............... : -Wdeclaration-after-statement -g -O2 -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused LDFLAGS .............. : prefix................ : /usr/local
make sudo checkinstall --install=no
0 - Maintainer: [ root@beryllium ] 1 - Summary: [ gnucash 2.6.0 ] 2 - Name: [ gnucash ] 3 - Version: [ 1:2.6.0 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ gnucash-2.6.0 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ gnucash ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
sudo dpkg -i gnucash_2.6.0-1_amd64.deb

If you have issues with libgnc-gnome.so.0 missing, make sure that /usr/local/lib is in your ld.so.conf and do ldconfig to update.

Either way, you can now associate a file with a transaction by right-clicking.

It does, however, seem as if you can't actually SEE if a file is associated, which makes the feature pretty useless.

04 January 2014

541. Setting up mythtv on debian with leadtek 1000s (SAA7130)

I've been using me-tv (and occasionally kaffeine and vlc) to watch DVB-T on linux for the better part of two years. While it's working absolutely fine, and I really like me-tv, I'd like to get it to work in mythtv as well in the hope that it will support closed captioning.

Note that mythtv is only available via the deb-multimedia repo and not in the offical debian repos. I first tried to install mythtv that way, and while I got pretty far (scanned for channels etc.) I couldn't get a picture when trying to watch TV using mythtv-frontend. The deb-multimedia packages also screwed up my graphics card set-up somehow, which didn't improve my mood. So while that's probably a viable method, I finally decided to compile things myself. Note that if you do keep deb-multimedia enable and do a dist-upgrade the mythplugins package below will be replaced, and with that the main mythtv package as well, leading to all kinds of fun. You might want to give mythplugins a higher version number than I've done below to circumvent that.


sudo dpkg-reconfigure dash

Select 'No', so that /bin/sh/ points to bash instead of dash.

The next port of call was http://www.mythtv.org/wiki/User_Manual:Initial_Installation 

sudo apt-get install build-essential liblircclient-dev libasound2-dev libdts-dev libdvdnav-dev \
 libxv-dev libxxf86vm-dev transcode libmp3lame-dev subversion qt4-dev-tools libqt4-dev libsamplerate0 \
 libxvidcore4 liba52-0.7.4-dev libfame-dev libcdio-dev msttcorefonts libasound2-doc libmad0-dev \
 libid3tag0-dev libvorbis-dev libflac-dev libcdaudio-dev libcdparanoia0-dev fftw3-dev libfaad-dev \
 libsmpeg-dev libmp4v2-dev libtag1-dev mysql-server libvisual-0.4-dev libexif-dev libxvmc-dev \
 libxinerama-dev uuid-dev libicu-dev 
sudo apt-get install yasm checkinstall gdb python-mysqldb python-urlgrabber libnet-upnp-perl
mkdir ~/tmp/mythtv -p
cd ~/tmp/mythtv
git clone -b fixes/0.27 git://github.com/MythTV/mythtv.git
cd mythtv/mythtv/
./configure --enable-proc-opt
sudo checkinstall --fstrans=no --install=no
0 - Maintainer: [ andy@helium ] 1 - Summary: [ mythtv 0.27 ] 2 - Name: [ mythtv ] 3 - Version: [ 0.27 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ mythtv ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ mythtv ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
Exclude files that are in the home directory.

sudo dpkg -i mythtv_0.27-1_amd64.deb
cd ../mythplugins/
sudo apt-get install libmysql++-dev python-oauth libdate-manip-perl libxml-simple-perl libimage-size-perl libdatetime-format-iso8601-perl libsoap-lite-perl libjson-perl 
sudo checkinstall --fsmetrans=no --install=no
0 - Maintainer: [ root@helium ] 1 - Summary: [ mythplugins 0.27 ] 2 - Name: [ mythplugins ] 3 - Version: [ 0.27 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ mythplugins ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ mythplugins ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
sudo dpkg -i mythplugins_0.27-1_amd64.deb

Note that you may want to use a much higher version number for mythplugins than I've done above -- with 0.27 the deb-multimedia version of the package will take precendence, and cause all kinds of fun...

Setting up

sudo useradd mythtv
sudo usermod -a -G mythtv $USER
mkdir ~/.mythtv

Create a file called ~/.mythtv/mysql.txt:
where helium is my hostname.
Before you can run mythtv-setup you should prepare the mysql database.

mysql -u root -p
> show databases;
> create database mythconverg;zymichost.com
> create user 'mythtv'@'%' identified by 'mythtv';
> create user 'mythtv'@'localhost' identified by 'mythtv';
> set password for 'mythtv'@'%' = password('mythtv');
> set password for 'mythtv'@'localhost' = password('mythtv');
> connect mythconverg;
> grant all privileges on *.* to 'mythtv'@'%' with grant option;
> grant all privileges on *.* to 'mythtv'@'localhost' with grant option;
> flush privileges;
> exit;

Now run setup:

The first time I did this it asked about country and language, and then exited. I then ran it again and went through the setup as shown in the figures below. Note that I had to use the IP,, of my computer rather than (i.e. localhost).

I then ran

and let it run in a terminal, followed by

in another terminal. And it worked! I mean, not the first time, but by following the instructions above I actually got it to work -- up to a point. The audio wasn't working.

While TV is a visual medium it's still nice to have sound. So, in mythfrontend I went to Settings, Audio and picked Pulseaudio, since that's what I use by default anyway.

 I did have the occasional issue with sudden white noise, so I changed to ALSA, and all has been perfect ever since:

Test driving:
Everything seems to be working fine. Hit M for menu:
 You can choose subtitles (or just hit T):

To bring up the Electronic Program Guide (EPG) hit S:
See http://www.mythtv.org/wiki/Keybindings for a list of shortcuts.

Anyway, I'm still exploring. The one thing that's not working yet is the remote control, but that will be solved in due course.

Missing channels:
Mythtv didn't pick up channels Nine, Gem and Go. While scan found them without issue by doing 'scan /usr/share/dvb/dvb-t/au-Melbourne > channels.conf', I couldn't find an easy way to import the scan data.


Trying to import an existing scan in mythtv didn't allow me to provide a URL, but only showed two old scans pre-populating the import dialogue, which was both weird and annoying.

Instead the key was to add a new transport: fire up mythtv-setup, and go to the Channel editor. Note that I'm using a different skin/menu to the default one (Terra), but the process is the same.

See scan output above for the values to add here

 And you're pretty much done.

540. Briefly: prevent Youtube and Google from signing you in -- firefox version

The scenario: I've got a blogger account (i.e. this one) which is linked to my google account, and I'd like to be able to use youtube and google search without being considered as being logged in. If I log out in e.g. the google search page I also get logged out from blogger.  Gmail isn't an issue since I use thunderbird/evolution, but it would cause similar issue to blogger vs search/youtube.

The past year I've become increasingly annoyed by the behaviour of google applications -- they feel more intrusive and I keep on being asked to sign in and stay signed in. Without going into specifics, it's beginning to feel like Google is trying to turn the entire web into their version of Facebook. And I don't lie it.

Anyway, luckily there's a pretty simple way to stay signed out of Google search and youtube, even without using privacy mode -- by restricting the use of cookies.

Here's what you can do in Firefox:

1. Install the Cookies Manager+ add-on in firefox, and restart firefox
2. In firefox, go to Tools, Cookies Manager+
3. Click on Tools/Exceptions
4. Add google.com and youtube.com

Done. Now you can remain signed in to all other google sites, while staying signed out of Youtube and Google Search. Note that it doesn't make you  anonymous, but it just takes care of some of the minor nuisances associated with always being tracked by google.