Tuesday, October 06, 2009

Leica X1 and Panasonic GF1 - somebody swapped their LCDs ?

DPReview's Leica X1 preview says:
Curiously, the X1 uses a 4:3 LCD to view images from its 3:2 sensor, while the GF1 employs a 3:2 LCD and a 4:3 sensor. The GF1's control layout is again much more 'electronic'; the X1 will appeal to those looking for a more straightforward, traditional design.

What's up with that ? Did Leica and Panasonic exchange their designers in the middle of development ? It's even more perculiar, that X1 body is wider than GF1, so wider 3:2 screen would fit better with X1.

Saturday, September 12, 2009

Turning pogoplug into a TimeMachine

Disclaimer first: this is not really fully tested - I haven't tried restoring from TimeMachine backup yet. So there's a chance that this won't really work in the end.

Described below is the (somewhat convoluted) steps I did to get this working. It would be really nice if someone can clean this up, submit the patch to netatalk, create an Optware netatalk package with proper configuration, and another Optware package for pogoplug/timemachine configuration example files... In theory, it should be possible to make "ipkg install pogoplug-timemachine" just "Do The Right Thing". Anyway, here goes the steps:

1) Install gcc, autoconf, automake, dbus, openssl, avahi, libgcrypt from Optware ipkg (it's possible I might have missed a few packages though).
2) Download berkeleydb source from here, unzip/untar, and then build/install by:
$ cd db-4.7.25/build_unix
$ ./dist/configure --prefix=/opt --with-gnu-ld
$ make
$ make install
3) Download netatalk source package somehow. I used CVS following this instruction but it looks like you can download the tarball from sourceforge as well. Once you download/untar it, you can build/install it by:
$ cd netatalk
$ CFLAGS="-O -DSHADOWPW" CPPFLAGS="-I/opt/include" LDFLAGS="-L/opt/lib -Wl,-rpath,/opt/lib" ./configure --prefix=/opt --with-ssl-dir=/opt/ --with-bdb=/opt/ --with-shadow --with-cnid-cdb-backend --enable-afp3
$ make
$ make install
3-1) If your pogoplug mounted disk is formatted in FAT or NTFS, those disks are mounted as root by pogoplug's daemon (hbplug). So you need afpd to be able to run as root. By default, afpd does not allow this to happen. The patch below fixes that - by adding a new option "-[no]allowroot". If you want that, apply the following patch before doing "make" above (if you don't know what patch is, or what to do with the following file, you probably don't want to do this anyway), but understand that this increases the security exposure:

Index: afp_options.c
===================================================================
RCS file: /cvsroot/netatalk/netatalk/etc/afpd/afp_options.c,v
retrieving revision 1.45
diff -r1.45 afp_options.c
212a213,216
> if (strstr(buf, " -noallowroot"))
> options->flags &= ~OPTION_ALLOW_ROOT;
> if (strstr(buf, " -allowroot"))
> options->flags |= OPTION_ALLOW_ROOT;
Index: auth.c
===================================================================
RCS file: /cvsroot/netatalk/netatalk/etc/afpd/auth.c,v
retrieving revision 1.63
diff -r1.63 auth.c
255c255,256
< if ( pwd->pw_uid == 0 ) { /* don't allow root login */
---
> if (!(obj->options.flags & OPTION_ALLOW_ROOT)
> && pwd->pw_uid == 0 ) { /* don't allow root login */
Index: globals.h
===================================================================
RCS file: /cvsroot/netatalk/netatalk/etc/afpd/globals.h,v
retrieving revision 1.26
diff -r1.26 globals.h
39a40
> #define OPTION_ALLOW_ROOT (1 << 8)
cvs diff: Diffing nls

4) Set up dbus to use avahi, by creating a file /opt/etc/dbus-1/system.d/avahi-dbus.conf with the following content:

<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

<!-- Only root or user avahi can own the Avahi service -->
<policy user="avahi">
<allow own="org.freedesktop.Avahi"/>
</policy>
<policy user="root">
<allow own="org.freedesktop.Avahi"/>
</policy>

<!-- Allow anyone to invoke methods on Avahi server, except SetHostName -->
<policy context="default">
<allow send_destination="org.freedesktop.Avahi"/>
<allow receive_sender="org.freedesktop.Avahi"/>

<deny send_interface="org.freedesktop.Avahi.Server" send_member="SetHostName"/>
</policy>

<!-- Allow everything, including access to SetHostName to users of the group "netdev"
<policy group="netdev">
<allow send_destination="org.freedesktop.Avahi"/>
<allow receive_sender="org.freedesktop.Avahi"/>
</policy>
-->
</busconfig>

5) Setup avahi to find aftpd by creating a file /opt/etc/avahi/services/aftpd.service with:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>

And edit /opt/etc/avahi/avahi-daemon.conf and set "host-name" to what you want (you probably want to use a different name than the hostname of pogoplug itself, as using the same would make it a bit more cubersome to use samba and afp simultanenously).

