Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Tag Archives: linux

Sticky note solution that is reliable, cross-platfrom, off-line and synchronizable

I have tried quite a few note taking app/programs, includes tomboy/GNote, xpad, Knote and several others web app. However, none of them have both crucial features, namely off-line mode and easy synchronization.

I was using xpad for some months, it is small and quick and looks like a sticky note. However, for some reason, it started create a lot of empty note that I have no way to delete them from GUI, nor can it synchronized with other devices.

I eventually come up with following combination: emacs as editor, asciidoc for format and styling, and git to sync.

emacs is surprising good for note taking, as it

  • Can change background/foreground color, so it can looks more like a stick note
  • Fast enough start up (I have a special setting for that)
  • Variable font sizes and styles (so you can emphasize text with larger, bold and italic fonts)
  • Great offline support ๐Ÿ™‚
  • Full feature text editing ๐Ÿ™‚

asciidoc provides simple yet powerful markup. Some might say that asciidoc is complex, but hey, for note taking propose, basic text decoration making is sufficient.

This is how I set my environment:

  1. Install emacs
    sudo yum -y install emacs
  2. Configure emacs
    Edit the file ~/note.el

     ;; custom-set-variables was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(ansi-color-names-vector ["black" "#d55e00" "#009e73" "#f8ec59" "#0072b2" "#cc79a7" "#56b4e9" "white"])
     '(show-paren-mode t)
     '(make-backup-files nil)
     '(auto-save-visited-file-name t)
     ;; custom-set-faces was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(default ((t (:family "DejaVu Sans Mono" :foundry "unknown" :slant normal :weight normal :height 240 :width normal)))))
    (add-to-list 'load-path "~/.emacs.d")
    (require 'adoc-mode)
     (add-to-list 'auto-mode-alist (cons "\\.adoc\\'" 'adoc-mode))
    (add-to-list 'default-frame-alist '(foreground-color . "black"))
    (add-to-list 'default-frame-alist '(background-color . "yellow"))
    (add-to-list 'default-frame-alist '(width . 30)) ; character
    (add-to-list 'default-frame-alist '(height . 20)) ; line
    (setq inhibit-startup-message t)
  3. Set up asciidoc for emacs
    You don’t actually need to install asciidoc itself.
    Follow the instruction of adoc-mode, and copy the .el files to ~/.emacs.d/
  4. Run the note taking program
    emacs -q -l ~/note.elย  -T Note note.adoc

    Basically that is it .

  5. Some optional final touches
    • sync: Put note.adoc in git or dropbox
    • You can also alias the command
      alias enote='emacs -q -l ~note.el -T Note note.adoc'
    • If your window manager support remember, let it remember the window location of “note”


How to determine whether an external monitor is turned on via Linux command line.

HOWTO print multiple photos in one page with Linux

If you need to print photos with conventional printers, one photo per page probably is not always good idea, because it is either too big, or waste too much paper and ink.

Luckily, in Linux there are at least 2 choices:
After select the photos you want to print:

  1. Shotwell: File->Print -> Page Setup.
    And in “Page per side”, you can choose how many photos you want to put in a page.
  2. Gwenview: Plugins -> Images -> Print Assistant -> Select page layout.

[Perl] Beware of carriage-return, even in *nux haven.

Recently I have been using a perl script to analyze returned header from curl and produce a JUnit XML reports.

One small thing that bother me is that it keep generating unnecessary newlines. Of course, I have tried chomp() and couple of similar techniques, but no prevail.

Finally, I though it might be caused by carriage-return (\r) and fixed script accordingly, and it worked as expected.

There is a good document, Why chomp() is not considering carriage-return, provides why chomp() does not process carriage return and how to get around it. But look, there are some carriage-return floating around, especially from web.

Mind Mapping for Fedora

Some time ago, a time management training mentioned about Mind map, so after the training, I went straight to Fedora (and others) repositories to play with the mind map packages.

So far I played following 4:

1. Freemind:

Pros: De facto standard, and can be imported by others. Keyboard shortcut is easy to learn.

Cons: File format between 0.9.0 and 1.0.1 seems incompatible.

2. labyrinth:

Pros: UI is extremely easy; convenient and fast to add a new entry.
Cons: Not able to modify link if you make some mistake; Can’t import and doesn’t really have import function.

3. kdissert:
Pros: UI not hard to learn; various output formats, including docbook, html, latex document, beamer, and openoffice presentation, and plain test ; function to reorganize the branches; easy to write further description ;
Cons: No FreeMind import, bind with KDE3.

4. vym:
Pros: various import/export formats, including freemind; the default link looks pretty; able to output to task juggler
Cons: Cannot reorganize the branches.

Summary: I would suggest:

  1. freemind: Good default choice, but beware of version incompatible.
  2. vym: I am current using this one, offer nearly everything.
  3. labyrinth: if you just want a simple and easy software, and you don’t need to share with others
  4. kiddsert: if you want mind maps exports straight to documents, presentation slides and don’t mind having KDE3 dependency.

Fedora 12 on HP mini 311

I have bought a HP mini 311, which come with windows XP.
Of course, I install Fedora on top of it.

Firstly I tried with live Fedora 12 with it. But it halted during the boot.
After some googling, it’s the wireless driver, ssb causing the error. Kernel option ssb.blacklist=1 works, but not the rdblacklist=ssb. I haven’t dig out the actual cause, because updating kernel to 2.6.32 seem to fix the problem and bring the wireless driver back.

After the kernel upgrade, nearly everything is working, including the video cam (test with cheese), sound, bluetooth (can use the mobile as remote control) and SD card reader. I haven’t test the HDMI output, because I don’t have the cable.

The nouveau is working just fine, but if you are after 3D acceleration, proprietary driver also available by including rpmfusion repos and

yum install akmod-nvidia

I am mostly satisfy the performance of the laptop, but one annoying thing is that the touch pad is too easy to be touched when I am typing, which leads to unexpected windows and work spaces changes.

I’ve also tried Fedora 13, works out of the box.

Summary for for Fedora 12 on HP mini 311:


Not work-out-of-box with original Fedora 12, but fixable by upgrade kernel to 2.6.32


Work-out-of-the-box with nouveau and proprietary nvidia driver.



Web Cam


Wired Network



Need upgrade kernel to 2.6.32



SD card reader

Not verified before kernel upgrade, but 2.6.32 seems works.


not tested.

Is open source communism?

Long ago, open source and Linux are deemed as communist. This impression can be bad (see the following picture, from mikeely’s blog, but he/she doesn’t seem to oppose open source anyway. :-P)

On the other hands, people in Russia and China rather like the idea. Search on google picture for examples.

Back to our question.

Is open source communism?

According to Communism wikipedia page, ideally, communism wants to achieve:

  1. Egalitarianism: All people should be treated as equal.
  2. Classlessness: Everyone was equal and carried out the same work.
  3. Stateless society: A society without a government.
  4. Common ownership: assets of an enterprise or other organization are held indivisibly rather than in the names of the individual members or by the government.
  5. Control of the means of production and property.

Is open source qualified as communism? Let’s see:

Egalitarianism: Some

In term of software development, there are two classes of people: developers can commit to source; while users can only read. But on the other hand, usually it is relative easy for users to join the development team or fork project.

Moreover, developers are also users of other projects.
So it is not absolute egalitarianism.

Classlessness: Some

As said before, at least two classes are needed.
However, can’t say which one is higher, because developers need to do all the hard work,
yet they have the power to allocate development resources.

Stateless society: Mostly

If the project is developed for a company,
then the project is considered governed and thus not stateless.
But even that, people can still fork the project for their own need if the license is open enough. So I scored it as MOSTLY.

Common ownership: Doesn’t matter

Mmm, open source is seen as communism usually because of this. But contrary to common beliefs, in term of the software usage, ownership does not matter.

Do you own Windows when you paid for it? No, it still belongs to Microsoft, and it is illegal if you copy it to other machine without the proper license. Open source is actually the same. Even as permissive as BSD, you cannot claim the ownership of FreeBSD, but you can do nearly everything you want with it.

So, does open source provide common ownership? No, but it give you the freedom to use it.

Control of the means of production: No

It’s solely depended on developers.

Control of the property: Depends on the license

For the permissive license, there is no control of the property.
GPL on the other hand, does control the property, but it is just a measure to ensure the work and its deviant can be freely redistributed.

To sum up, open source does not yet fill the bill of communism.