FSFE meeting tonight in Brussels, Thurs 7th

Sorry for this short notice, but since I’ve just been added to the planet.grep.be blog aggregation, I decided it’s worth a quick mention.

Tonight’s meeting is a small, informal one at 20:00 in Café Walvis, 209 Antoine Dansaertstraat. We hope to soon launch larger meetings which will be held on Sunday afternoons every 3 months. Tonight’s meetings will help set the details for that.

There’s not much of a fixed agenda. We’ll mostly chat about whatever the people there are interested in.

We’ll also being trying the quarterly model in Ireland, starting with a joint-meeting in September on Software Freedom Day (organised by Ubuntu Ireland). Monthly pub meetings have already been working in Dublin since late 2003 (organised by IFSO on the 3rd Tuesday of each month).

Anyone interested in free software is welcome, as always. It’s not limited to Fellows of FSFE.

If anyone needs details on where we are, you can email me (ciaran at fsfe dot org) or phone me on +32 477 36 44 19

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship

Links: FaceBook, Snooping, Consultation, Theora, Treacherous

See also: Yesterday’s links – the archive of my Links posts.

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship

Using LaTeX to make PDF documents with Japanese characters

Even if you know nothing about LaTeX, you can make your first Japanese PDF document by taking a copy of this example file JIS.tex, going to a shell command line and typing "pdflatex JIS.tex". That should produce this output: JIS.pdf.

If that doesn’t work for you, then you need to install some LaTeX software or Japanese fonts. On my Debian GNU/Linux system, I think I just installed texlive-latex-base and latex-cjk-japanese, and the package manager automatically installed the other packages needed by those two. I don’t remember if I also had to install a fonts package.

Once you’ve got that working, you can start modifying and removing lines from that example file to see what you really need. I trimmed it down to eight lines:

\documentclass[12pt]{scrartcl}
\usepackage{CJK}

\begin{document}
\begin{CJK*}[dnp]{JIS}{min}

\section{What I learned today}
I can write this 私はキランです in Japanese.

\end{CJK*}
\end{document}

%%% Local Variables:
%%% coding: euc-japan

 

Ok ok, that’s ten lines since I included two commands at the end to tell Emacs which character encoding to use when saving the file. This seems important since when I saved it as utf-8, the pdflatex program failed. Because these two lines start with percent signs, they will be ignored by LaTeX processors such as pdflatex, so it’s safe to leave them there even if you’re not using Emacs.

In the sixth line of my small example you should see seven mostly-simple Japanese characters. If that’s not what you see, try setting your browser’s character encoding to EUC-JP or maybe UTF-8. (This might be in [menu-bar]->View->Character Encoding->…)

Once you have this working, you should look at the other examples that came with the LaTeX CJK package. On my system, the examples are installed in the directory /usr/share/doc/latex-cjk-japanese/examples/ (Thanks for the tip, LUK ShunTim) This is probably also the best way to get started with other complex fonts such as Chinese and Korean.

It took me four hours to figure out how to use LaTeX to make a PDF document with Japanese characters. At one point, I became so frustrated with the LaTeX documentation that I gave up and decided to use DocBook instead. Unfortunately, DocBook’s documentation was just as bad.

I think I learned something from all this about what makes a good tutorial: get the user to a working example as quickly as possible. Once you have something working, then you can experiment and learning becomes fun.

For a start, I think I’ll put the "ruby" commands from JIS.tex back in since they’re a pretty useful reading aid for learners. "Ruby" here refers to the little superscript phonetic kana characters, usually called furigana. It has no relation to the Ruby programming language, which was developed by a Japanese guy.

To write Japanese hirigana, katakana, and kanji, in Emacs you just use the function M-x set-input-method and then type japanese at the prompt. The usual command (C-h I) will show the documentation for how the input method works. While using the japanese input method, typing qq will put you into the japanese-ascii input method, which you’ll need for typing LaTeX commands and symbols "\{}". And qq again will bring you from the japanese-ascii input method back to the normal japanese input method.

If you want to use other applications, then you’ll need to install some separate input method software. I installed the packages "anthy", "scim", and "scim-canna" and then was able to write Japanese in GNOME applications by right clicking in a text box and from the "Input Methods" submenu, choosing "SCIM Input Method". It’s annoying that SCIM uses Ctrl+Space as it’s activation sequence. You can change this by going to "Show command menu->SCIM Setup->Global Setup" I wasn’t able to get OpenOffice.org to work. From looking around, it seems OpenOffice only supports "IIIMP", but I can’t see any package that provides IIIMP.

