04 January 2012

40. Getting started with GNUCash

I've both recently relocated and started my own research group, so keeping track of money has become important -- it's difficult to get an overview of your economy in the beginning in a new country, and you better keep track of your research grants because the University WIL screw it up.

As someone with nil background in finance getting to grips with GnuCash has taken some time.

I've got two databases -- one for my personal finances, and one for my grants. I'll only show how to set up a database for personal finances here.

For most of the steps there isn't much to say...
Choose the simplest type of account -- Checkbook.

You now have four main types of accounts: Assets, Equity, Expenses and Income. The assets accounts has a sub-account called  Checking Account.

Double-click on the Checking account, put the current amount of money in your account under Deposit, and select Equity:Opening Balance under Transfer.

You now have money to spend.

Time to customise the set-up. Create an new account -- select placeholder, income and New Top Level Account. We're calling it John Doe.

(You'll find that only top level accounts can be all types of accounts. Some accounts can only be income/expenses, while other types (e.g. Bank) can't be either of those.)

 Next, create a series of accounts and select either income or expenses depending on type:

 If you have cash in your wallet you can put that cash as the opening balance of a cash account under current assets -- put the current amount of money in your account under Deposit, and select Equity:Opening Balance under Transfer. Make main expenses and income accounts under your name. Add specific sub-accounts.

Note how it says Imbalance: 3,000 (the amount added to income/salary). Transfer that money (income/salary) to your checking account:

 Then you get:

 We can move money from the checking account to cash (i.e. ATM withdrawal), pay by cash etc.

Here's the double-entry aspect of GnuCash -- every transaction shows up twice:

Here's another overview of the accounts:

Anyway, at this point it's fairly easy to start exploring and setting up more complex accounts.

Essentially, GnuCash SEEMS to be powerful, but for some reason I can't bring myself to read the documentation. Maybe it's the way it's written, maybe it's the topic at hand (few scientists relish the dirty world of money...or so we like to think), or maybe it's just me. Regardless, it's a piece of software you SHOULD learn how to use if you need to keep track of spending -- as most scientists do.

03 January 2012

39. Opinion -- little annoyances regarding opinions about linux

I spend far too much time browsing the web, and I do often end up on linux-related sites. A fair number of sites are still dedicated to converting windows/osx users or helping new Linux users. In particular the latter aim is noble, of course.

At time it does get a bit tiring reading the comments sections though -- and that goes for both Linux advocates and their detractors.

Quotes collected from the web are given within "".

As an aside, most linux users, but perhaps not most windows and OSX users, are well aware of the difference between Learn-ability and Usability. A program may well be easy to LEARN how to use ('intuitive') but it may be a pain in the arse to actually USE. Most linux CLI tools require a bit of extra effort to learn, but once learned, are eminently usable.

0. Fewer than 1% use Linux or Ubuntu/Mint/X is the most popular distro
According to my blog, 55% of all visitors use linux (Win 40%, OSX 2%). This blog, given it's content has a positive bias towards Linux users.

