Meet us every second Tuesday of the month!
Text Size

TIL tac


Concatenate and write files in reverse, copies each FILE ( - means standard input), or standard input if none are given, to standard output, reversing the records (lines by default) in each file separately.

OSX doesn't have tac out of the box, but add the following line to your .bash_profile and you're good to go:
alias tac='tail -r'

Software Freedom Day 2014 Phnom Penh

The Digital Freedom Foundation is organizing our Software Freedom Day event in Phnom Penh together with the National Institute of Posts Telecommunications and ICT and the Ministry of Posts and Telecommunications on November 1st at the NIPTICT Building. There will be 14 talks (9 in Khmer and 5 in English) with topics covering free and open source software ranging from operating system, learning platforms, website development, resource map, servers, to security. Here is the detailed schedule and speakers profiles.

We expect to have more than a hundred people to attend and aim to target both the university audience and the young workforce, on top of presentations and workshops, we (assisted by various communities) will be holding booths (e.g. Moodle, Mozilla, RouterOS, Ubuntu and Blender) to allow for more individuals discussions. All in all it’s been a joy preparing for this event, allowing us to talk and plan resources with people from different local communities such as OpenSourceCambodia and Smallworld Cambodia.

The event will start at 1:30pm tomorrow, if you happen to be in Phnom Penh please do drop by!


How to include local packages for pbuilder

The ibus-cangjie suite consists of 3 source packages: libcangjie, pycangjie and ibus-cangjie, pycangjie depends on libcangjie and ibus-cangjie depends on the other two. When you use pbuilder or its wrappers (I mainly use pbuilder-dist) to build pycangjie or ibus-cangjie, you have to make sure the depended packages are in the pbuilder chroot somehow otherwise the build will fail.

I used to build the package in the lowest level first, in this case libcangjie, then login to the pbuilder chroot with the --save-after-login argument and manually copy the built packages to where the chroot is mounted, run dpkg to install the packages, then exit the chroot. Now libcangjie is installed the chroot and so the build dependencies of pycangjie can be satisfied. This is simple, but requires quite a lot of typing.

There is a simpler way. As pbuilder puts all its built packages in a single directory, we can make the chroot use it as an apt source.

Assume packages built by your pbuilder is located in /home/ubuntu/pbuilder/sid_result, and pbuilder hooks are stored in /var/cache/pbuilder/hook.d. Now, update your .pbuilderrc like this:

# cat ~/.pbuilderrc

Then put a new hook script to generate a Packages file:
# cat /var/cache/pbuilder/hook.d/D70results
cd /home/ubuntu/pbuilder/sid_result
/usr/bin/dpkg-scanpackages . /dev/null > /home/ubuntu/pbuilder/sid_result/Packages
/usr/bin/apt-get update

To verify it is set up correctly, login to the pbuilder chroot with the --override-config and --othermirror arguments and check if /etc/apt/sources.list is updated, OTHERMIRROR parameter in .pbuilderrc does not work for me so I can only use --othermirror, not nice as you need to supply it every time you run pbuilder:

# pbuilder-dist testing login --override-config --othermirror "deb [trusted=yes] file:///home/ubuntu/pbuilder/sid_result ./"

# grep -r home /etc/apt
/etc/apt/sources.list:deb [trusted=yes] file:///home/ubuntu/pbuilder/sid_result ./

If everything goes well, build your package with the --override-config and --othermirror arguments like what you just did for the login operation:

# pbuilder-dist testing build --override-config --othermirror "deb [trusted=yes] file:///home/ubuntu/pbuilder/sid_result ./" <.dsc-file>


Behold, the Sofa Car

Or click here if that doesn't work. The piece about the sofa car starts at 2:30 in.

Single-page ansible module documentation

A friend introduced me to Ansible recently and since then I've been spending a lot of time on writing playbooks. (Time which was perhaps better spent on Docker, but for now Ansible is my #shinynewthing.)

Unfortunately I find the Ansible online docs lacking, especially given the amount of info available in `ansible-doc` command line tool.

So, for all those Ansible lovers, here's a single page file with all of Ansible's modules and attributes:

This file was created as such (with a little post-processing*):
$ ansible-doc -l | cut -d ' ' -f 1 | xargs -n1 ansible-doc -s >>ansible.yml