You might find useful info on these pages:

Hope that helps!

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship

Links: Sean Daly, KDE, swpat, chessboxing

  • Groklaw now has a page of Sean Daly’s interviews – I’ve been asking for this for a while.
  • Old article about privacy problems with Google’s desktop software – I started looking into this because I read an article about the new version of KDE boasting that Google’s desktop software could now be integrated into KDE. That’s bad, not only because Google’s desktop software is proprietary, but also because it gives Google complete access to your data and their privacy policy is strongly criticised by Privacy International.
  • Free as in Free Champagne! – Erik Josefsson notes the 3rd anniversary of our massive software patent victory in his usual style. Erik played the lead lobbying role in that campaign and must have lots of great stories to tell, so I always find his short, infrequent, casual blog entries bemusing. (I’m giving this a low-key mention since I hope to blog about it again later this week.)
  • Article about chess boxing – 11 rounds alternating between chess and boxing where a contestant wins by checkmate, knockout, or points.

See also: Yesterday’s links – the archive of my Links posts.

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship

Links: India-pats, Clipperz, FreeGIS, RMS, Emacs

See also: Yesterday’s links – the archive of my Links posts.

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship

Using and writing Emacs 22 input methods

Emacs 21 had a generic function called iso-accents-mode for writing âççéntèd çhàrâçtërs, but that was removed in Emacs 22. It took me a while, but I found the replacement was to use set-input-method, and then select whichever language you want to be able to type the accented characters of.

The default keybinding for set-input-method is not very convenient (C-x RET C-\), and I almost always use the same input method, so I put this small helper function in my .emacs and bound it to an easy key sequence:

(defun ciaran-toggle-french-input-method ()
  "toggle between French and no input method"
  (interactive)
  (if (string= current-input-method "french-alt-postfix")
      (set-input-method nil)
    (set-input-method "french-alt-postfix")))
