La Vita è Bella

Tuesday, August 12, 2008

Note: how to delete an error calendar in Lightning

As Bug #428274, I can't accept any meeting requests sent to my work mailbox, and have to add the meetings into Lightning manually. This is really annoying. As the bug got fixed, I decided to upgrade Lightning to a 0.9pre nightly to get it working.

After upgrading, the following error dialog will greet me every time I start Thunderbird:

The error message after I upgrade Lightning to 0.9pre nightly

I googled this error message and found that it was caused by the incompatible extension ThunderBirthDay. OK, delete the calendar should fix it. No! The calendar was hide from Lightning's calendar list!

Fine, downgrade Lightning and then remove the calendar should work. But unfortunately, Lightning 0.9 have changed the storage format and can't downgrade to 0.8 anymore.

So how to delete that calendar? Maybe I should delete the calendar direct from Lightning's storage. According to the official FAQ, it's stored as an SQLite database file.

Under Thunderbird's profile directory, I got a "storage.sdb" file. I tried to use the command line sqlite to open it, and it works:

$ sqlite3 storage.sdb 
SQLite version 3.5.0
Enter ".help" for instructions
sqlite> .tables
cal_attachments              cal_metadata               
cal_attendees                cal_properties             
cal_calendar_schema_version  cal_recurrence             
cal_calendars                cal_relations              
cal_calendars_prefs          cal_todos                  
cal_calmgr_schema_version    cal_tz_version             
cal_events                 

The "cal_calendars" table seems to be the one I'm looking for:

sqlite> select * from cal_calendars;
1|storage|moz-profile-calendar://
2|thunderbirthday|moz-abmdbdirectory://abook.mab

Yes it is! so I need to know how to delete that record:

sqlite> .schema cal_calendars
CREATE TABLE cal_calendars (id INTEGER PRIMARY KEY, type TEXT, uri TEXT);

OK, then this should work:

sqlite> delete from cal_calendars where type = "thunderbirthday";
sqlite> select * from cal_calendars;
1|storage|moz-profile-calendar://

It DOES work!

Now my Thunderbird is quiet on starting.

But, the guys in Lightning really should give a chance to delete calendars that aren't compatible. I should file a bug for it. I've filed Bug #450121!



tags: , , ,

00:51:44 by fishy - opensource - Permanent Link

no comments yet - no trackbacks yet - karma: 0 [+/-]

Friday, July 11, 2008

Don't try to fool compilers

There's a macro in ACE to eliminate a compiler warning:

379 // Some compilers complain about "statement with no effect" with (a).
380 // This eliminates the warnings, and no code is generated for the null
381 // conditional statement.  @note that may only be true if -O is enabled,
382 // such as with GreenHills (ghs) 1.8.8.
383 # define ACE_UNUSED_ARG(a) do {/* null */} while (&a == 0)

But when I use this macro, gcc 4.3 will complain:

warning: the address of ‘a’ will never be NULL



tags: , , , ,

12:25:52 by fishy - dev - Permanent Link

no comments yet - no trackbacks yet - karma: 1 [+/-]

Monday, May 26, 2008

Miao cancelled

I've started the Miao project one year ago, aim to build a smart pinyin input method for Mac. But I just got a new job 2 weeks after I started this project. This is quite a busy year, and I haven't really wrote much code for it.

A month ago Yong Sun from Sun begin to port SunPinyin to Mac, and now it's more than just works. I'm satisfied with the Mac port and use it everyday. As the Miao project is scratching my own itch, and I'm not itchy anymore, I should call it a day.

Sorry for anyone who waits for Miao, but I'm not going to reinvent the wheel.



tags: , , , , , ,

20:29:46 by fishy - opensource - Permanent Link

1 comment - no trackbacks yet - karma: 0 [+/-]

Wednesday, May 07, 2008

Some facts about Apple Time Capsule performance

On the Mac side, the initial backup takes me about 6 hours to backup 126GB data, by ethernet cable, so the speed is about 20GB/hr.

The writing speed via 802.11n wireless is as below:

fishy@Makelele:~/Video$ dd if=Pixar\ -\ Lifted.wmv of=/Volumes/Cacapa-1/foo.wmv
91582+1 records in
91582+1 records out
46890385 bytes transferred in 15.478993 secs (3029292 bytes/sec)

That's about 3MB/s. So I think the speed on Mac is acceptable, but it should be faster.