* :%s/^\([^'#]\+\)'\([^#]*\)/\1`\2/g

Celebrate Software Freedom Day on September 20

200teamsI am very glad to share with you that registration of the eleventh edition of Software Freedom Day has been opened since early August and you can see from our SFD event map, we already have 129 events from more than 50 countries shown in our map. As usual registration happens after you have created your event page on the wiki. We have a detail guide here for newcomers and for the others who need help, the SFD-Discuss mailing would be the best place to get prompt support.

Don’t forget to tell people about SFD! Simply use one of the banners we’ve made if you are organizing, participating, attending or speaking at a SFD event by placing it on your webpages and link it back to your SFD event page or You can also help us to promote SFD by placing our SFD counter with your own language as well!

So get ready to celebrate and happy preparations to all!
Celebrate SFD with us on September 20, 2014!

Bulk remove wordpress spam comments and Akismet metadata

Connect to your wordpress DB using MySql workbench and execute this query:
DELETE FROM wp_comments WHERE comment_approved = 0;
DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments);
DELETE FROM wp_commentmeta WHERE meta_key LIKE '%akismet%';

Hack a fan – 自製空氣淨化器

上週日在北京 Bookworm 書店+咖啡廳參加了一個很有趣的 DIY 土炮空氣淨化器活動。北京經常被陰霾籠罩, AQI (空氣質素指數) 大部份時間處於不健康水平,在北京生活,口罩和空氣淨化器必不可少。其實空氣淨化器的構造不複雜,簡單說就是由風機抽取室內空氣,通過濾網把空氣中的顆粒隔除 。濾網包括 HEPA,活性炭等。很多市面上賣的淨化器都用 HEPA,HEPA 效能高,相對廉宜,技術成熟,能過濾 99.7% 以上 0.3 微米的粒子,所以對付 PM 2.5 很有效。當然,淨化器廠商不會只滿足於此,爲了提高利潤,都會加些有的沒的功能,譬如除甲醛、除臭、殺菌等。不過,這些 fancy 的功能往往只是錦上添花,至少在帝都這些功能遠遠比不上過濾 PM 2.5 來得重要 (沒聽說北京的細菌特別猖狂)。

說回這個 workshop,它是由一位在北京做研究的美國心理學博士生 Thomas Talhelm 舉辦的。話說他對北京的空氣污染很擔心,但又發現市面上的空氣淨化器貴的離譜,所以就開始着手研究自製淨化器,然後把結果發表到。目前他做了兩款,一款售價 200 RMB(我自己算了一下,成本大概 160 RMB),另一款過濾效能更高名叫「大炮」的賣 450 RMB。

在他的「發明」面世前,就已經有人嘗試過空氣淨化器,把過濾網放在風扇的前面(或後面),這件事誰都會幹,你想問這有什麼值得講的吧?答案就是 open data。Thomas 爲了證明他的淨化器有用,他做了非常多的實驗,在特定的環境下,採集了大量的數據,並進行對照實驗,跟量產的淨化器對比,證明他的 poor man’s air purifier 效果不比那些賣幾千塊錢的過濾器差。最重要是他把實驗方法和數據公佈在 smart air 網站particlecounting 博客,他對數據的嚴謹和認真態度都是長年在學術界鍛鍊出來的。他的朋友取笑他不願意付錢買淨化器,卻願意花 260 USD 買個粒子測量器,求真就是這個態度。



他還在不斷的進行各種實驗,目前正在測試 HEPA 在長期使用下效能的變化

剛才說到 AQI,要注意 AQI 在各國的計算方法都不同。雖然美國中國所用的算式一樣,但等級分類卻有點差別。分別在於 AQI 200 以下的時候,美國所用標準要求更高,AQI 200 以上則幾乎一樣,所以會出現下面的情況,左圖按照中國標準,右圖按照美國標準,以後 quote AQI 要小心囉:


最後順便推薦幾款監察中國 PM 2.5 的 Android app:

Music to the ears – about GNOME Asia 2014 and an idea for the next one

Zoë, our new born. The inconspicuous man behind her is Zhang Weiwu

Zoë, our new born. The inconspicuous man behind her is ZHANG Weiwu

While I was busy nursing my one-month old daughter Zoë, my husband ZHANG Weiwu showed up in Gnome Asia 2014 and talked about usable design – he is perhaps happy to get noticed once or twice:)

The following is his guest writing, since he does not have a blog of his own:

Lenka Kripac for this Gnome Asia

GNOME Asia 2014 is again phenomenal: women leadership (was there, now better), a gender-balanced audience, warm local media coverage, diverse topics, and live golden fish under the smoking area’s floor – of which I should have taken an photo;)

If you didn’t present, you should watch this music-video mini-documentary and get thrilled – probably one of the best ever produced about opensource conferences:

You would certainly notice the great choice of music. The key frames are matched to the beats, a creative use of Mickey Mousing technique.

The music and lyrics stirs up passion about excitement to grow, about change, diversity and youth, which fits GNOME quite well. Unsurprisingly, this happen to be exactly the message Microsoft marketing guys prepared for public reception of Windows 8 too. It was chosen and licenced for the theme music of an official Windows 8 TV Ad. In fact, the music made a global name thanks to its wide used in Windows 8 Ads, and a rapt audience associates the two. You would hear people talking about this piece as “Windows 8 music”, forgoing its original title “Everything at Once”:

The music was written and produced by Australian singer Lenka, whose debute piece “The Show”, with a distinct personal touch, compares the world to a stage. My favourate.

Where the music fades, the debates go on. But not much about Windows 8, instead, it is about copyright. The use of this music is unlicenced.

In modern days China, copyright is so neglected, that if you try to licence that song for this conference, you walk into the copyright owner’s branch office and they would not believe what they heard. A dilemma between doing the stupid thing of actually go and licencing it, and, doing the wrong thing of going without licencing.

But I am not to join the debate. I am writing to offer a new idea.

Woody Guthrie for the next show

Since we will have to use a different piece of music for the next Gnome Asia. There is one that just fits.

It’s Woody Guthrie’s “Howdi Do”. I have not counted, but there should be at least twenty times “Howdi Do”, “How do you do”, “Howdy” in the song. The music is a warm picture of people shaking hands, greeting each other.

This is how we are going to do it:

GNOME had been presented by a robot before:


We arange someone to play the role of our cameo robot, and ask every guest to shake hands with it – and video it:

Robot shaking hands with people. We don’t have to use a real robot – you know, it’s cheaper to let human does the robot’s work.

Then we match the hand-shaking to the lyrics: “Howdi Do”, “How do you do”,”Howdi”. We could do the Mickey Mousing again.

Why Woody? Because his music is quite old, a lot of them produced as early as 1930, under which time copyright has to be declared to be valid.

But also, I chose Woody because he made a strong stance against copyright. On the typescript submitted for copyright of “This Land Is Your Land”, Guthrie wrote:

“This song is Copyrighted in U.S., under Seal of Copyright # 154085, for a period of 28 years, and anybody caught singin it without our permission, will be mighty good friends of ourn, cause we don’t give a dern. Publish it. Write it. Sing it. Swing to it. Yodel it. We wrote it, that’s all we wanted to do.”
– source:

I jumped out of my chair cheering him when I first learned this. An opensource pioneer in 1945? A free spirit he is.

I hope our next show attracts so much attention that someone coming to us claiming copyright, then we could make a good piece of news about it. EFF did act once to defend a Woody song against copyright claims.

思源/Noto pan-CJK 字體 & Ubuntu

以開源協議授權釋出的字體大多數以拉丁字母等歐洲語言爲主,但最近 Adobe 和 Google 共同推出的思源/Noto pan-CJK 開源字體不只涵蓋了大部份中日韓所需要的字型,而且繁中、簡中、日文和韓文都用了不同的 OTF 檔案,因此對同一個漢字在不同地區的不同寫法就能個別處理,算是解決了 Unicode 一直爲人詬病的 Han unification 問題。

香港人最關心的應該是該字體是否覆蓋 HKSCS,我檢查過部份 hkscs-2008-big5-iso.txt 的 unicode 碼,在 NotoSansHant 裏都能找到,而且目測在 CJK BCD 區裏都有覆蓋,所以應該夠用(在下面的圖找找吧)。

用 Fontforge 查看 NotoSansHant-Regular.otf

用 Fontforge 查看 NotoSansHant-Regular.otf

從下面幾張 screenshot 可以看到香港字顯示效果理想:

想將 Ubuntu 的桌面 UI 和程式的預設字體改成思源/Noto,可以參考 Ingram Chen 的 blog。小弟改良了一下 Ingram 的 fontconfig 設定檔,使系統在不同 locale 下能優先選擇適當的字體,比如 zh_TW 下繁體的 Noto Sans T Chinese 是第一選擇,在 zh_CN 下則爲簡體的 Noto Sans S Chinese,之後其他的 CJK 字體作爲 fallback。

設定檔已放在 20-noto-cjk.conf,下載後執行:

mkdir ~/.config/fontconfig/conf.d
mv 20-noto-cjk.conf ~/.config/fontconfig/conf.d

另外如果要配置英文字體,可以下載 10-latin.conf,修改一下檔案中的字體部份,同樣放進 ~/.config/fontconfig/conf.d 即可。

Nexus One 手機螢幕自己換小筆記

好幾個月前在過馬路的時候不小心把 Nexus One 掉到地上,螢幕立即多了一道裂痕。雖然手機已處於半退役狀態,而且螢幕裂得不嚴重,但看着不爽,索性上淘寶買個螢幕把壞的換掉,也當是練練拆機,況且換不好也無所謂。

Nexus one broken screen

其實拆 Nexus One 不是第一次,由於 Nexus One 的開關鍵有質量問題,很多人用了一段時間後不能開關機,自己也遇到一樣情況,所以當時修過一次。不過換開關鍵比換螢幕要簡單得多。開關鍵在手機頂部,只要拆開頂部的背蓋就可以。但螢幕處於手機的最前方,必須從頭到尾把所有部件拆走。





  • 第一當然是螢幕,在這家淘寶店買,只需 38 RMB,運費 10 RMB 到北京,送貨速度挺快
  • 小十字螺絲批
  • 星型 T4 螺絲批: 之前買的 T4 螺絲批鋼水太差,用了幾次已經滑牙,但發現一字螺絲批也能擰開 T4 螺絲,所以這次先用一字螺絲批代勞。
  • 風筒/熱風槍: 螢幕是被黏着的,要靠熱風才能分解,不一定需要熱風槍,普通的風筒應該足以應付。
  • 萬能膠: 用來把新的螢幕黏回去。





Shared GIT repo over SSH

GIT over SSH will create files with user:group from the user that's doing the push. This will prevent other users from changing files, in particular updating refs/heads/.

To share a GIT repo over SSH among several users, create the repo with --shared=group and put all users in the same primary group:
sudo addgroup git
sudo adduser user1 git
sudo adduser user2 git
git init --bare --shared=group

To fix sharing for an already existent setup, fixup the primary groups and file ownership:
sudo cat /etc/group
sudo usermod -g 1006 -G 1007 user1
sudo usermod -g 1006 -G 1008 user2
sudo chown -R root:git /var/repo.git
sudo git config core.sharedRepository group

where 1006 is the ID of the 'git' group and 1007 and 1008 refer to the user's respective groups.

Specifying the private key for GIT on Windows

If GIT keeps asking for your password, even though you have private key auth set up, then its SSH probably doesn't know which key to use. Fix this by making a "config" file in your user's .ssh folder:
echo IdentityFile ~/.ssh/github_rsa > %USERPROFILE%\.ssh\config

Swap Command and Ctrl for Windows on Mac

Quick registry hack that turns the Mac Command keys into Ctrl keys and turns the left most Ctrl key into the Windows key:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,04,00,00,00,1D,00,5B,E0,1D,E0,5C,E0,5B,E0,1D,00,00,00,00,00

The format of the Scancode Map is as follows: 8 bytes header (all 0x00), 4 byte integer "count", followed by "count" times scancode pairs, with each pair consisting of 2 16-bit scancodes with "to" followed by the "from" scancode.

0x0000 will disable the key. The last pair is always 0x0000 0x0000.

You'll need to restart Windows in order for the map to apply.

Project Naptha – 浏览器里的OCR – 是几个小时前发布的超酷项目,装一个Chrome插件即可在浏览器里支持对图片任意文字的OCR,而且还能翻译。

Project Naptha automatically applies state-of-the-art computer vision algorithms on every image you see while browsing the web. The result is a seamless and intuitive experience, where you can highlight as well as copy and paste and even edit and translate the text formerly trapped within an image.










Upcoming Greenboard deployment

fossasia-group-sOver the past few months we have been busy introducing the Greenboard project in a few places, namely at Teach for China in Shantou and at FOSSASIA in Phnom Penh to name just two places. Both have been very interested in the concept, its flexibility, past deployments and more importantly using it within their environment.

greenboard-teamWe are now working on refurbishing a classroom of sixty computers in a school not too far from Shantou, classroom which was installed ten years ago and has never ever been used. Of course not all the machines start (in fact only 15 out of 60) but the room is properly set up and looks like a very nice place to start in the region. The people we are working with from Teach for China are very motivated as well which brings a lot to the equation.

usaidOn the Cambodian side, the discussions we had with USAID and the representative from the Ministry of Education were very positive too. We will have further discussions during April and need to start checking the translation status of all the components we use. Luckily the person in charge of packaging Greenboard happens to be Cambodian too!

All in all we are pretty excited about what’s coming ahead of us and will work hard to make it happen. Stay connected to learn more as the projects move forward!

Promote OpenClipart on Culture Freedom Day!

As Culture Freedom Day preparation is ongoing I got the chance to meet up with Jon Philips from the Open Clipart Library during FOSSASIA.I actually got to know Jon since about 2007 from the Beijing LUG and we have been doing quite a few things together. CFD events is of course something he definitely cares about. While at the Digital Freedom Foundation we make extensive use of all the great graphics from OpenClipart for our design needs, it is important to help others discover such a useful resource. So Jon kindly authored a video to support us and encourage participants to take a closer look at the Open Clipart Library new website design and functionalities. So without further ado I will let Jon do the presentation and thank him and the Open Clipart Library team for their support! And of course don’t forget to use and showcase the Open Clipart Library at your CFD event!

Celebrate Free Culture with us on May 17!

Culture Freedom Day Registration is on!

Register your CFD event now!

We have just announced that for its third edition Culture Freedom Day‘s registration is ready and awaiting all the passionate organizers to come and be known! As usual the event is planned for the third Saturday of May (the 17th) and appearing on the events map only requires to create an event page under the CFD wiki and fill up the registration form. Then of course you’ll be challenged between finding Free Culture artists in your area and presenting their work, or selecting one of the many projects published under a Free License and showing it to your audience. We are sure a lot of passionate discussions will follow and you’ll be delighted to explain the ins and outs of Free Culture! As Free Culture is indeed one of the most accessible form of art and development issued from the Free Software philosophy, one also used by million if you think of WikiPedia or indirectly Creative Commons, and those are just a few obvious examples!

So all the best for CFD 2014 and see you in two months to party!

Today is Hardware Freedom Day!


For its second edition Hardware Freedom Day is happening with over 40 registered teams and one more sponsor in the name of LulzBot offering 8x3D printers for the event, product which has been RYF-certified by our partner the FSF. Canonical, Google and Linode are of course still part of our long term sponsors and we are trying to reward all our supporters as well. You can find more details on that by looking at the HFD website. So what could you do today? Quite simple, you’re either organizing an event and then you probably hardly have the time to read this message, or you are interested by the concept of Libre/Open hardware and should direct yourself towards our global map to see if there is anything happening in your area. If all the events are too far, then you can check the hackerspaces website and locate a Libre/open hardware hacking place near you. Hopefully you will be able to find something to satisfy your thrust and we wish you the best possible Hardware Freedom Day!

A six classes OS kernel development course

Since year 2010 after I joined Taobao (a subsidiary of Alibaba Group), I help my employer to build a Linux kernel team, to maintain in-house Linux kernel and optimize system performance continuously. The team grew from 1 person to 10 persons in the next 2 years, we made some successful stories by internal projects, while having 200+ patches merged into upstream Linux kernel.

In these 2 years, I found most of programmers had just a little concept on how to write code to cooperate with Linux kernel perfectly. And I found I was not the only person had similar conclusion. A colleague of mine, Zhitong Wang, a system software engineer from Ali Cloud (another subsidiary company of Alibaba Group), asked me whether I had interest to design and promote a course on OS kernel development, to help other junior developers to write better code on Linux servers. We had more then 100K real hardware servers online, if we could help other developers to improve 1% performance in their code, no doubt it would be extremely cool.

Very soon, we agreed on the outline of this course. This was a six classes course, each class taking 120 ~ 150 minutes,


  • First class: Loading Kernel

This class introduced how a runnable OS kernel was loaded by boot loader and how the first instruction of the kernel was executed.

  • Second class: Protected Mode Programming

This class introduced very basic concept on x86 protect mode programming, which was fundamental to rested four classes.

  • Third class: System Call

This class explained how to design and implement system call interface, how priority transfer was happened.

  • Forth class: Process scheduling

We expected people was able to understand how a simplest scheduler was working and how context switch was made.

  • Fifth class: Physical Memory Management

In this class people could have a basic idea that how memory size was detected, how memory was managed before buddy system initialized, how buddy and slab system working.

  • Sixth class: Virtual Memory Management

Finally there were enough back ground knowledge to introduce how memory map, virtual memory area, page fault was designed and implemented, there was also a few slide pages introduces TLB and huge pages.


In next 6 months, Zhitong and I finished first version of  all slides. When Alibaba training department knew we were preparing an OS kernel development training, they helped us to arrange time slots both in Beijing and Hangzhou (Alibaba Group office location). We did the first wave training in 4 months, around 30 persons attended each class. We received a lot of positive feed back beyond our expectation. Many colleagues told me they were too busy to attend all these six classes, and required us to arrange this course again.

This was great encouragement to us. We knew the training material could be better, we yet had better method to make audience understand kernel development more. By this motivation, with many helpful suggestions from Zhitong, I spent half year to re-write all slide pages for all six classes, to make the materials to be more logical, consistent and scrutable.

Thanks to my employer, I may prepare course material in working hours, and accomplish the second wave training earlier. In last two classes, the teaching room was full, even some people had to stand for hours. Again, many colleagues complained they were too busy to miss some of the classes, and asked me to arrange another wave sometime in future.

This is not an easy task, I gave 6 classes both in Beijing and Hangzhou, including Q&A it was more than 30 hours. But I decide to arrange another wave of the course again, maybe start in Oct 2014, to show my honor to all people who helped and encouraged me :-)

Here you may find all slide files for these six classes, they are written in simplified Chinese.
[There are more than enough document in English, but in Chinese the more the better ]