According to my professional university homepage (I'm a chemist, not a Comp. Sci. person) about 11% use Linux, while 74% use Windows and 12% use OSX. My homepage, by virtue of being strictly related to my field of research, is biased towards users who are professional chemists.

So what to do?
For starters, what does 'use' mean? Do we only mean as a primary Desktop OS? Or do we include servers? Or even indirect use, such as visiting websites run on linux servers and using devices with embedded linux? These problems also apply to deciding which is the most popular distribution -- do we count embedded? Server installations? Or only Desktop usage?

The problem is compounded by the problem of measuring usage, regardless of definition. For commercial OS one might use the number of licenses sold as an indication, but that won't work for a Free OS. Same goes for number of downloads. Repo access sounds like a good idea, but in addition to most major universities (+ companies and kind individuals) running mirrors, a fair number of us use apt-cache to cut down on both our and server traffic. And what about people who, like me, have a large number of computers which they use each day (desktop at home for watching tv, laptop at home for work, desktop at work for...work, three desktops at work for number crunching, router at home with busybox/tomato)

There would of course also be the practical issue of compiling all the stats, so this approach isn't used today.

So...for OS share 'Net applications' statistics is often used, see discussion e.g. here. Website stat, however, do not adequately distinguish between Number of Users and Number of Visits. The selection of reporting sites also influences the results.

Still, the problem is even greater when it comes to crowning the reigning distro. Most of the time distrowatch data is quoted, and it really makes absolutely no sense. I use only linux, and I visit distrowatch less than once per year -- because why would I? I use Debian, I'm happy with Debian, and I have no longer any time to explore other distros without a bloody good reason, and even if I did, distrowatch wouldn't be the place I'd go looking for information. I really wish articles would stop quoting distrowatch data.

1. The year of the Linux Desktop/Focus on mobile devices
"That's why I feel it's more important to focus on how Linux performs in growth areas like mobile devices than on a desktop that's increasingly less relevant for content consumption."

This is, if not a meme, then at least a standing joke. However, there's still this idea that Linux NEEDS to become a big player on the desktop and that it has so far failed to achieve this. Alternative, Linux NEEDS to focus on mobile devices where they can grab a large market share.

Well, guess what -- for a lot of people every year is the year of the linux desktop -- we're using linux as our only, or primary, OS.

Also, there isn't a NEED for linux to become anything.

What most linux users feel is probably that rather than necessarily converting everyone to some flavour of linux, it would be nice of non-linux users would stop forcing proprietary formats on everyone.

At my current job people insist on emailing .docx files for some reason. This
   1.  more-or-less forces Windows users to upgrade their office versions (which is the real reason behind changing the file format)
   2. pisses off anyone who isn't using office --- such as linux users. A guess-timate would be that 80% of the documents emailed contain so little formatting that a plain ascii file would have been enough. For the rest, pdf would work just fine since editing isn't required.

Really, you can use office if YOU want to, but don't 1. pretend that it's superior to latex because you can click on things or 2. force it on other people.

2. 'obscure' terminal commands
"Look it's 2009. The public doesn't want to type in commands. GUI's have been around for how long? It's obvious by the success of Windows that users want an easier experience."

They are only 'obscure' if you are dead-set against learning what they do. There is no difference between typing in a command and looking through a graphical menu. You still need to be willing to dedicate at least a modicum of effort towards learning.

And guess what? There's a reason why the terminal/command line/cli is still around. In fact there are several. For a starter, it's a faster, easier and more convenient method once you've made a bit of effort of learning how to use the standard *NIX tools such as gawk, sed, vim etc. Not everyone uses their computer for data processing, or even work, and that's fine -- some people live their lives in the browser and won't benefit much from using the terminal (but they really shouldn't complain about its existence either).

Also, the idea of 'getting rid of the terminal' as one sees sometimes show s a complete lack of understanding of how a linux system works. GNOME/KDE/Xmonad/XFCE/LXDE etc. are just shells, interfaces on top of the linux kernel. They are like thin sheets of ice covering a deep sea -- most of the action is to be found underneath.

And that's a GOOD thing -- in windows there's little reward for making the effort to learn new things. In Linux, you can learn as little or as much as you want -- you'll get rewarded for any effort to learn that you make.

3. 'Too much' choice
"Fragmentation: 1% of the market split into 100+ distros. Divided they fall."

In the beginning I fretted a lot about choosing the 'right' distro -- after all you don't want to waste your time learning something that's obsolete or not as useful as the next thing around. As it turns out, there's little difference between different distros.

Well, the differences are there there, but they are typically down to philosophy, package management or number of packages in the repos.

I feel more at home using apt-get/aptitude than yum, but since a fair number of users use a graphical package manager, this really doesn't matter much.

Other than that, most distros are the same, and are derived from four or five main distros (the Debian and Fedora/Red Hat families probably being the largest ones). So, instead of 100+ distros you have 3-4 distros which are really not that different.

The differences between windows 2000 through Windows 7 are larger than the differences between any of the linux distros.

4. No drivers/hardware support
"The real killer with linux is using peripherals. Drivers suck if they exist at all."
To date I've only had one piece of hardware which didn't work immediately -- my Diamond ATI Wonder HD 750 USB TV card. And I blame ATI for that, not 'linux'.

5. No games means Linux sucks
"I gave Linux a shot. Despite the irritating little problems I encountered I tried. And then my nephew wanted to play a game and it became all too clear--Linux has no chance."

This is true. But are we discussing a system for casual gaming or are we talking about a computer OS? I'd hate to write articles or do modelling on XBOX or Playstation. If gaming is what you are after, then by all means, find a system where you can do it. Whether a publisher releases a game for a particular platform has little to do with the superiority of that platform and all to do with market share.

Anyway, people can use what they want -- what irks me is when they pretend they'd use Linux if only...and then some half-baked, poorly informed 'reason' is presented.

Use or Do Not Use -- but make no excuses.

38. How to install and/or compile wine on debian testing

UPDATE: See here for Wine 1.5.27 using a chroot