6) Now it's time to configure afpd. Edit /opt/etc/netatalk/afpd.conf and add the following line:
- -transall -uamlist uams_dhx2.so -nosavepassword -allowroot
The key part is "uams_dhx2.so" - as far as I tried, this and uams_guest.so were the only UAMS modules that worked with OSX 10.5.8. "-allowroot" would only work if you applied my patch above.

7) You need to set up with "directory" to be exported. Edit /opt/etc/netatalk/AppleVolumes.default, and add a line like (it's supposed to be in a single line):
/tmp/.cemnt/mnt_sda1/TimeMachine TimeMachine allow:root rwlist:root dbpath:/tmp/cdb.db cnidscheme:cdb options:usedots
This would export /tmp/.cemnt/mnt_sda1/TimeMachine directory as a volume named TimeMachine.

8) Create an empty file named ".com.apple.timemachine.supported" in the top directory of the exported volume you want to use as timemachine. e.g.:

$ touch /tmp/.cemnt/mnt_sda1/TimeMachine/.com.apple.timemachine.supported

9) Start all daemons if they haven't started yet.

$ /opt/etc/init.d/S20dbus start
$ /opt/etc/init.d/afpd start

10) Now you should see a Xserve icon in Finder's network view (Shared -> All). Click it, and it will ask for a login and a password - give it the login and the password for pogoplug. You can use root (if you used the patch above), or you can create your own user but in that case you need that user be able to write to the volume. Once you have mounted the TimeMachine volume (that has .com.apple.timemachine.supported file at the root), the system preference -> TimeMachine -> Change disk should display the pogoplug as a TimeMachine disk:

Now the TimeMachine backup should work, though no guarantee it will restore - my backup is still in progress :)

PS. I used the information from following pages:


and possibly some others which I forget.

There was one website that explained setting up avahi/netatalk very well (where I took some of the config files), but I can't remember or find that site now. So I might be missing a few things related to avahi above :(

Saturday, September 05, 2009

Pogoplug performance through AFP

Apparently, netatalk/afpd can push files much more efficiently than samba - I get roughly 20MB/s over gigabit ethernet, compared to roughly 10MB/s with samba. Pogoplug keeps getting better :)

Pogoplug and AFPD, some progress, some roadblock

It turns out it's relatively straightforward to get afpd (in netatalk package from ipkg) running and have OSX talk to pogoplug through AFP as Guest user (this How-To turns out to be quite useful) - you need to set uam_guest.so as uam module, and use usedots option (I'll post my config later). However, I can't seem to get the authentication working yet. Since I can control the guest user id on pogoplug side, this wouldn't be such a big problem, except I have my disk formatted as NTFS and hbplug mounts the disk as root with default umask 755 AND afpd doesn't allow me to set uid 0 as the guest user. :( Hence, currently I can only read from pogoplug, but not write and thus I can't get this working as timemachine yet.