* Class 1: osdev1-loading_kernel
* Class 2: osdev2-protected_mode_programming
* Class 3: osdev3-system_call
* Class 4: osdev4-process_scheduling
* Class 5: osdev5-physical_memory_management
* Class 6: osdev6-virtual_memory_management

Speaking at FOSSASIA 2014 tomorrow!

fossasiaI will be giving a talk tomorrow at FOSSASIA 2014 in Phnom Penh, Cambodia about my work in Open Education. The talk (entitled “Let’s Raise Kids Up”) will be part of the opening keynotes. It will give a quick introduction of the Greenboard project and all the works done around Beijing since 2007. I will also be joining the panel discussion about Women in IT together with Hong Phuc Dang (FOSSASIA), Cat Allman (Google), Sindhu Sundar (GNOME), Sneha Priscilla Makini (GNU Mailman) and Richa Jain (Mediawiki).

If anybody is interested in deploying free and open source projects in schools, I am running a workshop on 1st March (10am) too. I will present all the tips we discovered the hard way from running our own open education project ranging from hardware donation, curriculum design to using Free Software and customizing or translating the possible solution. It will of course talk about GNU/Linux, some of the GNOME and KDE educational applications we are using as well as putting it all together and allowing teachers to control the classroom.
Thanks for Mario Behling and Hong Phuc for hosting such a great event! And of course thanks for FOSSASIA sponsoring my trip to participate!

Introducing Greenboard to Teach For China

greenboard-bannerThanks to Education Freedom Day, we started a conversation with a local NGO here in Shantou, Teach For China which is non-profit working on Chinese education inequity and founded in 2008. They are currently looking at developing some e-learning solutions with the schools they are involved with this year and we have been invited to present Greenboard during their mid-year professional development conference. The conference is happening this weekend (22/33 February) in Shantou, China and we will most likely spend the whole Sunday discussing with their fellows. As we already had a pre-meeting last weekend we feel there are a lot of things which could be used from the work we did in the Beijing area and we are looking forward to share our experience on the matter. Hopefully, we’ll have more to tell soon!

Hardware Freedom Day celebrations 15 March 2014


For its second edition Hardware Freedom Day will be celebrated on March 15th (Saturday) this year. The HFD 2014 registration has been launched about a month ago and the map of currently registered event is available here! This day’s purpose is to get your area familiar with your work and get them interested to join and participate. Should you be a hackerspace or simply a FLOSS user group without a space but with motivation and projects it’s a great opportunity to make the extra effort and get more people to know about what you’re doing.

For registration, simply create a wiki page and fill up this form. Please also make the event shine by using our HFD countdown and banners.

If you want to get some insights for your HFD events, we have had a few ideas submitted to the mailing list to enhance the celebration and we definitely need to see how those can be implemented. In the meantime, get your team ready, your hackerspace (or not) in order and celebrate HFD with us!

Celebrate Hardware Freedom Day with us on March 15, 2014!

InterlockedCompareExchange128 on linux

The GCC that comes with my Fedora installation doesn't appear to have a __sync_val_compare_and_swap that works with __uint128_t, so here it is:
#undef NDEBUG
#include <assert.h>

inline __uint128_t InterlockedCompareExchange128( volatile __uint128_t * src, __uint128_t cmp, __uint128_t with )
  __asm__ __volatile__
      "lock cmpxchg16b %1"
      : "+A" ( cmp )
      , "+m" ( *src )
      : "b" ( (long long)with )
      , "c" ( (long long)(with>>64) )
      : "cc"
  return cmp;

int main(int argc, char* argv[])
  __uint128_t a=0, b=0, c=0x0123456789ABCDEFULL;
  c <<= 64;
  c |= 0xFEDCBA9876543210ULL;
  assert(b == InterlockedCompareExchange128(&a, b, c));
  assert(a == c);
  assert(c == InterlockedCompareExchange128(&a, b, b));
  assert(a == c);
  assert(c == InterlockedCompareExchange128(&a, c, b));
  assert(a == b);
  assert(b == InterlockedCompareExchange128(&a, c, c));
  assert(a == b);
  return 0;

Booting to XBMC under LXDE

I recently reinstalled my HTPC using Fedora 19 and, of course, installed XBMC on it.

Here's how to get Fedora to boot to XBMC without login.

First, configure your desktop manager to auto-login. In my case that is LXDM and it's configured by editing /etc/lxdm/lxdm.conf and adding/changing the line containing autologin=USER with USER being the username of the local user you want to run XBMC as.

Next, change the desktop manager for your user to XBMC. If you install XBMC using the Yum package you should have gotten /usr/share/xsessions/XBMC.desktop so it's enough to create a file called .dmrc in the user's home folder.
cat >~/.dmrc
(End by pressing CTRL-D)

Finally, to prevent XBMC from using CPU when on the home screen, disable the RSS feed by editing the settings for the default skin. Edit ~/.xbmc/userdata/guisettings.xml and change enablerssfeeds to false.

Reboot to confirm XBMC does indeed start automatically after boot and run top remotely to check the CPU usage.

One week to Education Freedom Day

OBPlogoAs Education Freedom Day is just around the corner I would like to highlight a few of the possibilities of participations during that day. I am indeed very happy to see projects contributors getting involved and I would like to highlight the Open Book Project lead by Jeffrey Elkner, Kevin Cole and a few others running their own event in Washington, DC. The Open Book Project has for us some special significance as I am also involved in Free Software advocacy and running educational groups which cover how to program at a young age. Definitely learning to code early enough is a good thing for every one as it teaches you the fundamentals of problem solving and logic. I have been using software such as RUR-PLE myself (part of the GNOME Education Suite) but the Open Book Project goes further and provides all kinds of books, tutorials and courses around the Information & Communication Technology with quite an extensive part on Python itself, split well enough not to bore the kids (or at least that is how I feel). Jeffrey Elkner is also involved in the Guido van Robot programming language which is very similar to the RUR-PLE I love. So why do I care about Python in education would you ask? Well that is probably because the language is simple and close enough to the English language and allows you to do wonders at the same time. So rather than learning something that is only useful within its educational context, why not make the slight extra effort to learn something that is also used by real developers? And it is all Free Software!

Of course those materials are usable by either teachers, students or self-learners and EFD will be a day where you can either join the team in Washington DC or get in touch with them and see how you could contribute without being on site.

openhandbookYet another day and another project needing some love on Education Freedom Day: the Open Education Handbook! Started in September 2013 and initiated by the Open Education Working Group from the Open Knowledge Foundation, the Open Education Handbook initially intended to cover Open Data use in education but has quickly evolved into a document extending to the different aspects of open education, such as resources, data and culture and how those fit together. While it is currently the second version, the targeted final release is for October 2014.

So on Education Freedom Day, the people from Campinas in Brazil, together with interested participants either locally or remotely, will work on a Portuguese translation of the Open Education Handbook. Note that the event is actually happening on Monday 20 January and should you not live in the area feel free to contact them through our Portuguese mailing list. Of course if you are more generally interested in contributing to the Open Education Handbook then looking at the Open Education Working Group mailing list is probably a good way to start.

Celebrate EFD with us on January 18, 2014!Education Freedom Day is happening in many other places and can be a very good way to get involved in Free Educational Resources building or advocacy. In the coming days I will highlight other projects as well. Stay tuned!

Education Freedom Day celebrations 18 January 2014

EFDDigital Freedom Foundation is at it again as we announced last August and we are finally launching our new celebration around Free Educational Resources called Education Freedom Day. The day selected is January 18th 2014 (Saturday) which we believe to be mid school year and a good time to evaluate what has been done and to look at what else could be added. We really hope this can provide a great introduction to educators, professors, teachers and anybody else involved in the education industry about what Free Educational Resources (FER) is, its benefits and how vibrant your local community is.

In the meantime, we are getting more involved with Polytechnic University in Hong Kong thanks to Graham and started to work on our EFD event in Hong Kong. We plan to cover Free and Open Source Software, Hardware and Content for educational purposes by introducing Arduino, Raspberry PiGNOME educational software (e.g. Rur-ple & GCompris) and of course some great international and local Free Educational projects.

Please help us to promote EFD by using our EFD countdown and bannersIf you have contacts with either your local schools, colleges, universities or some open education projects please visit the EFD wiki, create your event page and register your event! If you have any question, please join and ask our EFD mailing list or IRC channel #efday @ Freenode.

Happy Education Freedom Day!
Celebrate EFD with us on January 18, 2014!

Google Code-in 2013 is launched!

GCI-2013-bI would like to share with you that Google (long term sponsor and supporter of the Digital Freedom Foundation) has launched its Code-in 2013 program, an online contest to introduce 13-17 year old pre-university students to free and open source software development. The contest is similar to the Google Summer of Code program for older students in that it gives participants the opportunity to work with mentors from carefully chosen free and source software projects on real-world coding and related tasks like QA, documentation and more. Over the last 3 years over 1200 students from 71 countries have participated. Google hope to expand the program this year and would appreciate your help and that of the members of your community to spread the word to girls and boys around the world.

The contest begins on Monday, November 18th 2013 and runs through January 5th, 2014. Prizes for participating – online only! – in the contest include certificates, tee-shirts, and an all-expenses paid trip to Google headquarters in California, USA for 20 Grand Prize winners with a parent or legal guardian.

You can learn more by watching a screencast and/or a short video describing the contest here and by visiting the program site for complete details here. You can also download a flyer about the program here. Please help to spread the word and get more students involved in FOSS by joining the Google Code-in program!

Meet the Guangzhou LUG

guangzhoulugWe happened to be in Guangzhou earlier this week and spent a wonderful evening with the core members of the local GNU/Linux user group in Guangzhou. They gave us an overview of their group history and progress: basically it is a two years old group with over 700 people subscribed to their mailing list and around 5 core members to manage the group activities. They host regular meetings on a monthly basis in different locations such as restaurants or classrooms. They also organized Software Freedom Day events the past two years and recorded over 100 participants in 2012. While we shared our experiences of how we ran and grew the Beijing GNU/Linux User group with them.

They also mentioned that half of their members are interested in “free” hardware highlighting the growing connection between two movements that we feel very linked. In fact we cannot ignore the fact that hardware needs software to operate and a bit of free culture to make those logos, the documentation and the potential courses that go together to bring it to more people. Each of the movements (software, hardware, culture, OER) should care equally about each others in order to exist as they need one another to thrive. I truly believe that bringing those concepts as one within our communities and to the world will create a bigger impact for everyone.

To conclude, Guangzhou LUG wants to grow in terms of attending members and meeting frequency so we offered to put them in touch with the Shantou Linux Association as they are planning for their upcoming activities right now, and sharing ideas can’t hurt. Besides, there are five universities in Guangzhou with computer science classes which are located in the same area and could become a very prosperous ground for cooperation and activities. That’s another lead right there!

In light of all those discussions and plans we will be hosting a round table discussion mid December on our next visit to Guangzhou. We hope that getting members from each university and setting up a plan together will create a more diverse group in the area with a more balanced workload for everyone.

I am always very happy to meet passionate people from different communities and can’t wait to meet them again soon!

Digital21 Consultation Hong Kong

digital21-2013NovEnd of October saw us visiting Hong Kong another time. While we will not attend the OpenStack Summit the main purpose of our visit was to attend a round table discussion on the government’s digital 21 consultation organized by Charles Mok office and Hong Kong in-Media. We were actually introduced to in-Media by our nice friends from Google and asked to give an overview on Open Data and Open Source, while other participants covered the other fields mentioned in the document.