On the Linux side, I use Debian Lenny, with samba, afpfs-ng and a 100M ethernet cable (my Linux machine didn't come with a Gigabit ethernet port). The facts are:

Writing via AFP:

root@deBoer:~# dd if=prog03.mdb of=foo/foo.mdb
8736+0 records in
8736+0 records out
4472832 bytes (4.5 MB) copied, 6.89061 s, 649 kB/s

Writing via SMB:

root@deBoer:~# dd if=prog03.mdb of=/media/cacapa/bar.mdb
8736+0 records in
8736+0 records out
4472832 bytes (4.5 MB) copied, 6.57683 s, 680 kB/s

Reading via AFP:

root@deBoer:~# dd if=foo/bar.mdb of=bar.mdb
8736+0 records in
8736+0 records out
4472832 bytes (4.5 MB) copied, 8.87068 s, 504 kB/s

Reading via SMB:

root@deBoer:~# dd if=/media/cacapa/foo.mdb of=foo.mdb
8736+0 records in
8736+0 records out
4472832 bytes (4.5 MB) copied, 0.919922 s, 4.9 MB/s

So the conclusion is that, for writing, AFP and SMB are both slow. But for reading, SMB is much much faster than AFP, so you should use SMB to connect a Time Capsule on Linux.



tags: , , , , , , , ,

23:19:25 by fishy - General - Permanent Link

1 comment - 1 trackback - karma: 1 [+/-]

Tuesday, April 29, 2008

Apple Time Capsule hand on

After long waiting, I got one finally.

The box:

Time Capsule - the box

Unboxing:

Time Capsule - unboxing

And then working!

Time Capsule - working

And here's a note, the command to limit my 1TB Time Capsule use only 500G for backup (so that I can use the other 500G for other stuffs), according to the comment of this hint:

hdiutil resize -size 500g -shrinkonly /Volumes/path/to/sparsebundle/

But the speed of backup is really really slow, that disappointed me. What a shame! It would be perfect if the backup speed up.



tags: , , , , , ,

20:28:59 by fishy - General - Permanent Link

no comments yet - no trackbacks yet - karma: 1 [+/-]

Monday, April 14, 2008

Flickr Video vs. Youtube

Finally, Video on Flickr!

I've uploaded a test video:

And here's the same video on youtube, to be compared:

So here's the comparison:

So, from now on, I may move from youtube to flickr, flickr rocks!



tags: , , ,

22:03:36 by fishy - General - Permanent Link

1 comment - no trackbacks yet - karma: 0 [+/-]

Sunday, December 02, 2007

Yet another NP_Trackback hack

I've got an email from my host administrator to warn me that one of my MySQL table consumed lots of system load, and the table is nucleus_trackback.

But I haven't got any "real" trackbacks, so they are all spams, and more accurate, crazy spams, that simply too much to overload my DB.

So I have to wrote this patch to add an option to NP_Trackback: drop blocked trackbacks directly. After enabled, trackbacks that blocked by NP_Trackback (failed spam test or no link) will not be stored into the DB.



tags: , , , , , ,

12:35:40 by fishy - opensource - Permanent Link

no comments yet - no trackbacks yet - karma: 2 [+/-]

Monday, November 19, 2007

AFP versus SMB

I have a Linux file server in my home running Debian Lenny, and I always use SMB for file sharing, it have a very very bad performance. Today I suddenly remember Apple have an AFP protocol, so gave it a try.

I use "apt-cache search afp" to find out that there's a package named "netatalk" can provide AFP file sharing, so install it. But I can only login use guest account, not my system user, from Leopard.

I googled it and found that the problem is: on the Debian side, as a license issue, the Debian package didn't come with SSL support; on the Leopard side, it didn't allow you exchange your password with AFP server without SSL. So the solution is build netatalk yourself, with SSL.

The building steps are described on this blog, and I also disabled atalkd as the author suggested, it caused netatalk to start-up much faster than before.

So finally I got a AFP server for my Mac (compare this icon to the famous BSOD icon for SMB servers in Leopard :P ):

AFP server icon in Leopard

And as expected, AFP is much much faster than SMB, here's the write test:

For AFP:

fishy@McManaman:~$ dd if=/dev/zero of=/Volumes/Home\ Directory/foo
^C57345+0 records in
57345+0 records out
29360640 bytes (29 MB) copied, 11.0833 s, 2.6 MB/s

And for SMB:

fishy@McManaman:~$ dd if=/dev/zero of=/Volumes/fishy/bar
^C4235+0 records in
4235+0 records out
2168320 bytes (2.2 MB) copied, 10.6889 s, 203 kB/s

I'm impressed!



tags: , , , , , ,

22:38:32 by fishy - linux - Permanent Link

4 comments - no trackbacks yet - karma: 5 [+/-]

Saturday, October 27, 2007

Gmail IMAP and Date in emails

UPDATE: As in RFC 2822, the format Gmail used is "obsolete", which means although it's not recommended, clients such as Thunderbird should support it.

Finally I've got my Gmail account with IMAP access. I use Thunderbird as the mail client, and find that the "date" of many mails are the time I retrieved them via IMAP, which is incorrect.

These mails including gtalk chat logs and Gmail invitation accepted responses, that means most of the mails are sent/generated by Gmail.

An incorrect date mail have a Date line in the headers like this:

Date: Fri, 1 Dec 2006 05:35:25 -0800 (PST)

And a normal mail have a Date line in the headers like this:

Date: Thu, 21 Dec 2006 19:16:34 +0800

Seems that the problem is, Thunderbird didn't recognize a Date line with a 3-letter timezone description(the "PST" in this example), so it use the date retrieved instead.

As most of mail clients (even Gmail itself) didn't add this timezone description in the Date line while sending a mail, I guess it's Gmail's fault to add it into the chat logs and invitation responses to make it unstandard? Anyone can tell me what's the definition in the RFC?



tags: , , , ,

16:54:37 by fishy - General - Permanent Link

1 comment - 1 trackback - karma: -11 [+/-]

Sunday, September 16, 2007

Patches to make NucleusCMS plugins multi-blog ready

I was struggling to find a good multi-blog system to replace LifeType used on buddie5.com in the past few weeks. I've tried Movable Type but didn't feel satisfy with it. Finally I found that NucleusCMS, which is used here, have good support for multi-blog, so I think it's the solution for me.

Although NucleusCMS itself have good support for multi-blog, as it's mainly used as a single blog system like WordPress, nearly none of the plugins considered the multi-blog situation.

So I made patches for the plugins I used, to make them multi-blog ready.

These patches generally move some option from global to blog, so that every blog can have its own setting. And for some plugins that have an admin area, I also filtered the things it can admin to avoid security risk.



tags: , , , , , , , , ,

22:06:35 by fishy - opensource - Permanent Link

9 comments - no trackbacks yet - karma: 9 [+/-]

A blog about open source, patches, thoughts and geeks