For proper authentication, I'm guessing I'd need to recompile netatalk package with ssl support as the How-To says (though I couldn't verify whether ipkg netatalk has that support included, I'm guessing it doesn't based on syslog output). Well, I tried to download the source from here, but somehow cvs anon login fails for me. Oh well. Till my next spare time...

Thursday, September 03, 2009

Pogoplug/samba/OSX/time machine



I copied a bunch of video files from Pogoplug to my MBP using Samba. And it could do slightly better than 10MB/s when connected through the gigabit. This is more than acceptable performance - at this speed, I don't need/want to install pogoplug kernel driver on OSX. Another happy combination. But this got me thinking... if Pogoplug can act as a native Windows storage system, why not native Apple storage ? So I've started working on turning Pogoplug into a time machine using avahi and netatalk. I haven't got it working but at least pogoplug shows up on Finder's Network view as if it's an Xserve :) Hopefully I'll get some spare time to dig this more and get it working soon...

Sunday, August 23, 2009

MBP, why I still use it

Despite the fact that I've been suffering quite a bit from OSX, I'll probably continue to use it at this point, because:
  1. Fantastic keys in the keyboard. I really liked Thinkpad keyboards (my first laptop was Thinkpad 560, and I've been a user of T-series, including T43p). However, I really get to like MBP's keyboard keys. It has just the right amount of key travel distance, and spaced just right, and can be pressed small amount of force, unlike some other keyboards, yet it's not overly soft. In other words, it's the goldilocks of the laptop keyboard for me.
  2. Battery life. T43p lasted barely 2 hours, and I used to carry extra battery. MBP lasts easily 4 hours, and more like 5 hours. Practically I can carry around all workday without charging.
  3. Performance. Whatever I can say, MBP is fast enough for what I used it for. It's almost never a bottleneck for my use.
I'd guess #3 will be similar in other laptops with similar hardware. So it's not really MBP's advantage. That said, things I wish the most:
  1. Page up/down, home/end keys. Out of all keys, I miss those four keys the most.
  2. Fast way to cycle through the windows, instead of applications, without touching the mouse.
  3. Less awkward keyboard shortcut for copy and paste (I guess I'll have to practice two-handed copy-and-paste - pressing c/v with left hand and right-command with right hand). If only left command key was slightly moved toward right, by reducing the space key a bit - as is, either I have to move my whole left hand/palm to press left command key with my left thumb, or my left thumb has to bend a lot to press it. Awkward either way.
  4. Consistent keyboard shortcuts between applications. I'm still quite confused of shortcuts in many applications. Not the app specific ones, but more basic ones like beginning-of-the-line and end-of-the-line, page-down and page-up, beginning-of-the-page and end-of-the-page. And also how certain shortcut combos are treated differently depending on whether a textbox has a focus or not. It's all confusing and annoying. e.g. I mapped ^-T to be "New Tab" in Safari, but if the focus is in the text area, it doesn't open a new tab. Instead, I think it does "transpose" of the last two characters. :(

OSX pain continues...

Skype crashes on the startup. I tried deleting plist files (system default and personal), no success. Disabled firewall, no success. System is up-to-date and yet, Skype continues to crash upon login to Skype.

Then, Open Office didn't start up upon the first use. Had to force-kill it, then open up an existing file. Now it can start up without opening an existing file. But nonetheless very weird.

I tried mapping ^-C and ^-V as copy and paste for all applications, but it didn't work on Terminal. Then I removed the mapping for all applications, but the terminal application continued to show ^-C and ^-V as the shortcut and it didn't work. So, in that state, all applications except Terminal used %-C and %-V, but Terminal had no functional shortcut for cut and paste. Eventually restarting the terminal removed this annoyance, but it again shows the keyboard shortcuts (and its customization) are a very sore thumb in OSX.

Tuesday, August 18, 2009

Not all keyboard shortcuts are equal, part 2

I tried mapping ^-L to "open location..." menu item in Safari. And guess what? It doesn't work, despite the fact that the menu shows ^-L next to "open location..." item. I don't know what Safari does with my ^-L stroke. Of course, clicking a menu item "open location..." works. So it must be that something eats my ^-L in Safari. Arg :(
Chrome works fine, but Chrome-on-OSX isn't quite ready for prime time (it's already much faster than Safari, but there are enough things that don't work yet on Chrome, and it's also not quite as stable). So until Chrome becomes stable enough, I guess I'll have to suffer...


In OSX land, not all keyboard shortcuts are equal...

I think I'm giving up on using command key as the shortcut - it's just too awkward to use everyday. So I've ended up overriding a lot of shortcuts using control- combo. ^-C ^-V ^-X ^-T ^-N all know works as everywhere else, and with caps lock mapped to control, my thumb doesn't have to bend to press command and something else.

However, one inconsistency in Safari and Chrome still bugs me. I've remapped tab movements to be control-up/down both for Chrome and Safari. The problem is, in Safari, if the focus is in a text box inside a page, the new shortcuts don't work. What's funny is that the original shortcuts (control-tab and shift-control-tab) work fine even when the focus is in a text area.

*sigh*

So, on Mac, not all keyboard shortcuts are equal :(

Monday, August 10, 2009

Mac OS X: "Not enough disk space can cause directory corruption"

...at least according to one Apple employee named Carolyn Samit:

http://discussions.apple.com/thread.jspa?threadID=2086575&tstart=0

I was just looking for a solution to my MBP hanging problem, and encountered this particular post. I'm just hoping that this is just a clueless tech support type person perpetuating unsubstantiated personal opinion (which flies in the face of the basic principles of the operating system/file system design, and I'd almost interpret it as a slander/libel against OS X), but since I can't know if this "Carolyn" is a lowly tech support or Apple's filesystem engineer, I'll have to assume that this is Apple's position.

I tried to post a reply asking for clarification, and Apple rejected it. Below is the email Apple sent me about the removal.

Dear Seongbae (S. Park),

Apple removed your post on Apple Discussions titled "Re: Random freeze/not-responding in 10.5.7" because it contained the following:

Rude or inappropriate language
Non-constructive rants or complaints

We are including a copy of your post at the end of this email for your reference.

Our terms of use, which include helpful information about using Apple Discussions, is located here: http://discussions.apple.com/help.jspa We encourage you to continue using the Apple Discussions while abiding by our terms of use.

If you would like to send feedback to Apple about a product, please use the appropriate selection here:http://www.apple.com/feedback

As part of submitting feedback, please read the Unsolicited Idea Submission Policy linked to the feedback page.

Kind regards,
Apple Discussions staff

++++++++++

This message is sent from a send-only email account. Any replies sent to this address are deleted automatically by the system.

----------

A copy of your message for reference:

I'm suffering from this same problem, and this makes my new MBP 15" one of the worst systems I've ever owned in my past 10 years (the last time I remember having this kind of random instability issue is Windows 98).

I hope you're either joking or hopefully just half-informed when you said "Make sure there is always 15% free disk space. Not enough disk space can cause directory corruption".
What you're saying is essentially Mac OS filesystem can not function correctly with less than 15% free disk space. Can you substantiate this claim ? Since you're an Apple employee, can I take your word as an official Apple advice and publish this ?