OpenData has already started in Hong Kong and the government seems to be interested to push the adoption further. While this is a rather positive move, the government probably needs to put some efforts on standardization and improving both the quality and the feedback loop on the available data. On our side we were lucky enough to be assisted by Pia Waugh, former president of Software Freedom Internation and now working for the Australian government implementing Open Data.

(Free and) Open Source unfortunately is not mentioned at all in the document and we covered how important it is for governments to support the effort and what others have been doing for the past ten years. Hong Kong is probably a place where software is mainly imported and the only way to get tailor-made applications which Hong Kong companies can expect specific functionalities to cover their needs is by using Free Software. Not to mention that the government is also planning to bring programming to primary and secondary schools as well as boost start-ups and the SME business in general.
Overall we had a thorough and lengthy debate on those matters and I felt our points were well perceived. We have been recommended to push the discussion directly with the department who wrote the proposal and are now preparing for our next meeting.

In the meantime you can take a look at the slides I wrote to guide the debate here: digital21hk-comments-on-opendata-opensource

SFD2013@ Shantou University

Group photos with the STU Linux Association members.

Group photo with the STU Linux Association members.

After organizing the SFD event in Hong Kong in PolyU, Fred and I were invited to join another SFD event hosted by the Linux Association from Shantou University (STU). We had the pleasure to meet an associate professor of the Computer Science Department, Mr. Liao who is actually a Free Software user himself. The three of us gave presentations about different topics related to software freedom: Fred began with introducing what is Free Software and why it is important, he gave an overview on how the audience could benefit from using and contributing to any Free Software project, including GSoC for next summer. Then I talked about who and what makes Free Software, I started with a quick history review of Free Software and followed by how the audience could get involved and contribute to the community (I reused the slides created by Mathieu for SFD Hong Kong 2013). Mr. Liao presented his experience with Free Software and GNU/Linux as well as introduced a lot of great Free Software projects to the audience.

The event ended up with local desserts and lots of great discussions about how to strengthen the Shantou Linux Association. We also agreed to follow up with core members meetings and mailing list in the following weeks. From what we learnt, they are having a meeting today to kick-start the discussion! By having a professor involved in the process, I believe it can definitely help to build awareness of Free Software in STU. We are definitely looking forward to our next meeting together and committed to help them grow stronger and bigger.

SFD Hong Kong, we had so much fun!

I have been helping to organize a lot of SFD events in mainland China for almost a decade now. Being born and raised in Hong Kong, I was indeed very exited to organize my first SFD in my home town. It was a half day event starting at 13:15, we arrived at the venue at 11:00 to set it up and did some last minute promotion. As for myself I hosted a BoF about building communities in Hong Kong. Since I was told it lacks strong FLOSS communities locally we are considering to start one. Nick Jones from Network Box offered us a venue while Michael Iannini offered to run meetings in Wan-chai (different area so we still need to bridge the two proposals). There are still a few details to be ironed out but it’s a very positive start. Besides, from Naruhiko’s presentation, we learnt that the LibreOffice Japanese team is made of 50 people, so not so much in proportion to the project.

Below you can find snapshots of the great moments, please enjoy!

A huge thank you go to our sponsors, our speakers, our workshop hosts, our exhibitors and especially our volunteers, they are Graham, Michael, Mathieu, Jacqueline, Oi-to, Amity, Ray, See-ming, Messy, Cameron, Guo-feng, Hu-zhou, Xi-lin, etc. Right after the event, I received a lot of thank you notes from our speakers and volunteers for organizing the event and having them to participate. In fact without YOU it would have been impossible to have such a wonderful event! THANK YOU!

There were seven booths including LibreOffice, Stroke5, Blender, GNOME, Fedora, LinuxPilot and HKLUG.

Our exhibitions included LibreOffice, Stroke5, Blender, GNOME, Fedora, DFF, LinuxPilot and HKLUG.

Fedora 20 with GNOME 3.1 was demonstrated in our SFD HK 2013 event.

Fedora 20 with GNOME 3.10 was demonstrated in our SFD HK 2013 event.

An old friend from Beijing, Michael who is the BLUG founder. He was good in bringing the atmosphere up.

An old friend from Beijing and the BLUG founder, Michael was good in bringing up the atmosphere!

Graham from PolyU and DimSumlab, helped us in getting the venue for free and gave an introduction speech to kick start our event.

Graham from PolyU / DimSumLabs, helped us in getting the venue and gave an intro-speech to kick start the event.

Naruhiko Ogasawara, LibreOffice Japan team, came all the way to share with us their project and community in Japan.

Naruhiko from the LibreOffice Japan team, shared with us the project and community in Japan.

TK Kang talked about OLPC and announced his upcoming OLPC BaseCamp event in Malacca on 16-18 November 2013.

TK Kang talked about OLPC and announced the OLPC BaseCamp event in Malacca on 16-18 November 2013.

Nick Jones introduced us how NetworkBox Corporation is profiting from Free and OpenSource software.

Nick Jones explained how Network Box Corporation is profiting from FLOSS.

Fred introduced the Google Summer of Code program to some students during the event.

Fred introduced the Google Summer of Code program to students to join.

A BoF was hosted to discuss about building a stronger FLOSS community in Hong Kong

A BoF was hosted to discuss about building a stronger FLOSS community in HK.


At the end of the event we invited all the speakers to come to the stage to do a wrap up.

We finished the event with beer and local food in Tsim Tsha Tsui East and heading home at 2am with big smile on our face.

We finished the event with beer and local food in Tsim Sha Tsui East and left at 1am with big smiles on our faces.



I keep having to Google this, so I thought it'd just put it up here. This piece of code creates a SECURITY_ATTRIBUTES (and SECURITY_DESCRIPTOR) for the Everyone group. Handy for some quick-n-dirty hacking, but probably A Bad Idea for anything else.

