08 January 2012

41. Chinese character and input support on debian testing

Update: You should also install support for gtk and gtk3:
sudo apt-get install ibus-gtk3 ibus-gtk
in order to be able to use it with e.g. thunderbird.

Original post:
Here's how to set up Chinese (simplified) support in Gnome 3 /gnome-shell and the terminal (bash).

First install the fonts:
sudo apt-get install fonts-arphic-*

Next. add Chinese via locales:
sudo dpkg-reconfigure locales

Select
zh_CN.UTF-8

(For traditional characters choose zh_HK, zh_SG or zh_TW)

As default language English is probably a good idea
In my case it's en_AU.UTF-8

Edit ~/.bashrc and add the following lines:
LANGUAGE=zh_CN.UTF-8
LANG=zh_CN.UTF-8

Run
source .bashrc

Install ibus:
sudo apt-get install ibus-pinyin 
This pulls another 18 packages with it

Start ibus-daemon in terminal
An icon in the notification tray still appear
Right-click, choose Preferences (P)
Click on the second tab (input methods)
Select an input method -> Chinese -> Pinyin

You should now be able to choose between regular (latin) input and Chinese characters using Ctrl+Space.

To make ibus-daemon start with gnome, run
gnome-session-properties
and add
ibus-daemon

And you're more or less done.

Sogou is a popular pinyin database on the Windows platform -- but afaik it's not available for Linux. On Linux, it seems that the ibus-pinyin-db-open-phrase database is the default ibus database used to guess what characters you intend to type, but you can also install and select either ibus-googlepinyin or ibus-pinyin-db-android. After installation you need to select the database by going to preferences in the ibus daemon and selecting it as input method. Not being Chinese I can't tell whether sogou, google pinyin and android pinyin are comparable.

Sogou does however work with Google Chrome/Chromium on linux -- go to Preferences/Extensions -- Get More Extensions, and install the Sogou Cloud Pinyin Extension for Chrome.


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.