(global-set-key [?\C-c ?.] 'ciaran-toggle-french-input-method)

Sometimes I need Dutch characters, but the "dutch" input method contains some completely unnecessary conversion sequences which make it frustrating to use. And sometimes I want the "á" character so I can write my name properly. So what do I do if I want a personalised input method?

About modifying input methods, the Emacs Lisp Reference Manual just says "How to define input methods is not yet documented in this manual". So I went to the Emacs page on sv.gnu.org, checked out a CVS copy of the emacs source, grepped around, and found that the Dutch input is defined in the file /emacs/leim/quail/latin-alt.el. Looking inside, it’s not so complicated.

Here’s a minimalist example of what you could put in your .emacs to create your own very basic input method:

(quail-define-package
 "ciarans-chars" "MYlanguage" "MY" t
 "Ciaran’s personal input method defining only the
 conversion sequence he wants
" nil t nil nil nil nil nil nil nil nil t)

(quail-define-rules
 ("\"a" ?ä) ;; LATIN SMALL LETTER A WITH DIAERESIS
 ;; remember to comment your code, if you like 🙂
 ("\"e" ?ë) ;; LATIN SMALL LETTER E WITH DIAERESIS
 ("a’" ?á) ;; LATIN SMALL LETTER A WITH GRAVE
 )

For more information on those two quail-* functions, you can get help in the usual way with C-h f and then type the name of the function at the prompt. If you want to test the above code, just paste those two code snippets into an Emacs buffer and run M-x eval-last-sexp after each. Then you can select the "ciarans-chars" input method, and you can read about the input method by pressing C-h I and typing "ciarans-chars" at the prompt.

You will also see that, like with the existing input methods, when you type the first character of what could be a conversion sequence (in the above example, this is just " or ‘a’), you will see in the minibuffer which characters could follow it to cause both characters to be converted into another character. So with ciarans-chars, when you type " the minibuffer will display: "[ae].

Looking at the source in /emacs/leim/quail/latin-alt.el should give you ideas for what other conversion sequences you’d use, and the other files in that directory contain the conversion code for more complex alphabets.

Me, I’ll make a minimal input method for the characters I use from French, Dutch, plus the Irish a-fada "á". I filed a bug report about the current Dutch input method, but seeing how uncomplicated it is, I might be able to fix it and submit a patch now.

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship

OpenStreetMap is doing great

I was impressed recently by the progress of OpenStreetMap (OSM). The maps of most big cities (in Europe at least) are already very complete, e.g. Dublin and Brussels. Many smaller cities and cities in less developed countries are still in need of work, but the current status clearly proves that the project’s aims are practical.

Why is having freely reusable maps important? For one thing, they can be used by other community projects such as Wikipedia. Another advantage is that rather than trying to make it difficult to copy their data (like the corporate map providers do), the OSM website provides lots of features to export their maps. (If you want to link to an OSM map instead of exporting an image, use the "Permalink" link in the bottom right-hand corner.)

When you export an image from OSM, there’s no copyright notice or attribution info (which seems like a mistake to me), so when you use OSM maps, consider adding a link or some text to tell people where you got the map from.

The current licence used for the mapping data is the Creative Commons by-sa-2.0 licence. There are constant discussions about changing the licence – not because people disagree with the ideals of that licence, but because there is debate among legal experts as to whether that licence is valid for mapping data and would work worldwide. For people intrested in that sort of thing, there’s a very good summary written by Richard Fairhurst in January 2008.

To get involved, there’s info on their Beginner’s Guide. You might also find an existing OSM group in your area by checking the Mapping projects page on their wiki. I’ve recently borrowed a GPS handset, so I’m hoping to be able to post more info in the future about how it all works.

On the Event Calendar on their wiki, there’s a list of upcoming events including their annual conference which will take place in Limerick, Ireland on the weekend of July 12th and 13th.

According to their software licensing policy and the FAQ, all OSM software is free software, using the GNU GPL by default.

In other news, the OpenMoko Neo Freerunner is heading for large scale production. I’ve heard it’s far from being ready for daily use, and you should be comfortable with installing and upgrading software. So this version is mostly for hackers, but if you’re interested in mobile phones powered by free software, OpenMoko is the free-est available. There’s a group discount when people in one region order 10 phones. Because it has built-in GPS and all the software is free software, I’m hoping it will increase the number of OpenStreetMap contributors.

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship

Launching your favourite editor in Firefox

After a bit of tweaking, I’m now happily using the the It’s All Text! plugin to let me to edit webpage text boxes with Emacs. It also works with other text editors. [UPDATE: Actually, my browser is Iceweasel, not Firefox. See the Mozilla software rebranding article on Wikipedia, and the IceCat project]

To configure it, go to Tools->It’s All Text!->Preferences in Firefox’s menu bar. In the editor field, when I added some command line options to make Emacs start quickly, it gave me the error "Unable to open your editor". So I made a "quickmacs.sh" file and told It’s All Text that that that was my editor. In quickmacs.sh, I put:

#!/bin/sh
gnome-terminal -t "QM $1" -e "emacs -nw -Q --load ~/software/tb.el $1"

The second "$1" is essential. I want Emacs in non-gui mode, so it has to be launched by a terminal program because It’s All Text! doesn’t run the given editor command in a terminal. tb.el is a a cut down version of my emacs.el. It just contains the minimal convenience settings I want for editing textboxes:

(transient-mark-mode t)
(show-paren-mode t)
(menu-bar-mode 0)
(defun ciaran-turn-on-french-input-method ()
   "set the input method to French"
   (interactive)
   (set-input-method "french-alt-postfix"))
(global-set-key [?\C-c ?.] 'ciaran-turn-on-french-input-method)
(longlines-mode t)

There were two other interesting plugins. The first is EmbeddedEditor 0.1, but you have to make an account and log in if you want to download it, so I ignored it. The second is Firemacs, but that’s adding some Emacs features to Firefox – I prefer to have a full Emacs.

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship

Wikimedia board vote 2008 ends midnight Sunday

Elections for one community seat on Wikipedia’s nine-person Board of Trustees will close at midnight on June 21st. I’m eligible to vote, and, for reasons I’ll discuss next week, I have a sudden interest in communiy voting.

The criteria for eligibility to vote are that you have a certain number of edits to a Wikimedia project. Almost 2.5k votes have been cast so far.

I don’t know any of the 15 candidates, so I had to draw up some criteria. The candidate statements were only a minor source of information. What’s important for me in a candidate? I wrote everyone’s name on a page and made notes about them on three criteria.

  1. Activity levels on Wikimedia projects. Unless someone has been active in contributing to Wikimedia projects, it would be difficult for them to know the issues that affect the editing community. So they should have at least a few thousand edits.
  2. Language abilities, for two reasons. First is that while the English Wikipedia is very good, the quality quickly drops when you read the smaller Wikipedias. So I think there should be more focus on the non-English Wikipedias. Second, because there are so many Wikipedia’s, coordination is necessary. To be a good coordinator among projects of many different languages, it helps to be multilingual. Judging someone’s language abilities is hard, but I think being able to contribute paragraphs of text in a language is a very good criteria for being "capable". So I mostly ignored what language abilities the candidates claimed in their statements, and instead judged their language abilities based on how much they have contributed to non-English Wikipedias.
  3. Responses to questions. 50+ questions were put to the candidates. I didn’t have time to read all their answers, and I found that most answers didn’t give me much to base a decision on. But, there was one candidate that I quickly flagged as obnoxious, and two candidates that I flagged as insufficiently interested (since they didn’t answer most questions), and for some of the candidates I put a number beside them if an answer impressed me.

The four candidates that I favour are, in no particular order:

It’s interesting to note that all 15 candidates are male, and almost all are from Europe or North America. Voting ends midnight Sunday June 21st.

UPDATE June 30th: the results are online. I’m very happy to see that Ting Chen won. 3019 votes were cast.

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship

Updating Debian keys for the uninterested

Despite having an aversion to configuring and maintaining security and crypto software, I accepted that I had to update my system in response to the recent big Debian security problem. If I can do it, you can do it. Below are my notes, but keep in mind that my security rank is somewhere between ignorant and uninterested.

For Debian’s advice about about updating your system, see:

Some good news is that GnuPG and GnuTLS are not affected. By coincidence, GnuTLS fixed some other security problems yesterday, so upgrading your GnuTLS in the near future would be a good idea, but there’s no need to regenerate any keys.

To fix the OpenSSL problem, you have to do two things. First you have to upgrade the package "libssl0.9.8". Then you have to check your system for weak keys and regenerate them if there are any.

About updating the "libssl0.9.8", remember to mention that package explicitly. I originally just upgraded "ssh" and "openssl", thinking that the necessary packages would be automatically be updated because they’re dependencies, but they’re not. So, explicitly update "libssl0.9.8". It’s probably a good idea anyway to update "ssh", "openssl", "openssh-client", and "openssh-server". So that’s five packages to upgrade, but the most important is "libssl0.9.8".

Next is to scan for weak keys. You do this with either the "dowkd.pl.gz" perl script, which is published by the Debian Security team. Or you can use the "ssh-vulnkey" program which you get when you install the "openssh-blacklist" package (UPDATE, May 27th: the "ssh-vulnkey" utility is now in the "openssh-client" package). Of these two, I used dowkd.pl.

Optionally, if you want to confirm that the dowkd.pl.gz that you’re downloading is really the official Debian scanning tool, you can do this with GnuPG’s "–verify" command. For this, you will need dowkd.pl.gz.asc (the signature of the scanning tool). This is described in more detail in a section of the above linked Debian wiki page. That .asc file is the signature for dowkd.pl.gz (not for dowkd.pl), so remember to do the verification before you unzip dowkd.pl.gz.

Next you run "perl dowkd.pl help" at the command line. From there, you choose your options. For me, since I’m the only user on my computer that uses ssh, I ran "perl dowkd.pl user ciaran". I was told I had two weak keys. I manually deleted the four files (public and private key for each of the two weak keys):

  • ~/.ssh/id_rsa
  • ~/.ssh/id_rsa.pub
  • ~/.ssh/id_dsa
  • ~/.ssh/id_rsa.pub

And then I generated a new RSA key with "ssh-keygen" and a new DSA key with "ssh-keygen -t dsa".

I then ran "perl dowkd.pl user ciaran" again to verify that my new keys were not weak, and it told me I had zero weak keys. Success.

Lastly, I had to update my public key on some remote hosts. For example on sv.gnu.org, CVS write access requires a DSA key. So I went to my profile, deleted my old key and then submitted my new DSA public key (~/.ssh/id_dsa.pub).

That was all. I hope these notes encourage some others who similarly hate security to actually fix their systems. I hope it saves some people a bit of time or frustration. And I hope I didn’t give too much bad advice that would make real security people cringe 🙂

(email me on ciaran at fsfe.org if there is anything cringeworthy)

— 
Ciarán O’Riordan,
Support free software: Join FSFE’s Fellowship