InitializeSecurityDescriptor(&SD, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(&SD, TRUE,(PACL)NULL, FALSE);

sa.nLength = sizeof(sa);
sa.bInheritHandle = FALSE;
sa.lpSecurityDescriptor = &SD

watch for the fish shell

The following command is used to watch the progress of files being updated in a directory.

watch 'du -h *| tail -20 | cut -c -$(($COLUMNS-5))'

cut is used so we don't get linewraps in the output. And we need to subtract 5 from the width because there is a tabstop in there which cut counts as 1 instead of the width of the tabstop (which is 8 minus the width of the size column)

This command works fine as long as files are updated in alphabetical order, but when this is not the case we need to sort files by time.

We need to do something like this instead:

watch 'du -h $(ls -tr)| tail -20 | cut -c -$(($COLUMNS-5))'

Unfortunately this only works if the filenames don't contain spaces.

fish handles spaces in filenames just fine:

du -h (ls -tr)| tail -20 | cut -c -(math $COLUMNS - 5)

So instead of trying to find a solution for dealing with spaces in bash, lets just use a better shell, shall we?

However, watch insists on executing the command with sh -c, so we need to devise our own watch loop for fish instead. That's not really hard:

while true
  du -h (ls -tr) | tail -20 | cut -c -(math $COLUMNS - 5)
  sleep 2

Unfortunately using clear causes an annoying flicker, especially if the du command takes a bit longer.

ANSI escape-sequences help:

while true
  echo \e\[H
  du -h (ls -tr) | tail -20 | cut -c -(math $COLUMNS - 5)
  sleep 2

This causes the cursor to be moved into the top-left corner without clearing the screen. Now we are almost there. Two problems still:
The tab character used to align the columns does not overwrite anything in its space. Likewise at the end of the line, if the newly written line is shorter then the remaining part of the old line is not cleared.

We can fix this with some sed trickery to clear the path:

while true
    echo \e\[H
    du -h (ls -tr) | tail -20 | sed -e 's/^/\x1b\[K/' | cut -c -(math $COLUMNS - 2)
    sleep 2

The ANSI escape sequence ESC[K clears the line just before it is rewritten. This has almost the same effect as clearing the screen, but without the flicker because we only start clearing after du has done its work.
And because the escape sequence adds 3 characters to the output we need to adjust the width accordingly.

At the end we can also add a command to clear the rest of the screen.

Leaves one last issue: $COLUMNS doesn't get updated if the terminal is resized. Granted, it's a nit-pick really, because how often does one resize the terminal. But to make this command generally usable, let's fix this too:

while true
    echo \e\[H
    du -h (ls -tr) | tail -20 | sed -e 's/^/\x1b\[K/' | cut -c -(math (tput cols) - 2)
    echo \e\[0J
    sleep 2

This is now pretty usable, so we'll leave it at that. There is still some room for improvement though. For example we could make the line-count flexible based on the terminal height. Also currently we are estimating that the size column is at least 2 characters wide so the tabstop adds at most 5 characters worth of space which cut does not count. Should it be less then we would get a linewrap again and if it is more then we get empty space at the end of the line. cut likely also has problems with multibyte unicode characters. This can probably be solved by switching the terminal in a no-wrap mode while the command is running, or finding a replacement for cut that handles these issues.


For those who prefer to stick with sh, i found a way how do deal with spaces:

watch 'ls -tr | while IFS= read -r i; do du -h "$i"; done | tail -20 | cut -c -$(($COLUMNS-5))'

OSS feature bounties

I did not like the idea of topic bound donations to OSS projects, but i came to realize that this is not to bad after all to support OSS a bit, but in the direction i like.

The last few days i placed 10 feature bounties each 50 Euro’s on features in various projects that i love to see, but probably never will be realized any time soon. They are just little mini features that i am missing badly in my daily life, but i thought i will try how fast or if at all some of them get implemented.

The nice side effect is that i actually start to work on a few of them myself to avoid a hard hit on my Bank account, a kind of interesting motivation ^_^

GNOME booth in SFD HK 2013

GNOME Booth, photo by

As a GNOME user and fan, knowing that the next major version GNOME 3.10 will be released two days after Software Freedom Day on 23rd September, we are happy to have a booth to showcase GNOME 3.10 on Fedora 20 at our Hong Kong SFD event which will be hosted at PolyU on 21st September, meanwhile I encourage every SFD team to celebrate the new release as well!

While I am still running Fedora 19 with GNOME 3.8.2 I can’t wait to check out the latest version myself with the new features such as maps and music applications, thanks for all the hard works by the GNOME developers, thanks Mathieu for running the booth and of course I will upgrade mine soon! How about you?

Neo4j Server启动失败




export JAVA_HOME=/usr/libexec/java_home -v 1.7


> source ~/.bashrc
> java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

看起来没什么问题,但实际上并没有完成。在/System/Library/Frameworks/JavaVM.framework/Versions 下有一个 CurrentJDK 的symlink,仍然指向JDK 1.6的路径。


> neo4j start
Using additional JVM arguments:  -server -XX:+DisableExplicitGC 
-Djava.util.logging.config.file=conf/ -Dlog4j.configuration=file:conf/ 
-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Dneo4j.ext.udc.source=homebrew
Starting Neo4j Server...WARNING: not changing user
process [29976]... waiting for server to be ready.... Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.


> cd /System/Library/Frameworks/JavaVM.framework/Versions
> sudo rm CurrentJDK
> sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/ CurrentJDK
> ls -l CurrentJDK
lrwxr-xr-x  1 root  wheel  59 Aug 31 01:58 CurrentJDK -> /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/


> neo4j start
Using additional JVM arguments:  -server -XX:+DisableExplicitGC 
-Djava.util.logging.config.file=conf/ -Dlog4j.configuration=file:conf/ 
-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Dneo4j.ext.udc.source=homebrew
Starting Neo4j Server...WARNING: not changing user
process [33636]... waiting for server to be ready....... OK.
Go to http://localhost:7474/webadmin/ for administration interface.

Neo4j Server顺利启动。网上看到有不少人报类似的错,但原因不全是JDK路径问题造成。


SFD Hong Kong getting in shape!

This photo is licensed under an open license - CC-by See-ming Lee

It is with great pleasure that we are opening an optional registration for our Software Freedom Day event in Hong Kong on September 21 at Hong Kong Polytechnic University. It means that first the schedule is positively progressing, while knowing how many of you will attend will allow us to plan accordingly. We are aiming to target both the university audience and the young workforce, on top of presentations and workshops, we (assisted by various communities) will be holding booths (e.g. Fedora, LibreOffice, Blender, Stroke 5, Greenboard) to allow for more individuals discussions. All in all it’s been a joy working on this event, allowing us to talk and plan resources with people from the US, Netherlands, France and Japan, not to mention discovering a great bunch of passionate FOSS people like us in our backyard.

Still, almost 4 weeks to go and plenty of time to get great surprises! If you happen to be in Hong Kong on 21 September, please do register and drop by!


openSuSE Conference 2013 in Thessaloniki, Greece


In recent months, I worked on hard disk I/O latency measurement for our cloud service infrastructure. The initial motivation is to identify almost-broken-but-still-work hard disks, and isolate them from online services. In order to avoid modify core kernel data structure and execution paths, I hacked device mapper module to measure the I/O latency. The implementation is quite simple, just add timestamp “unsigned long start_time_usec” into struct dm_io, when all sub-io of dm_io completed, calculate latency and store it into corresponded data structure.

4 +++ linux-latency/drivers/md/dm.c

13 @@ -60,6 +61,7 @@ struct dm_io {
14 struct bio *bio;
15 unsigned long start_time;
16 spinlock_t endio_lock;
17 + unsigned long start_time_usec;
18 };

After running on around 10 servers from several different cloud services, there are some interesting data and situation observed, which may be helpful for us to identify the relationship between I/O latency and hard disk healthy condition.
It happens that openSuSE Conference 2013 is about to take place in Thessaloniki, Greece, a great opportunity for me to share the interesting data to friends and other developers from openSuSE community.


olympic_museum-1 olymplic_museum-2
Thessaloniki is a beautiful costal city, it is an enjoyed experience that openSuSE conference happens here. The venue is a sports museum (a.k.a Olympic Museum), very nice place for a community conference. When I entered the museum one day early, I saw many volunteers (someone I knew from SuSE and someone I didn’t know who were local community members), they were busy to prepare many stuffs from meeting rooms to booth. I joined to help a little for half day, then back to hotel to prepare my talk slide.


prepare-0prepare-3 prepare-2

prepare-5 prepare-4 prepare-1


This year, I did better, the slide was accomplished 8 hours before my talk, last time in Prague it was 4~5 hours before :-) Much more people showed up beyond my expectation, during and after the talk, a lot communication happened. Some people also suggested me to update the data in next year openSuSE conference. This project is still in quite early stage, I will continue to update information in next time.


This year, I didn’t meet many friends who live in German or Czech Republic, maybe it is because long distance travel and too hot weather. Fortunately one hacker I met this year helped me a lot, he is Olive Neukum. We talked a lot on seq_lock implementation in Linux kernel, he inspired me an idea on non-lock-confliction implementation for seq_lock when reading clock resource in ktime_get(). The idea is simple: if seq number changed after reading the data, just ignore the data and return, do not try again. Because in latency sampling, there is no need to measure I/O latency for every I/O request, if the sampling may be random (lock conflict could be treat as kind of random), the statistic result is still reliable.  Oliver also gave a talk on “speculative execution”, introduced basic idea of speculative execution and the support in glibc and kernel. This is one of the most interesting talks IMHO :-)

During the conference, there were many useful communication happened, e.g. I talked with Andrew Wafaa about possible ARM cooperation in China, with Max Huang about open source promotion, with Izabel Valverde for travel support program. This year, there was a session talked about openSuSE TSP (Travel Support Program) status update. IMHO, all updates about TSP makes this program to be more sustainable, e.g. more explicit travel policy, asking sponsored people to help as volunteer for organization. Indeed, before TSP mentioned this update, I did in this way for years :-) Thanks to openSuSE Travel Support Program, to help me to meet community friends every year, and have the opportunity to share ideas with other hackers and community members.

volunteer ralf
Like Ralf Flaxa said, openSuSE community has its own dependent power and grows healthily. openSuSE conference 2013 is the first time that it happens in a city where no SuSE office located.  I saw many people from local community helped on vane preparation, organization, management, only a few people are SuSE employees. This is impressive, I really feel the power of community, people just show up, take their own role and lead. Next year openSuSE conference 2014 will be in Dubrovnik of Croatia, I believe the community will continue to organize another great event, of cause I will join and help in my way.


[1] slide of my talk can be found here,

[2] live video of my talk, starts from 1:17:30

DFF going into Open Education

greenboard-bannerBeing part of the Digital Freedom Foundation, I would like to share with you some good news!

DFF is announcing its inclusion of the Greenboard project, an Open Education project started in China and focusing on adding FOSS equipped computers to primary schools as a tool to their current curriculum. With years of experience pushing Free Software and OER in poor schools the DFF board has acquired great knowledge of the challenges associated with OER in general and specific educational constraints in particular, assets it is taking to promote around the world.

The first phase will be to publicize all its content into English so it is easily transferable to other places in the world with minimum efforts. Once this is done we will then be able to improve and develop more content while eventually starting to localize our resources to specific regions where opportunities arise.

Our current three international days celebrating and promoting Free Software, Free Culture and Open Hardware will be completed by a fourth day to enhance our efforts as well as bring light to the already existing hundreds of similar projects that the world counts today. The first instance of Education Freedom Day will be on January 18th, 2014.

Even, a missing posix command line utility?

I was looking for a utility that would output every byte at an even offset from a file (e.g. skip bytes at odd offset). I couldn't figure out how to do it with dd (from the looks of it, it might not be possible) and ended up writing my own little utility. I was surprised that there wasn't already a utility called 'even', so here it is:
// even, by Lionello Lunesu, placed in the public domain
#include <stdio.h>

int even(FILE * f)
  char buf[4096];
  int r, read, wrote;
  while (1)
    read = fread(buf, 1, sizeof(buf), f);
    for (r=1; r<read/2; ++r)
      buf[r] = buf[r*2];
    wrote = fwrite(buf, read/2, 1, stdout);
    if (wrote != 1)
      return 1;
    if (read != sizeof(buf))
  return 0;

int main(int argc, char** argv)
  int i, r = 0;
  if (argc == 1 || (argc == 2 && argv[1][0] == '-' && !argv[1][1]))
    return even(stdin);
  for (i=1; i<argc; ++i)
    FILE * f = fopen(argv[i], "r");
    if (f)
      r = even(f);
      if (r)
      r = 2;
  return r;

Interestingly, when compiling with GCC on my MBP, this performs better without any optimization flag, getting >440MB/s!

Oh, this is what I needed it for:
$ ./even * | grep -oai "[a-z0-9_]*\.dll"

Allow Google email forwarding through SPF

Use "" in your SPF record: 300 IN TXT "v=spf1 a mx -all

Check your /var/log/mail.log to make sure it's working as expected:
Aug 10 08:30:05 pizzapazzi postfix/smtpd[23061]: connect from[]
Aug 10 08:30:12 pizzapazzi postfix/policy-spf[23074]: : SPF pass (Mechanism '' matched): Envelope-from:
Aug 10 08:30:12 pizzapazzi postfix/policy-spf[23074]: handler sender_policy_framework: is decisive.

basic http file server

I needed to quickly serve some files, and i didn't want to install a full webserver, knowing that this was only temporary. So instead here is a simple http file-server in Pike. I call it a file-server because it serves static files, and nothing else.

Based on this example for a simple web-server, it just takes a few additions to turn this into a file-server:


constant default_port = 8080;
constant my_version = "0.0";

Protocols.HTTP.Server.Port port;

string basedir = "/srv/www";

int main(int argc, array(string) argv)
  int my_port = default_port;
  if(argc>1) my_port=(int)argv[1];

  write("SocServe starting on port %d\n", my_port);

  port = Protocols.HTTP.Server.Port(handle_request, my_port);
  return -1;

void handle_request(Protocols.HTTP.Server.Request request)
  write(sprintf("got request: %O\n", request));

  mapping response = ([]);

  response->server="SocServe " + my_version;

  string target = Stdio.append_path(basedir, request->not_query);
  mixed tstat = file_stat(target);
  write("target: %O\n", tstat);

  if (tstat 
& tstat->isdir)
    response->type = "text/html";
    response->error = 200;
    response->data = dirlist(target);
  else if (tstat 
& tstat->isreg)
    response->type = MIME.ext_to_media_type((target/".")[-1]) || "octet/stream";
    response->error = 200;
    response->file = Stdio.File(target);
    response->type = "text/html";
    response->error = 200;
    response->request = sprintf("%O", mkmapping(indices(request), values(request)));
    response->data = "<h1>SocServe " + my_version + "</h1>n<pre>"
    + response->request + "</pre>n";


string dirlist(string path)
  array dir = get_dir(path);
  return sprintf("%{<a href=\"%s\">%s</a><br>\n%}", ({ dir[*], dir[*] })); 

These are the changes: first combine the request path with our basedir which will reduce any embedded /../ to not go beyond that base. Then we check if it's a directory or a file. For a directory we make a simple listing, and for a file we find the mime-type and then just open the file and pass it to the request. This will cause the file to be served with non-blocking I/O, allowing you to handle multiple requests in parallel without blocking the server while a file is being downloaded.

That's all there is to it. Start it up, and it's ready to serve files.

Great to meet you in GNOME.Asia 2013 in Seoul

I might be the latest one to write report after attend the GNOME.Asia, but that does not mean I do not taken it sincerely. To attend GNOME.Asia always give me opportunity to meet many GNOMERS and participants and have a very wonderful experience. My buckets are full of spiritual rewards. Some by the generous spirite of sharing from others, some learned, some my humble creation.

I’d like especially to thank Eric Sun, Which I missed his topic “The soul’s code of Taiwan campus” in the conference, and he gladly showed his presentation with me alone after his speech:) I like Eric Sun’s creativity design for the Ezgo, and like his passion in Ezgo.

I also want to thank Max and Karen, Max always encouraging me on my speech. Karen, she actually came to listened my speech “Web design done in GNOME and how I did my last GOPW”, despite my poor delivery:) I also enjoyed the talk with her.

In my speech “Web design done in GNOME” I started with my own story to show how I getting in touched with Opensource, and introduced my paraphernalia of my web design work: GIMP, Inkscape, jEdit, fileZilla.

Also, I was glad to see my design elements in GOPW have been used in GNOME.Asia :)

BTW: I found, especially in Adacamp, women geeks tends dress alike. A typical ensemble include a T-shirt, jean, sports shoes, a pair of glasses. That is, they dress like male geeks. This time, I thought since my naive existence is an unavoidable reduction to the entropy of geeky heat, I might as well be hanged for a sheep as a lamb, so I dressed a red dress with flowery ribbon, my usual ensemble. It isn’t exaggerated dressing at all, nevertheless sparked curiosity. Some tried to verify that I am not a programmer, and succeeded;) perhaps before getting his wager. Should I bash the bias of perceiving women geeks, mostly also feminists, as unfeminine, or did it backfire, having myself tagged as a naive non-programmer? In other words, should I fight by dressing like not fighting at all? [Yes, my husband tightened this paragraph for me. It had been much longer.]