UPDATE: there are plenty of more up-to-date guides on this blog. See e.g. here for how to build v 1.5.6. Obviously, the instructions below are still valid, and will give you a working version of wine.

Original post:
Quite some time ago Wine was removed from Debian Testing/Wheezy. If you already had wine installed, this may not have caused any significant problems, but it did cause inconvenience when setting up a new computer.

There are three fairly easy ways of installing wine in Debian testing.

Update: See here for version 1.4-rc4: http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-compiling-wine.html

1. The simplest approach -- Using the Stable version of wine 
Simply add the stable repo to your /etc/apt/sources. list (add -- don't replace your testing repo)

i.e. if you sources.list looks like this:

deb ftp://ftp.au.debian.org/debian/ testing main contrib non-free

then add a line so that it looks like this:
deb ftp://ftp.au.debian.org/debian/ testing main contrib non-free
deb ftp://ftp.au.debian.org/debian/ stable main contrib non-free


sudo apt-get update

followed by

aptitude search wine

should hopefully show wine, wine-bin etc. The current version in the Debian stable repos is 1.0.1-3.1.

You can now install wine by

sudo apt-get install wine

2. The ever so slightly more complex approach -- installing version 1.3.32-0.1
If you want a newer version -- and I'd say that you would since the debian wine packages are OLD -- you can at the moment pull .deb packages from http://dev.carbon-project.org/debian/wine-unstable/

Don't let the 'unstable' fool you -- these are NOT the packages in the debian SID/unstable repos.

Also, pay heed to the following text on the page above: "The amount of traffic this little sub-page generates is quite respectable. If you think this service helpful and want to help cover some of the attached costs, please donate a few Euros". Whether you donate or not, do not download the same packages over and over again.

Download all the .deb files (in my case for amd64) using the following command:

wget -r -l1 --no-parent -A amd64.deb http://dev.carbon-project.org/debian/wine-unstable/

This is an example of using something akin to wildcards in wget.

cd dev.carbon-project.org/debian/wine-unstable

sudo dpkg -i *.deb

You'll see a number of errors being reported and the packages will be left unconfigured -- this is due to missing dependencies. That's easy to fix though:

sudo apt-get -f install

The missing dependencies will now be pulled in and the installation finalised. It's as easy as that!

3. Building your own -- version 1.3.35
It's not as hard as it may look -- I'm not in the habit of compiling my own packages, and chances are that you aren't either, so I'll show the entire process.

Download the source
wget http://prdownloads.sourceforge.net/wine/wine-1.3.35.tar.bz2

tar -xvf wine-1.3.35.tar.bz2

You may have to
sudo apt-get install bzip2 
before running the tar command above if it complains about missing bzip2 etc.

Change to the directory where the files were unzipped
cd wine-1.3.35

Time to start trying to build -- the errors I get may not be the errors you get. The approach to solving them is the same though.

First we need a whole lot of packages:

sudo apt-get install bison flex gcc libc6-dev libfontconfig-dev libfreetype6-dev libglu-dev libgsm1-dev libice-dev libjpeg-dev libldap-dev libmpg123-dev libncurses5-dev libopenal-dev libpng-dev libsm-dev libssl-dev libusb-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxml2-dev libxrandr-dev libxrender-dev libxslt-dev libxt-dev libxxf86vm-dev make libcapi20-dev liblcms-dev libsane-dev libhal-dev libdbus-1-dev valgrind prelink libcups2-dev

sudo apt-get install lib32v4l-dev lib32ncurses5-dev lib32asound2-dev lib32z-dev ia32-libs-dev

Now start:

which gives**

configure: OpenCL 32-bit development files not found, OpenCL won't be supported.
configure: gstreamer-0.10 base plugins 32-bit development files not found, gstreamer support disabled
configure: OSS sound system found but too old (OSSv4 needed), OSS won't be supported.
configure: libgsm 32-bit development files not found, gsm 06.10 codec won't be supported.

configure: Finished.  Do 'make' to compile Wine.

Good enough for me. 


Building will take a good 20-30 minutes.

Finally, 'install' the binaries in their proper locations

sudo make install

The first time you start a program in wine you'll be asked to install the gecko engine, which you can go ahead and do.

** I initially had some problems -- one of them being

checking for X... no
configure: error: X 32-bit development files not found. Wine will be built without X support, which probably isn't what you want. You will need to install 32-bit development packages of Xlib/Xfree86 at the very least. Use the --without-x option if you really want this.

This was solved by installing ia32-libs-dev