Thanks GNOME Foundation sponsored me to attend the GNOME.Asia in Seoul, thanks the Taiwan and local organizers who have held such a great event for us.

GPG key transition: 7BD22F74 → D28DA8DC

I should have transitioned my old GPG key to a stronger one for long time, it’s finally done today, with the help of here and here. You can find my signed letter at I am also copying the letter below for your convenience.

Hash: SHA256,SHA1

Due to rapid advancement of computing, my old 1024-bit DSA GPG key,
which was created 14 years ago in 1999, has long been deemed insecure.
Therefore, I am transitioning to a much stronger 8192-bit RSA key, by
using a slightly modified gnupg in [1], as the default gnupg does
not allow creation of keys greater than 4096-bit. Hopefully this new
key can survive much longer.

The old key will continue to be valid for some time, but I prefer all
future correspondence to come to the new one. I would also like this
new key to be re-integrated into the web of trust.  This message is
signed by both keys to certify the transition.

If you have signed my old key, I would appreciate signatures on my new
key as well, provided that your signing policy permits that without
reauthenticating me.

The old key, which I am transitioning away from, is:

pub   1024D/7BD22F74 1999-09-12
      Key fingerprint = CD09 4F7B BBEE 93CD 7966  6299 34B3 A9A0 7BD2 2F74
uid          Anthony Y. P. Wong (Personal) <>

And the new key is:

pub   8192R/D28DA8DC 2013-06-01
      Key fingerprint = 8DF0 9030 F103 F760 C18C  BA06 605A A53D D28D A8DC
uid          Anthony Y. P. Wong (黃彥邦) <>

To fetch the new key from a public key server using GnuPG, run:

  gpg --keyserver --recv-key D28DA8DC

If you have already validated my old key, you can then validate that the
new key is signed by my old key:

  gpg --check-sigs D28DA8DC

If you are satisfied that you've got the right key, and the UIDs match
what you expect, I'd appreciate if you would sign my new key.

A simple and safe way to do that is by using caff (shipped in
Debian/Ubuntu as part of the "signing-party" package) as follows:

  caff D28DA8DC

Alternatively, you can sign the key by using gpg and send it to me (if
you have a functional MTA configured on your system) or upload the
signatures to a public keyserver directly:

  gpg --sign-key D28DA8DC
  gpg --armor --export D28DA8DC | mail -s 'OpenPGP Signatures' \
  gpg --keyserver --send-key D28DA8DC

Please let me know if there is any trouble, and sorry for the


Anthony Wong

Version: GnuPG v1.4.11 (GNU/Linux)


Running QQ on Ubuntu Phone

Courtesy to an open source project called uqq on Github, it is now possible to not only run QQ on Linux, but also on Ubuntu Phone! As Ubuntu phone is still under heavy development, and the current SDK is limited for QML-only apps, it is not an easy task to deploy uqq onto the phone, as it uses C++ for its backend. If you are adventurous, you can follow my steps below.

2013-05-19-03-02-38_photo 2013-05-19-03-31-17_photo 2013-05-19-03-32-01_photo 2013-05-19-03-32-35_photo

1. Get uqq

  1. git clone

2. Cross-compile uqq C++ plugin

  1. Create an armhf build environment: # pbuilder-dist raring armhf create
  2. Login to the armhf environment: # pbuilder-dist raring armhf login
  3. You are now in a chroot in /var/cache/pbuilder/build/<PID>, where <PID> is the process ID of the command in the last step.
  4. Copy uqq source code to /tmp in the chroot, something like “sudo cp -a uqq /var/cache/pbuilder/build/<PID>/tmp“.
  5. Add QT5 and Ubuntu SDK apt sources:

    # cat << EOF > /etc/apt/sources.list.d/qt5-and-ubuntu-sdk.list
    deb precise main
    deb precise main

    (apt-add-repository core dumped for me so I had to add the sources manually.)
  6. Install Ubuntu SDK: # apt-get update && apt-get install ubuntu-sdk
  7. Compile the uqq backend plugin: # cd /tmp/uqq/plugin && qmake && make
  8. will be compiled in /tmp/uqq/plugin/UQQ if everything works well.
  9. Copy back to your uqq directory, e.g. # cp /var/cache/pbuilder/build/<PID>/tmp/uqq/plugin/UQQ/ uqq/plugin/UQQ/

3. Copy the app to the phone

  1. Connect your phone to the computer via USB.
  2. # adb root
  3. Copy the uqq source code and our compiled plugin to the phone: # adb push uqq /data/ubuntu/home/phablet/uqq
  4. Login to the phone: # adb shell
  5. Type "ubuntu_chroot".
  6. Type "su - phablet" to change to the phablet user.
  7. Now we are ready to run QQ, type "/usr/bin/qmlscene -I plugin /home/phablet/uqq/uqq.qml --desktop_file_hint=/home/phablet/uqq/uqq.desktop".
  8. uqq window should now appear on your phone!
  9. Since ubuntu phone does not ship with any Chinese font, all Chinese characters will be shown as squares. It can be easily fixed by copying /usr/share/fonts/truetype/droid/DroidSansFallback.ttf from any Ubuntu system to the phone's /usr/share/fonts/truetype.

    I still haven't figured out how to add an icon to the launcher for the app, I tried modifying /usr/share/qml-phone-shell/Applications/applications.js, but no luck.

    Hope you find this useful!

The dark side of memes

Nehal Patel is one of the unsung heroes of Web 1.0.

Lolcats, Advice Dog, Courage Wolf, Trollface and every god-awful modern meme owes its lineage to Patel, who during his freshman year at the University of Illinois dedicated his disk space to telling the world how Mr. T ate his balls.

The page spawned countless copycats, several Webrings and an entire branch of links in Yahoo!’s directory.

Ate-My-Balls managed to grab mainstream attention via a rambling article on and coverage by the Miami Herald’s Dave Barry.

While I never made an Ate-My-Balls site, I did end up hosting one: Faelan Ate My Balls.

In 1999, TCI came to the northern Detroit area with promises of the first dedicated, always-on Internet connection priced less than $10,000 per month. You just had to hide your Unix box from the installation crew.

My friend Justin and I got together to cannibalize the family’s broken Packard Bell Legend 100 to turn into a FreeBSD Web server.

But this post is not about my short-lived server: it&rsuos about Faelan.

Faelan Peregrin Aragorn exploded onto the Internet with his Faelan’s Sweetheart Contest. Or rather, his parents Jonathan and Sarah Aragorn did.

The page was made to look as though it as prepared by an innocent little boy who was looking for a girl who was “fun, slender, gentle and nice, smart, romantic and loyal.”

What can I say? Back in 1999, the mainstream Internet was rarely seeking a cancer-stricken cocaine whore who loves rough plushie sex and bondage. We were such noobs.

Hi! I am a cute (people say) young (eleven) boy (for sure) and I’m going to have a CONTEST to see which GIRL in the whole world will be the best SWEETHEART and GIRLFRIEND for me!

The only thing the site was missing was a blink tag.

While the Web mocked and giggled at Faelan’ contest and made Ate-My-Balls pages about the “little monkey man,” more serious people were asking serious questions.

Joab Jackson, a Baltimore City Paper Online columnist, wrote:

Could an 11-year-old really have designed a Web page as elaborate as this one? Could his parents really have approved of him looking for a girlfriend over the Internet? Could any parents be stupid enough to let their daughter participate in such a thing?

Today, Jackson would be branded a lulz-killer. At the time, we never heard of his article because Google didn’t exist and Webcrawler was a piece of shit.

Faelan soon updated his site to clarify his quest. He wanted a girl with “nice parents who believe that love and touching are good, and think that you should have the freedom to do all these things.”

I’m sorry, I missed that. Is he talking about fucking?

In sprite of complaints lobbed at the Web host, the page could not be removed because it was not technically engaged in illegal activity. Solicitation of sexual contact with a minor is apparently legal in Oregon.

In October 1999, the contest ended and 11-year-old Faelan vanished into the darkness of the Web.

Where did he go? I had no idea, and neither did Jackson. But being a professional journalist, he investigated.

Jonathan Aragorn, 44, a reported holder of degrees in clinical psychology, education and computer science, was convicted on multiple counts of solicitation to commit sexual abuse and criminal conspiracy to commit sexual abuse. He was sentenced on February 22, 2000, my 18th birthday, to 19 months in prison and a five-year probation.

His wife was found guilty of conspiracy and was put on a three-month probation, because women cannot be sexual predators.

If you are interested in learning more about the Faelan case since Jackson’s original report, you can read the State of Oregon v. Jonathan and Sarah Aragorn.

The crux of the parents’ defense was that Oregon Statute 163.345 provides “In any prosecution… in which the victim’s lack of consent is due solely to incapacity to consent by reason of being less than a specified age, it is a defense that the actor was less than three years older than the victim at the time of the alleged offense.”

Since this statute kept Faelan out of jail, Mr. and Mrs. Aragorn said it should apply to them as well.

The appeals disagreed and gave Jonathan a “Go Back to Jail Free” card.

This horrible story taught me a very important lesson: when I decided to open a cyber-harem for my son, I should not do it in Oregon.

But there is a happy ending to this sordid story.

In 2011, Faelan finally found a legal sweetheart and married her on Christmas Day in St. Lucie County, Florida.

The post The dark side of memes appeared first on Derrick Sobodash.

Sexual miseducation

When to start sex education is one of the most debated topics in modern elementary education. We debate it because, as humans, we like to pretend our intervention can halt the inevitable.

A few years ago, third grade boys at a local elementary school made the news when some educator decided the best way to teach them about sex was to make them crawl through holes and find a female classmate to make a baby.

I grew up in the United States during the Ronald Reagan years.

I remember the weekly Legend of Zelda slot of the Super Mario Bros. Super Show being canceled so they could run footage of cranes busting apart the Berlin Wall on Friday, December 22, 1989: Day Two of the demolition, so let there be no question of my ’80s street cred.

In the two decades since, I’ve learned that humans will fuck regardless of the age at which they begin sex education.

In Michigan, “sex education” began at age nine with a video.

On that special day, our four fourth grade class was split up. The girls were led across the brown carpet and out through the white-brick hallway by three female teachers who slammed the door behind them.

The school’s lone male educator stayed behind to deal with the boys.

And so we sat, confused and staring ahead at the screen that was supposed to answer all our sexual questions — like what in the fuck sex was.

As a nine-year-old, the closest I had come to sex was seeing a Madonna video and watching the kid was on his fourth run through the fourth grade doodle penises on my homework.

Nevertheless, the lights dimmed as they rolled-in media center television: the old cathode ray monstrosity that came seatbelted to its cart.

The screen crackled to life, and the dead blue signal gave way to images of flowers waving in the breeze.

The scene changed to a lone bee buzzing about a flower and digging around inside it, coating its hairs with rich pollen before taking off. The voice-over introduced pollination, carpels and stamen before switching to a cartoon that, to use the vernacular of our times, was full of epic fail!

The screen went blue, which made me think the VCR had failed. I soon realized that this was intentional, as the bottom of the screen turned brown.

Suddenly, a female fish swam by. I could tell she was female because she had a Ms. Pac-Man bow in her scales. Her asshole opened and a pile of black bubbles fell out all over the floor of the pond.

Moments later, an excited fish without a ribbon swam by and casually pissed all over these bubbles.

In stunning three-second-per-frame animation, the bubbles developed into baby fish that broke out and swam away for reasons left unexplained. The video then made a hard cut to a 30-second clip of a baby suckling at a woman’s breast.

The tape ended and the blue signal returned. The fever dream of sexual education was at an end. Our obviously bored teacher asked the last thing you should ask a fourth grader after such a video.

“Any questions?”

If I had access to my adult vocabulary, I might have asked, “Just one. What the fuck was that?”

I believe that fish video corrupted a generation.

It doesn’t take a degree in psychiatry to notice how the sudden interest in water sports that has taken root in this post–fish-video world.

I’m willing to bet that in twenty years, Japan will rise to the challenge of providing today’s eight-year-olds with the “unbirth” fetish porn they are sure to crave.

I can’t help but wonder if these sexual education classes are really needed. Aside from some basic clues about the life cycle, we were left with essentially no knowledge.

Condoms were not introduced until some time in eighth grade.

While I have no evidence to back this up, it is my hunch that polls about sexual activity among elementary and middle school students fail to take into account the fact that virtually every student lies about being a virgin to avoid being laughed at — even when they don’t know what a virgin is.

Now, to be fair, the video was not our only sexual education experience.

Four years later, we were given the chance to write our sexual questions on slips of paper and drop them into a sealed box “to avoid embarrassment.” That turned out to be a good move given the stunning number of boys asking things like, “What is a dildo and how do I use it?”

Today, such a question would probably require a discussion about safe practices in urethral sounding.

Our third and final bout of sex education came another four years later, this time as an entire semester on love and marriage taught during my senior year at a Catholic high school.

When the floor opened to questions, a concerned girl raised her hand to ask this:

“Is it possible for my boyfriend to pee in my vagina?”

Clearly, someone else had seen the fish video.

The post Sexual miseducation appeared first on Derrick Sobodash.

Show current GIT branch in TCC

I'm getting more and more familiar with the GIT workflow, which goes kinda like this:
git checkout -b topicbranchX
git add somefile
git commit -m"commit message"
git pull
git rebase master
git push

Unfortunately this means that you'll end up with a bunch of branches (which you can delete once they get pulled into origin/master) but I keep forgetting what branch I currently have checked out. I've seen bash prompts that show the current branch and I decided to do something similar for TCC/LE.
@cl "/Tp%~f0" /nologo /GS- /link /SUBSYSTEM:console /nodefaultlib /entry:_main kernel32.lib
@goto :EOF
#include <windows.h>
const WCHAR root[] = L"..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\.git\\HEAD";
int __stdcall _main() {
  int offset = sizeof(root)/2 - 10;
  while (offset >= 0) {
    HANDLE h = CreateFileW(root + offset, GENERIC_READ, FILE_SHARE_READ, NULL, 
    if (h != INVALID_HANDLE_VALUE) {
      char buf[64];
      DWORD read = 0;
      if (ReadFile(h, buf, sizeof(buf), &read, NULL) && read > 16) {
        DWORD off = 0;
        DWORD len = 7;            // show 7 hex digits
        if ((int&)buf[0] == ':fer') {
          off = 16;               // skip ref: refs/heads/
          len = read - off ;     // keep LF
        WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buf + off, len, NULL, NULL);
      return 13 - offset / 3;
    offset -= 3;
  return 0;

What's fun about this file is that you can save it as "gb.cmd". When you then enter "gb" on the command line, it will actually invoke the C compiler (remember to run vcvars32) to generate the gb.exe. Next time, the exe will be invoked instead.

This is the final prompt:
prompt %%@exec[@gb.exe]$e[1m$P$e[0m$_$+$g

The great adventure

No matter what language we use, death is a sticky topic for us humans: especially in common speech. Reporters can use that sterile, icy word to describe the passing of a celebrity, but we mostly avoid it in polite conversation.

Your cat can die. Your phone’s battery can die. Your computer’s network connection can die.

But grandma? Grandma doesn’t die: she passes away or passes on.

Many cultures are uncomfortable with death. The ancient Egyptians simply said said someone journeyed west. That might not seem so bad in China, where the journey west was great fun for the Monkey King. Chinese people prefer head off to a whole new world! It’s more exciting than Japan, where dear grandma simply ends up lost.

World-over, you would be hard-pressed to find a culture more terrified of death and dying than modern America. Every doctor’s office in the US has a wall of pamphlets ready to introduce the odd new idea.

When an American’s number is up, he just takes the big sleep. If he’s not ready to move on up, he will go out kicking.

Americans like to kick a lot of things, especially buckets and cans. The less aggressive prefer to kiss the dust before they’ve left the building for a little slumber.

If they’re hungry, they can bite the big one or bite the dust. Queen fans seem to be the biggest on biting. I’m guessing the Eagles’ listeners prefer gambling: they cash in their chips before checking out to go climb the Golden Staircase – or, if I may nod to Led Zepplin, pay the piper and climb the Stairway to Heaven.

And what does an American do once he’s up there?

Well, after it’s curtains, he’ll be cooking for the Kennedys — if he’s a good enough cook, he might get a chance to join the angels in the sweet hereafter. Regardless of his culinary skills, he can rest assured that he will be joining the majority.

And we don’t like to think about this, but not everyone gets to climbs the staircase. Some people have to walk the downward path and spend eternity in the dread abode.

Every now and then, one unlucky guy simply fades away and ends up on the road to nowhere. If you one day find yourself stuck with nowhere to go, I suggest you roll over and give Byron’s dreamless sleep a try — it sounds like a good chance to get in a few eternal yawns.

If sleeping and staircases aren’t for you, the gangsters say you can give up the ghost and go sleep with the fishes — usually this one requires some assistance to pull off. If there’s no time to get a pair of cement shoes, you may just end up six feet under — but that’s a great place to be if you’re going into the fertilizer business!

However you choose to fade out, it seems a great chance for one last party. I’ve never been a fan of formal-wear, but traitors don’t seem to mind. They go to a necktie party when they die. Serial killers get ride the lightning – I saw that one while it was under construction at Cedar Point and it looked like a coaster fan’s wet dream.

When they’re not kidnapping Korean fishermen for ransom, pirates cover a lot of ground both here and in the hereafter. Sometimes they take a long rest on the Fiddler’s Green, but if they haven’t had enough briny sea-air, they can flag down the Flying Dutchman for eternal adventure.

The unlucky ones get dragged down to Davy Jones’s Locker.

In this modern age of science, computer geeks have one of the most creative ways to get exported to a flat file — they’re formatted. I suppose it works because, these days, most of them are Hindus.

Writers are less lucky. We tend to end up lost in translation after moving into upper-management. After that, we just go permanently out of print.

Almost every one of these adventures sounds preferable to plain vanilla death.

Yet in spite of how gaily they jest about the next great adventure, Americans squirm when someone casually mentions the “D” word.

When you get down to it, death is just a part of life, and it’s one most aren’t prepared to face. But we have to face it eventually. George Carlin said death is the one thing that’s truly democratic: everyone gets it once.

But I think I have a solution to our departing dilemma: a word so when it’s time for each of us to express-mail our soul to the god of our choice, none needs bat an eye. It’s perfect, because despite that last god reference, it works for atheists too.


Doesn’t that sound nice? “Grandpa was recalled while he was on the table. He won’t be joining us for Christmas.”

Imagine the dialogue between a nurse and a man who’s wife died in labor. “Mr. Smith, I’m sorry to inform you your wife’s labor had complications. She was recalled.”

Factories can recall bad products: some even recall old products. Car companies do it all the time — especially Firestone, famous for its tires that explode after 500 miles.

Let’s face it, products deteriorate with age, and some are way too dangerous to be allowed on the road: look no further than any 60-year-old granny behind the wheel of her Cadillac STS Child Shredder if you need an example.

So lets all try to bring this word into common use. It’s sterile enough for the politically correct, and it’s accurate.

The post The great adventure appeared first on Derrick Sobodash.

Share some design works for GNOME.Asia

Poster: Training session in the GNOME.Asia Summit 2013
Training session in the GNOME.Asia Summit 2013

T-Shirt: Let us to meet GNOMERS
Let us to meet GNOMERS


Certificate of Training -Template
Certificate of Training

HFD swag posted despite LibreOffice…

A year without blogging… I thought I would never succeed! Don’t get me wrong I do write quite a lot online, I have too, and my blog really gets some thing once everything else is written.

So without further ado I will show you a beautiful photo of the balloons we are sending for HFD (taken by Pockey and licensed under CC-BY to HFD):
HFD Balloons

Now why did the HFD swag leave only today (instead of Saturday as they should have)? Well I think I suck at LibreOffice: once a year I am used to take my “latest” copy of LibreOffice and remember how to print labels for all the teams in the world. SFD is of course a lot bigger than HFD but it’s been going on since 2004. Either way it kind of used to work, with a lot of glitches, but it was working. The last time I used LibreOffice I felt I had to complain to one of the main developer and so I found out that I was running a two year old release. This time after trying the latest available version under the latest Fedora and not being successful I went for an upgrade and am now running release 4.0.1! Yes, 4.0.1! Well let me tell you that not only the “optional” address line that some teams have and some don’t always print and there is no way to automatically do without it, but worth, even after selecting “database” as source (the other modes didn’t find the sheet whether under 3.6 or 4.0.1) I ended up with 11 pages of 8 labels for 53 teams. Yes you read me right… that is somewhere between 81 and 88 mailing addresses. What happens is that LibreOffice simply duplicates some of the addresses it takes from the database, and not next to one another, just randomly. So while the first 5 pages printed ok (oh yeah, they print only odd page numbers. So page 2 becomes 3, 3 becomes 5 and so on. I have no idea why but that’s the standard way) I started to find a second team from Japan. We only had one team in Japan, so I checked: same name, same address. Then next to it was the same team from India, then a new team, then a redundant team and so on, without any logic. After trying different “technique” to get only 53 teams in my labels, I had for only choice to finish the printing under a non-free office software running under a non-free operating system. This was a lot easier in many ways and I really pity the people who have no other choices. In fact I truly wonder how they manage.

Let me show you a beautiful second photo bearing the same license as the previous one, so you’ll be even more happy to have registered early:
HFD Swag
All is not lost and I will join the few people who have complained about the feature being less than usable for office workers. Hopefully the new bug miscalculating the number of recipient will be easy to correct and the whole clarity of the function will start to take shape. I sometimes really wonder how people use free office software, not being a user myself. And often the five minutes a year I dive in end up taking me the whole week and not wanting to go back. Hopefully those five minutes will be more valuable this year!

vim tips: capitalize the first word of every sentence

To solve this problem i found this useful solution, but discovered that it didn't cover all cases i had.


To start with, \U does not mean every not-uppercase letter, but every character from the whole set that is not uppercase. So it includes spaces and everything else. This causes the expression to match " hello world!" if the sentence doesn't start at the beginning of the line, which is not quite what we want. To get every non-uppercase (that is lowercase) letter use \l. But even that does not really work, because it means that now it matches "Hello world." as "ello world.", and we get a transformation as "HEllo world!". Again, not what we are looking for. Unfortunately, until someone can suggest a method to skip already capitalized sentences we have to stick to \w.

Next, the expression only excludes periods, but not question-marks, exclamations or other sentence ending characters. We can extend this by simply including the respective characters: [^\.?!:;]. We also do not need to enforce the terminating character, we can simply drop that. What we really want to match is the beginning of the sentence, we don't care about the end.

Also, unless the text is in all uppercase, lower-casing the second group could be counter productive as it would affect upper-cased acronyms etc. that are already there.

Lastly, we want to capture sentences spanning multiple lines, lest every line gets matched as a separate sentence. This is achieved using \_.

(And inside a character set the . doesn't need to be escaped.)

Putting it all together we get s/\v(\w)(\_[^.?!:;]*)/\u\1\2/g

Instead of matching a whole sentence we can also try searching for the end of the previous sentence: s/\v(%^|[.?!:;]\_s+)(\a)/\1\u\2/g

Interview with Shanghai TV

A few weeks ago I got interviewed by Shanghai TV about the Shanghai hackerspace 新车间 (XinCheJian) that I'm part of. In the interview I demonstrate one of the hacks I did, using a TP-Link router to open the machine room.

(No, that's not actually the password for our machine room.)

@GBlock also has a video on the hack on his Vimeo page.

Website under maintenance / Online shop still accessible

The website back-office is experiencing some issues and we currently cannot add content on the website. We are working on it and hope to be able to offer a new Read more... (

Set IE10 InPrivate as default

Do this by adding "-private" to the shortcut in the taskbar. Right-click on the IE logo in the taskbar. Then, right-click on "Internet Explorer" and click "Properties". In the properties dialog, add a space and then -private to the end of the Target. OK.

If IE is not currently running, right-clicking the IE logo in the task bar and selecting "Open new tab" opens a new, non-InPrivate, tab.

Set IE10 InPrivate as default

IE10 properties

Google sabotaging Windows Phone clients?

(Disclaimer: I'm a Software Engineer for Microsoft China. In this blog I express my personal opinion and none of this constitutes the official nor unofficial opinion of Microsoft.)

UPDATE: this issue also hit The Verge. The information in this thread also confirms that Google tests for "Windows Phone", as opposed to testing for specific browser capabilities. Gizmodo also posted the story.

I make no secret of the fact that, while I like my (Microsoft sponsored) Windows Phone, I miss Google Maps. For me, Google Maps was the killer app for Android. And the experience is great, even in China, with vector maps, buildings, public transport, subway exits, real-time traffic, latitude.

But Google Maps wasn't enough to keep me on Android. I thought the Windows Phone experience was better overall and I ended up using by Nokia Lumia 800 over my HTC Desire S. For maps, I keep switching between Nokia Maps and GMaps Pro, an unofficial Google Maps client for WP. And occasionally I'd simply go to with IE. Well, I used to, anyway.

Lately (as of a few months ago) opening on my WinPhone simply redirects me to Google Search. Even the Chinese site,, no longer opens on my WinPhone. Switching IE from Mobile to Desktop mode also doesn't fix the issue, and I keep getting redirected to a regular search page (under the domain, but it's still regular search, without maps.)

My first thought was that the IE browser on WP7.5 "Mango" was simply not supported by Google. So I fired up the WP8 emulator to check whether Google Maps would open on the mobile version of IE10. Sure enough, it didn't. However, this time switching IE to Desktop mode did solve the problem and I got the regular desktop experience, albeit on a small screen.

That's suspicious, I thought, since the browser is exactly the same, whether I use mobile mode or desktop mode. I figure I'd manually try the different User-Agents to see what would happen:
  • WP7 - Mobile Version
    Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Nokia 800)
    HTTP/1.1 302 Found

  • WP7 - Desktop Version
    Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; XBLWP7; ZuneWP7)
    HTTP/1.1 302 Found

  • WP8 - Mobile Version
    Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; Microsoft; Virtual)
    HTTP/1.1 302 Found

  • WP8 - Desktop Version
    Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; ARM; Touch; WPDesktop)
    HTTP/1.1 200 OK

  • Win8 - Desktop Browser
    Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
    HTTP/1.1 200 OK

  • Win8 - "Metro" Modern Browser
    Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)
    HTTP/1.1 200 OK

Interestingly, as soon as a device identifies itself as a Windows Phone (or WP7) it gets redirected. In other cases it gets the actual Google Maps page. As a test I wanted to replace the User-Agent from my WP7 device with the one from an Android device. Here's how:
sudo apt-get privoxy
sudo vi /etc/privoxy/default.actions
Add this to the end:
{+hide-user-agent{Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus One Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1)}}
Change listen-address to listen on a public IP:
sudo vi /etc/privoxy/config
sudo /etc/init.d/privoxy restart
On the WP device, change the proxy for your current WLAN profile to point to your instance of Privoxy.

Et voilà, you got Google Maps on WP7, albeit a little flaky. It might be that Google preferred WP user to have no experience to them having a flaky one, but that still doesn't explain why it's redirecting WP8 IE when in Mobile mode.

Now here's what's interesting. As soon as I add "Windows Phone" to the User-Agent, the page no longer loads and I get redirected again. Clearly there's some regex magic at work on Google's end.

As much as I agree with Hanlon's razor "Never attribute to malice that which is adequately explained by stupidity," this does reek of Google being disingenuous and blocking the competition from their platform's killing app.

And it's not as-if they haven't done shit like this before.

Oh, and Happy New Year!

pidgin merged windows

For people who are using tiling Window manager like me (awesome) there is a great plugin for pidgin, this merges the buddy list with the tabbed chat window.



openSUSE Conference 2012 in Prague

In Oct 20 ~ 23, I was invited and sponsored by openSUSE to give a talk on openSUSE Conference (OSC2012). The venue was Czech Technical University in Prague, Czech Republic, a beautiful university (without wall) in a beautiful city.

It was 5 years ago since last time I visited Prague (for SuSE Labs conference), as well as 3 years ago since last time I attended openSUSE conference as speaker, which was OSC2009 in Nuremberg. In OSC 2009, the topic of my talk was “porting openSUSE to MIPS platform”, this was a Google summer of code project accomplished by Eryu Guan (being Redhat employee after graduated). At that time, almost all active kernel developers from China were hired by multi-national companies, few local company (not include university and institute) in China contributed patch to Linux kernel. In year 2009, after Wensong Zhang (original author of Linux Virtual Server) joined Taobao, this local e-business company was willing to optimize Linux kernel for their online servers and contribute patches back to Linux kernel community. IMHO, this was a small but important change in China, it should be my honor if I was able to be involved into this change. Therefore in June 2010, I left SuSE Labs and joined Taobao, to help this company to build a kernel engineering team.

From the first day since the team was built, the team and I applicate many ideas which I learned/learn from SuSE/openSUSE kernel engineering. E.g. how to corporate with kernel community, how to organize kernel patches, how to integrate kernel patches and kernel tree with build system. After 2+ years, with great support from Wensong and other senior managers, Taobao kernel team grows to 10 persons, we contribute 160+ patches into Linux upstream kernel, becoming one of the most active Linux kernel development teams in China. Colleagues from other departments and product lines recognize the value of Linux kernel maintenance and performance optimization, while we open all projects information and kernel patches to people outside the company. With the knowledge learned from openSUSE engineering, we lay a solid foundation on Taobao kernel development/maintenance procedure.

This time the topic of my talk is “Linux kernel development/maintenance in Taobao — what we learn from openSUSE engineering“, this is an effort to say “Thank you” to openSUSE community. Thanks to openSUSE conference organization team, I have the opportunity to introduce what we learn from openSUSE and contribute to community in past 2+ years. The slide file can be downloaded here, if any one is interested on this talk.

Back to openSUSE conference 2 years later is a happy and sweet experience, especially meeting many old friends whom we worked together for years. I met people from YaST team, server team and SuSE Labs, as well as some ones no longer serve for SUSE but still active in opneSUSE community. Thanks to the conference organization team again, to make us have the rare and unique chance to do face-to-face communication, especially for community members like me who is not located in Europe and has to take oversea travel.

The conference venue in first 2 days was inside building of FIT ČVUT (Faculty of Information Technology of Czech Technical University in Prague). There were many meeting rooms available inside the build, so that dozen of talks, seminar, BOF were able to happen concurrently. I have to say, in order to accommodate 600+ registered audience, choosing such a large venue is really a great idea. In Monday the venue moved to another building, though there were less meeting room, the main room (where my talk was in) was bigger.



CPU power talk by Thomas Renninger

Cgroup usage by Petr Baudiš

After talking with many speakers out of the meeting room, and chair a BOF of Linux Cgroup (control group, especially forcus on memory and I/O control), there were some non-linux-kernel talks abstracted me quite a lot. Though all the slides and video records can be found from internet (thanks to organization team again ^_^), I would like to share the talk by Thijs de Vries, which impressed me among many excellent talks.



Thijs de Vries: Gamification – using game elements and tactics in a non-game context

Thijs de Vries was from a game design company (correct me if I am wrong), in this talk he explained many design principles and practices in the company. He mentioned when they planed to design a game, there were 3 objects to considerate, which in turn were project, procedure and product. A project was built for the plan, a procedure was set during the project execution, a product was shipped as the output of the project. I do like this idea for design, it’s something new and helpful to me. Then he introduced how to make people have fun, involved into the game, and understand the knowledge from the game. In Thijs’ talk, it seems designing funny rules and goals is not difficult, but IMHO an educational game with funny rules and social goals is not easy to design even with every hard and careful effort. From his talk, I strongly felt innovation and genius of design (indeed not only game) from a different way which I never met and imagined before.

Beside orthodox conference talks, a lot conversation also happened outside the meeting room. Alexander Graf mentioned the effort to enable SUSE Linux on ARM boxes, which was a very interesting topic for people who looking for low power hardware like me. For some workload from Taobao, powerful x86 CPU does not help any more to performance, replacing them with low power ARM CPU may save lot of money on power and thermal expenditure. Currently the project seems going well, I hope the product may be shipped in the near future. Jiaju Zhang also introduced his proposal on a distributed clustering protocol which called Booth. We talked about the idea of Booth last year, it was good to see this idea came to a real project step by step. As a file system developer, some discussion about btrfs and OCFS2 happened with SuSE Labs people as well. For btrfs it was unanimous that this file system was not ready for large scale deployment yet, people from Fujitsu, Oracle, SuSE, Redhat, and other organizations were working hard to improve the quality to product usage. For OCFS2, we talked about file system freeze among cluster, there was little initial effort since last 2 years, a very incipient idea was discussed on how to freeze write I/O among each node in the cluster. It seems OCFS2 is in maintenance status currently, hope someday I (or someone else) have time and interest to work on this interesting and useful feature.
This article just part of my experience from openSUSE conference. OSC2012 was well organized, included but not limited to schedule, venue, video record, meal, travel, hotel, .etc. Here I should thank several people who help me to attend the great conference once again,

  • People behind, who accept my proposal
  • People behind, who kindly offer the sponsorship for my travel
  • Stella Rouzi, who helped me on visa application
  • Andreas Jaeger, Lars Muller, and other people who encourage me to give a talk on OSC2012.
  • Alexader Graf and others who review my slide

Finally, if you have interest to find more information about openSUSE conference 2012, these URL may be informative,

Conference schedule:
Conference video:
Slide of my talk:
Video of my talk:


Diaoyu Bazinga

Was just reading some news about this Japanese fisherman just placing flags on the islands.

edited photo

Planet BLUG

Planet BLUG is a window into the world, work and lives of Beijing LUG members and contributors.

Updated on December 22, 2014 - 03:03 UTC.
Entries are normalised to UTC time.


Atom 0.3
RSS 1.0
RSS 2.0


Brought to you by the Planet aggregator, cron, Python, CANDIS Group (who kindly host the BLUG server). Beautiful template adapted from an early design by Steven Garrity, concept by Seth Nickell and Diana Fong.

Planet BLUG is edited by Fred. Please contact him if you have a question or would like your blog added to the feed.