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 ?

Tuesday, August 04, 2009

Mac convert, another focus oddity

Try this with your Mac:
Fire up any application and have a window that has a scroll bar.
Then using Expose, switch to any other window that's smaller than the first window, so that at least part of the first window can be seen. Then move your mouse cursor on top of the first window (i.e the one that doesn't have focus), and try scrolling. The scrolling would work - even though the application itself is not in focus. It's as if scroll event uses "focus-follows-mouse" principle. Confusing? Hell, yeah. However, I'd still call this useful. If only I can type as well...


Saturday, August 01, 2009

Mac convert, sync between Address book and Google Contacts

This article shows a complicated workaround - if you want to try this, make sure you read all the comments as well - to enable Address book and Google contacts sync. Why on earth Apple hides the Google sync option from Address Book's preference is anyone's guess. I find it incredulous that I have to edit plist to fake, and go through manually invoking a command on the terminal to get this working... Clearly this isn't something Apple wants to make users happy about.

Tuesday, July 28, 2009

Mac convert, week 2 - necessary customizations

I've ended up doing a few "jumping-over-the-hoop" type of customization to make this box more useable for me, and the following is the list so far:

Caps Lock as Control.
It's indispensable. However, this isn't as good as on Windows or Linux, because of Command-vs-Control split on Mac - on Windows or Linux, control key is the most frequently used modifier for keyboard shortcuts, hence having caps lock mapped to control naturally makes the most frequently access modifier key more accessible. That benefit is only half on Mac, because a lot of shortcuts use Command key instead of Control. While some of the key mappings can be changed to use control, not everything can (i.e. if there's no corresponding menu item). So I still have to press the awkwardly located Command key.

Auto-hide the menu bar.
When I run Chrome or Terminal, I rarely need the menu bar because 99% of things I want daily can be done through the keyboard shortcut or mouse gesture or anything already in the window that I don't want that precious vertical screen real estate wasted (especially given the vertically-short screen of MBP, the top is much more useful than the bottom - after all, at least the bottom third of the screen is outside the ergonomically comfortable viewing area, even when the MBP is sitting on a desk). I don't want the menu bar always hanging there. Thankfully, at least there's a way to change this through editing info.plist for each application. So now I have Terminal, Chrome, Safari and Picasa with menu bar hiding. This gives me back the nice, clean look of each application with more vertical real estate (if you haven't guessed yet, I have Doc also set to auto-hide). This isn't all happy news BTW. If you use Spaces to move windows to a different space, auto-hide menu bar sometimes breaks. I haven't figured out exactly when this happens, but when this happens, the menu bar will not hide even though you have set the property. So a workaround brings another annoyance by itself. Guh.

Terminal with FFM.
This only works between terminals. So it's not that big of a difference, but at least it's better than nothing. If only Terminals can get focus under mouse without getting raised...

Sunday, July 26, 2009

Mac convert, what's broken in Mac OS X.

Now I've used MBP over a weekend. And I've decided there are a few things that are plain broken - that seriously prevents me from doing something or there's no good workaround - in OS X:

The brokenness #1: there's no support for "focus-follows-mouse" or FFM. Steve Yegge has a comprehensive post and I totally agree with him. Apple must be aware of this issue, since they provide a way to have FFM between Terminal windows (only between Terminal.app, not anything else). However, even ignoring the lack of FFM, I think the window focus system is broken because of the #2:

The brokenness #2: the false "application vs window" dichotomy. When I run a terminal, and launch an app (let's say a graphical diff tool), and then quit the app, the focus does not return to the terminal. Instead, X11 application (with no window at all, hence essentially useless) remains to have the focus, and I have to click the terminal to get back to my terminal. Same is true for any other app - if I launch a Finder window to do something quick in the middle of other app, and then close the Finder window, the focus doesn't return to whatever app that launched the Finder. Instead, the focus remains on the Finder app with no widow left. When is an app useful *immediately* after its last window is closed ? At least in my typical usage, 99% of the time I have the last window of an app closed, I don't need that app for a while. Otherwise, I wouldn't have closed it. If I closed all windows of Terminal.app, that means I don't need the terminal now. Ditto for web browser, and Finder. Or even for applications like Picasa,
if I closed its main window, it usually means I don't want that app for now. Rarely, I'd like to close the window, and open another one of the same app (Photoshop might be about the only exception to this rule). So why the heck Mac OS X keeps the focus on the application with no windows ?
#2 issue is also what makes the command-tab less useful than Expose. Expose treats all windows equally (regardless of which one belongs to which application) whereas command-tab is a list of applications, instead of list of windows - the chance of me wanting to switch to an app that doesn't have any window open through a keyboard shortcut is nearly zero.

The brokenness #3: the modal green + button. The button is actually a toggle button, that switches back and forth between pseudo-maximum mode vs normal mode. It's "pseudo-maximum" because the maximum is what the app decides is the maximum. Combine this with multiple tabs in a window (e.g. web browser), it becomes a trainwreck. It would be much more useful and straightforward if it were simply "maximize the window to fill the screen" or "maximize the window to fill the vertical screen" button. I *know* a lot of Mac users who don't grok this, cause I've seen many people using Mac laptop to do a presentation press the green button and get puzzled (I was equally puzzled every time I watched this, and now I at least understand what's happening but understanding doesn't make it less messy).

I have no doubt I can live with all these warts (after all, I have lived with Windows/Linux/Solaris warts for years), but I'm sure my annoyance won't stop. This isn't to say the other platforms are perfect, but it just shows that Mac isn't panacea and isn't THAT much better, if it's better at all.

Friday, July 24, 2009

Mac convert, day 3.5

Forgot one more annoyance. When I login to a remote machine using ssh with X forwarding, and I run some X program (e.g. diff or merge tools) from the shell. Then, the focus moves to the newly popped up X program (which is good). But when I'm done with that program and quit it, the focus doesn't return to my terminal. Instead, X application, without any application window, stays and eats my keys. Is there any way not to have this stupid behavior ?

Mac convert, day 3

Thanks to various people who pointed out how to remap the keyboard shortcut, I thought I was much closer to the keyboard shortcut nirvana than I was, but alas, the road to nirvana seems more elusive. For various reasons, I have to use two browsers, Chrome and Firefox. Anyway, I mapped "New Tab" to ^-T for all application, hoping that it will do the Right Thing, but alas, it does work for Chrome but not for Firefox. Firefox, for whatever reason, doesn't obey the new mapping - if I press ^-T, "File" menu gets highlighted, indicating that the OS X sends the some event to the firefox. However, Firefox doesn't do anything - even though menu bar shows the new mapping for "New Tab" command. Then, if I press command-T, it opens a new tab. Guh. This got to be a bug in Firefox, but it basically prevents me from using this new mapping (different shortcut for two very similar apps would be even worse than having no shortcut).

Now I'm using Safari and Chrome, except when I absolutely have to use Firefox (I need its proxy extension - where's the extension support for Safari or Chrome ?). I've remapped "Search Google..." menu to command-k, so now I can jump to the search box quickly in Safari (though I prefer Chrome's omnibox).

Anyway, I'm getting more used to the keyboard shortcuts, thing like home/end, page up/down, delete-word, and things of that sort. But I still feel like it's more clunky than laptops with dedicated page up/down and home/end buttons - I have to remember and switch between too many different modifiers keys. It's not a deal breaker but I wonder if all my efforts to deal with this conversion is worth the effort...

BTW, I've also realized that the MBP's keyboard doesn't travel as much as Thinkpad's - while the spacing is good, the short travel distance is something I'll have to get used to.
---
The system has been stable so far, so that's an improvement. I hope it stays this way.
---
One good thing about MBP: the screen is awesome. I didn't think much about Apple's claim of better color gamut, until I started copying back my family pictures. The MBP screen is orders of magnitude better than Thinkpad's when it comes to the color reproduction. This makes pictures and videos to be much more enjoyable.

Did I mention the machine is silent? Even when I'm copying gigabytes of my family pictures, I can barely hear seek noise and it's only because my bedroom is completely silent. I didn't hear anything during daytime with normal ambient noise.

Thursday, July 23, 2009

Mac convert, day 2

This morning, I put the laptop into sleep before the commute. At work, I opened the lid, and the mouse pointer was hanging there with nothing - no dialog box to unlock screen, no progress bar, nothing, nada. *sigh*
I brought it to our tech support, and we ended up force shutoff again. This is bad. Very bad.

He updated the system to the latest. I hope it will fix the instability, but I'll have to see. I'm willing to give MBP some chance but it's not looking very good so far.

Another new downer: the edge of the unibody is just too sharp - it hurts my arm/wrist/palm occasionally. I hope this is something I can get used to, but clearly this little box is designed for better look than better tactile comfort (same for the Aluminum surface - it's not as comfortable to the touch as the hard plastic shell of Thinkpad).

I also found why big touchpad gets in the way - if I put my palm down from the normal typing position, the parts of my palms touch the upper corners of the touchpad. And then if I try to tap using right thumb, my left palm is still touching the upper left corner, making it a secondary click. So I have to consciously move my hands slightly apart (or rather, rotate slightly outward).

A few things I found out that helps me a bit: command-left/right are home/end, and option-left/right are move-word-left/right. Also command-up/down are page up/down. So at least I got my basic keyboard navigation back. But I still don't know how to move between tabs in Firefox or Chrome through keyboard shortcut...guess I'll have to search for it :)

Not everything's gloom and doom though. A few good things I can say about MBP:

It's fast. And having 4GB of memory is awesome. There's just no comparison how much more responsive the machine is - especially when I'm working full blast and have multiple browsers open with lots of tabs with lots of graphs, there's no "swapping" that used to make the performance suck on my poor T43p with only 1GB of memory. It also wakes up fast (of course, *if* it wakes up, that is) - from a regular sleep, it's quite fast to wake up. Not "instantaneous" but nearly so.

Also, it is silent - I haven't noticed any fan noise or hard disk seek sounds so far. I can vaguely hear it if I pay attention to it in a silent room, and it just is plain silent with normal ambient noise around me. Moving it around a few times today, I think I can hear small clicking noise, typically when the disk puts its head somewhere "safe" - I suspect the machine detects my lifting it up and moves the disk head somewhere safe, but I could be wrong.

Compared to T43p, the machine is less hot. It's probably because most of my daily tasks (lots of browser windows/tabs, and one terminal, and a few Finder windows, and a chat client) are not taxing its cpu much, but still the bottom becomes a bit warm during usage and that's it. I don't feel uncomfortable at all, and there's no hot air blowing out to the side either.

Wednesday, July 22, 2009

Mac convert, day 1

After 3.5 years with IBM T43p, I upgraded my work laptop to 15inch MacBookPro, largely because that was the model that had 4GB in our inventory. It's been almost 13 years since I've last used NeXTSTEP as my day-to-day OS, and during that 13 years, I've been mostly using Windows, Solaris or Linux as my primary desktop. My carpool buddy, who is an avid Mac user, recommended me to write down the things I ran into during my "conversion", so here's my first entry.

Day 1

Jumping from a single core 1GB ram box to a dual core 4GB box, MBP (MacBookPro) feels fast. But that's largely expected.

The first stumbling block: tap is not a click. The button is just too heavy to press every time I want to click something. Quickly solved by finding the system preference - I just do not understand why this isn't default. Then I kept seeing "secondary click" aka "right mouse button" click when I wasn't trying to do that. Turns out the pad is simply too big and very often part of my right palm (near the thumb) touches the pad when I try to tap the pad with the right thumb. Once I realized that, I get less of it, so it's not a total annoyance.

Then my great puzzling moment came when I pressed the green "+" button on the window, only to see my browser resize into a weird proportion. I couldn't figure out what's going on - I was totally expecting it to be just "maximize" button and it's apparently not as simple as that. My friend explained it to me on the way home, and now it makes sense, though I still think it's a bad design (the button is modal, but there's no sign of which mode it is in).

Fired up a terminal, and realized that I needed to remap the caps lock key. At least this is provided directly by the system preference, unlike Windows, which needs registry editing. Nice. However, my joy didn't last long, as I soon realized that control-L doesn't highlight the location bar in the browser (Chrome, Firefox, Safari) but command-L does. Ditto for control-T vs command-T. Copy and paste is the same. And there's no separate home/end key nor page up/down keys. And there's no proper "delete" key - the delete key does backspace. Arg. I think this is going to be one of the biggest huddles - the finger habits :(

After playing for a while, also realized that I can't do double-tap-and-hold-and-drag. Turns out the system preference has a setting for this. Whew.

Then came another puzzling moment, with command-tab - where is my "other" chrome window in command-tab list ? Turns out command-tab lists "applications", not "windows". OTOH, Expose does display all windows. Why they don't display the same list is beyond me. Then my friend tells me of command-` which is useful, but not quite as useful. This is another keyboard finger habit that I'll have to suffer through :( Setting upper-left corner as Expose trigger makes it a bit more tolerable, but still it sucks that I have to use touchpad for one more thing.

The biggest downer came late in the night - the spinning beach ball of death. I didn't expect to see it on my first day of the use, but I did. The network stack became completely wedged. I've tried ethernet, wifi, and 3G, all of the individually on and off but to no avail. So I decided to use the last tactic - reboot, but alas, the machine decided to go to the beach, and kept showing me the spinning beach ball for like eternity. I couldn't wait for long, so I had to power switch it off. I have no idea what kind of filesystem this box has (OS X 10.5.7) but I hope it's journaling.

I suspect 3G modem driver might not be up to the snuff, so I'll try not to use that thing unless absolutely necessary. Anyway, wifi was a bit finicky as well - though this might be more likely due to my wireless router than anything else.

There are a few other issues with applications. All in all, not a great day 1 experience :(
If this doesn't improve over the next month or so, I might have to return this and get a different box and get Windows or Linux.

A programmer is...

"A programmer is a person who passes as an exacting expert on the basis
of being able to turn out, after innumerable punching, an infinite
series of incomprehensive answers calculated with micrometric
precisions from vague assumptions based on debatable figures taken from
inconclusive documents and carried out on instruments of problematical
accuracy by persons of dubious reliability and questionable mentality
for the avowed purpose of annoying and confounding a hopelessly
defenseless department that was unfortunate enough to ask for the
information in the first place."

-- IEEE Grid news magazine

PS. Thanks to mjw :)

Monday, June 15, 2009

Dansguardian and pogoplug

I have two kids, 9 year old girl and 7 year old boy, and I've always felt somewhat unsafe whenever kids used the internet. Increasingly, my son seems to access more and more online contents, mostly to play online games and read pokemon tips.

The recent Chinese "Green Dam" filtering fiasco reminded me that I should do something about it sooner than later, so I decided to do it tonight. After a quick research, I've installed squid and dansguardian on pogoplug through ipkg, and downloaded the blacklists from URLblacklist.com. After that, I've changed the proxy setting on computers my kids use, to point to dansguardian, and it seems to work well.

My kids don't have great motivation to "defeat" any content filtering yet (they are not even aware of it), and given that it's more of a safeguard from accidents and malicious sites, I'm quite happy with the current setup. In a few years when my son becomes old enough (he's "only" 7), I'll have to set up a transparent proxy if I really want to enforce filtering, but untill then, this will be good enough. I suspect that when he's old enough, he would most likely have the internet access from his cell phone which I won't be able to easily filter. So by that time, "enforcement" won't really be effective or viable anyway (come to think of it, maybe I can try setting dansguardian and squid on android - how's that as an idea for a new android app - parental website filtering software for your young'uns :)


Monday, May 18, 2009

Putting my hard disk to sleep on Pogoplug

Out of the box, pogoplug doesn't spin down my Maxtor OneTouch Plus hard disk. Like most other hard disk drives out there, my disk is used for relatively short period of time every day. This means keeping it running wastes the electricity and produces unnecessary heat.

That situation changed with Spindown - I just installed it using the source. It requires "sg3-utils" but that's already included in Optware, so a quick "ipkg install sg3-utils" took care of that dependency. Once I've installed spindown, and edited /opt/etc/spindown.conf to manage sda and sdb (I have two disks plugged onto pogoplug), my disk stays cool and silent all day. As is, it's almost perfect - all important bases are covered. 

Of course, there's always something more, and in this case, I'd like to get software RAID 1 working - which would be really awesome. It would be even more awesome if somehow there's a way to get ZFS working but I know that won't happen anytime soon, if ever. Probably it will take less time (and work) to get BTRFS working on my pogoplug :)

Wednesday, May 06, 2009

Finally, the working combo of cups and pogoplug

Finally I got the remote printing working with pogoplug.

As I explained in my previous post, I've installed cups and splix, and created a "raw" printer with the usb printer as the device. However, I couldn't get it working only with those.

Then Google pointed me to http://www.owlfish.com/thoughts/winipp-cups-2003-07-20.html. I've basically followed this all the way, but STILL it didn't work. It turns out the last trick was to use the specific driver for ML1740 instead of Samsung's universal driver. Somehow Samsung Universal driver didn't work on top of cups IPP printer.

I suspect I don't even need splix, since the printer is raw and the driver is on windows side. This probably means any USB printer will work, as long as there's a driver on the client side. All in all, I'm very happy that both samba and cups work now.

Saturday, May 02, 2009

Pogoplug performance

Now that I've hooked pogoplug onto a fully non-blocking gigabit switch, the network shouldn't be the bottleneck anymore (or if it still is, I'd be really happy) and so finally I have the setup to test pogoplug's performance. Feeling lazy about it, I decided to just run some file copy operations :)

Here's what I got:

First, I wanted to see pogoplug + Maxtor OneTouchPlus 750GB disk performance. The disk is formatted in NTFS, and is hooked up to pogoplug through a USB2 hub. 

I first ran a file copy inside pogoplug, that copies a single 1GB file onto the same disk (hence there's 1GB of read traffic and 1GB of write traffic onto the same disk). It took 232 seconds - this is sooooooo slow (only 2GB/232 ~= 8MB/sec). So I measured only the read speed by running "cat file > /dev/null" with the same 1GB file, and it only took 44s -- 1GB/44 > 20MB/s. 20MB/s read speed is quite reasonable :)

Now across the network, I ran "scp" from a windows box - this doesn't really test the pure network copy performance, as scp would require quite a bit of CPU power to encrypt the traffic. With scp, I got only about 2.2MB/s which I thought is somewhat abyssmal (this is on a gigabit network).  However, it turns out it isn't that bad, compared to samba. 

I tried copying over samba and gave up after waiting about a minute (at that point, the copy progress bar said 15 minutes left - this would mean nearly 1MB/s). So I tried pogoplug device (you know, the pogoplug's software that makes any drives on pogoplug show up as windows' local disk). It took 146 seconds to copy 1GB file from pogoplug to a Windows box - that's about 7MB/s. When I asked about samba to pogoplug support, they mentioned that their software is much faster than samba, and now I can believe that :)

While it's still not fast enough to hit 20MB/s disk speed bottleneck, 7MB/s is fast enough to saturate my 802.11g wireless network and probably fast enough to stream HD contents - I'll have to try that later to confirm. So all in all, I'm reasonably happy about the performance - when using pogoplug device directly at least - and looking forward to using it as a media streaming box :)


One good news and one bad news about pogoplug and cups

I've made some progress setting up cups on pogoplug. It's not working yet, but I feel like it's sooooo close. 

I first tried cups in optware packages, but somehow all binaries in the package gave me segfault.
So I downloaded cups-1.3.10 source, and compiled/installed it myself (after installing optware development tools - gcc, make, etc). Then I realized that the kernel has usblp driver, but somehow /dev/usblp0 isn't there (even when the printer is plugged in, and dmesg shows kernel recognizing it as a usb printer). So I created a device myself "mknod /dev/usblp0 c 180 0" - the major number and the minor number was taken from:
bash-3.2# cat /sys/bus/usb/devices/1-1.3/1-1.3\:1.0/usb\:lp0/dev
180:0
bash-3.2#
After this, cups backend recognizes the printer:
bash-3.2# /opt/lib/cups/backend/usb
direct usb://Samsung/ML-1740 "Samsung ML-1740" "Samsung ML-1740 USB #1" "MFG:Samsung;CMD:GDI;MDL:ML-1740;CLS:PRINTER;MODE:GDI;STATUS:IDLE;CODE:10001;"
bash-3.2#
I've installed splix as well. However, I've never setup cups manually before, and I was lost in setting up cups. After many trials and errors, I still don't have successful cups setup - I've tried two different paths, one setting up the printer as "raw", and have my windows box to install the printer driver on its side. And the other was to use splix and have windows recognize it as generic postscript printer. However, I couldn't get either of them working - generic postscript setup didn't work because cups was giving client-error-document-format-not-supported error with a message "unsupported format: application/postscript" or something like that. I don't understand why this is happening, as seemingly correct .ppd file is installed and configured for the printer... Then the raw mode somehow never worked either and I couldn't figure out why, and by the time I got to that stage, it was waaaay to late so had to sleep :/

If you're a cups hacker who can give some advice in this sitation, it would be awesome. It's so close to pogoplug nirvana....

Thursday, April 30, 2009

My samba config for pogoplug

Below is my samba config (for samba 2.2). No password, nor any protection other than IP address filter (see "hosts allow") so use with caution :)

[global]
workgroup = PARKNET
server string = Pogoplug Samba2 Server
hosts allow = 192.168.3.  127.
null passwords = yes
guest account = root
log file = /opt/var/log/samba/log.%m
max log size = 50
security = share
encrypt passwords = no
smb passwd file = /opt/etc/samba/smbpasswd
dns proxy = no
preserve case = yes

[ShareAll]
comment = Test share
path = /tmp/.cemnt
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes

I know this is somewhat gross as far as samba configurations go, but hopefully it will be a working start :)

PS. Turns out "encrypt passwords = no" doesn't actually help, but prevents non-workgroup machines to connect without passwords (at least from a Windows XP machine). I've now set it to "yes".

Friday, April 24, 2009

대한민국은 미친공화국이다

한겨레 신문에 "교과부 심야학원 10시까지 법제화"라는 기사를 읽자니, 기가 막혀서 말이 안나온다. 이런 황당한 법을 만들겠다는 넘들이나, 그걸 지지하는 넘들, 내 블로그를 읽을리 절대 없겠지만, 혹시라도 읽는다면 잘 들어라.

도.대.체.  다른사람들이 자기 애들을 11시에 학원에 보내건, 12시에 보내건, 새벽 3시에 보내건, 그게 니들 사는데 무슨 방해가 되냐? 뭐가 "올바른" 행동인지 아닌지, 몇사람들이 정해서 법으로 만들어 다른사람들에게 강제시키겠다는 이런 발상은...계몽주의적을 넘어 국민을 애들 취급하겠다는 발상 이쟈너. 니덜은 미친놈들이다. 10시넘에 운영하는 학원을 문제라고 생각하는 것 까지는 그렇다고 치자. 그걸 강제적으로 이런식으로 해결하겠다는, 위에서 아래로 내려오는 상명하달식으로 밖에는 해결이 안될거라고 믿는, 그래서 거기에 회의 시간들 들여가며 돌아가지 않는 머리통들을 부딪히고 있는 니덜은 ... 미친넘들이다. 

밤늦게 학원에 보내려는 부모들이 보내고 싶지 않게, 보낼 필요가 없게 만들어서, 수요가 없어지게 하지 않는 이상, 아무리 단속을 하더라도 원하는 사람들은 하게 마련이다. 어떻게 하면 근본적인 문제부터 해결할까는 생각하지도 않으면서 이딴 쓸데없는데다가 시간을 쓰고있으니.... 혹시라도 이거 읽고 제정신이 돌아오거든 이 형님한테 감사하다고 인사나 해라.


About /dev/mtdblock3 on pogoplug

I've asked pogoplug support if they have any plan to use that extra partition, and the below was the answer:

We have left mtdblock3 for linux users to use at their discression.  We have reserved mtd0 for bootloader, mtd1 for kernel, mtd2 for root file system (and it is all we firmware update).  mtd3 and mtdblock3 are the majority of the NAND flash (~450MB) and we currently have no plans to use it at all.

One word: awesome! I'm feeling a lot better about buying pogoplug. Now if only I can get cups working. I haven't had time to fight with cups yet, but it seems that it's not the cups but something at the kernel level that's not working...

How to install samba on pogoplug

Below is roughly what I did to get samba running on pogoplug.

# remount the root partition for writing
mount -o remount,rw /

# mount the extra partition for the space
mkdir /opt
mount /dev/mtdblock3 /opt
cd /opt

# get the optware ipkg system
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ipkg-
opt_0.99.163-10_arm.ipk

# set it up
tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf -
mkdir -p /opt/etc/ipkg
echo "src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/uns
table" > /opt/etc/ipkg/armel-feed.conf
echo "src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/u
nstable" >> /opt/etc/ipkg/armel-feed.conf

# first update
/opt/bin/ipkg update

# install samba!
/opt/bin/ipkg install samba2

# edit samba config
vi /opt/etc/samba/smb.conf

# run it!
/opt/etc/init.d/S80samba start

Sunday, April 19, 2009

Pogoplug, and lots of images

If you have a disk that contains large number of image and video files, you may not want to attach it to pogoplug, at least yet. It seems that pogoplug wants to generate thumbnails for all video and image files on the disk (/tmp/hbplug.log shows invocation of ffmpeg), and since I attached the disk that contains all digital pictures I've ever took in the past 10 years or so - especially with two kids, I easily take thousands of pictures a year - it looks like the pogoplug is taking forever to process them all.

Looking at .cedata/tn directory pogoplug created (which seems to be the directory for thumbnails), I see 3k immediate subdirectories under .cedata/tn, and total 23k files and directories recursively. *arg*. Life is never simple :(
I don't remember whether I formatted this disk in NTFS or FAT, but regardless, it seems like a bad design on pogoplug's part to use this many directories - you want to keep the number of directories reasonable, especially when the underlying filesystem is badly designed, like FAT.

Anyway, I've stopped "hbplug" process by "kill -STOP", so the disk is not thrashing. I should remember to re-enable hbplug process again.

Pogoplug, optware, samba

Finally I had a bit of extra time to play with Pogoplug. I've set up Optware ipkg on pogoplug, installed samba, configured it and it works beautifully :)
Optware comes with CUPS, so it shouldn't be too difficult to set the print server as well - though I first need aUSB2 hub to try hooking up the printer :)
Now it's time to sleep - if I get more time, I'll try to write down more details on Optware setup.

Saturday, April 11, 2009

Update on Pogoplug

After complaining loudly on their support page, I've got an excellent reply from Pogoplug:

Hi.
I spoke with our dev group and here's what's going on. They are working on a LAN discovery broadcast for the drive software, so that it will work without internet access. It should be available soon, and I'll update you when it's ready. We did not provide SMB/CIFS support because we wanted a consistent user experience for Mac and Windows, both in and out of the home. The protocol used by Pogoplug drive software is also a lot faster than SMB. Having said that, you can get full access to your Pogoplug and add any software that you want. We are just about to publish this on our site, but here's the info you'll need:

Pogoplug runs with Linux 2.6.22.18. and the full open source for the kernel, glibc, busybox, u-boot, and other user-mode processes will be available linked from our developer section. Pogoplug currently accepts SSH sessions for the root user (un: root, pw: ceadmin). The processor is a ARM processor with all firmware stored on the internal NAND flash device. The standard linux MTD device drive is used to manage this NAND device with JFFS2 filesystem. Once you SSH to the device, you can change the root file system, install a new kernel modules, etc.

We also support a 3.3v RS-232 UART connection on the main logic board. This UART connection gives low level access to the u-boot boot loader which allows for upgrading the main kernel image.

Please let me know if I can provide any additional information.

Thanks,

I haven't set up the cross compiler on my linux box yet, so haven't done any serious attempt of adding more functionality to it. But regardless, given this information, you definitely want to block ssh/telnet port at the firewall if you haven't done so already, and you shouldn't hook it up to the network you don't trust.

My brief performance testing (just copying some big file) seems to suggest that it is not particularly slower or faster. One issue I've encountered was BSOD - I tried playing .mkv from a windows box that has pogoplug software installed (hence the pogoplug shows up as a disk), and I've got BSOD (the first time in a few years since I've got that laptop). On the second attempt, it didn't crash, so it's not a definite evidence of a bug in their software, but nonetheless not a great sign.

So, it's still not useable as my main network storage. But there are some good signs that it may become one.

Wednesday, April 08, 2009

My Pogoplug arrived, and I'm disappointed.

This is a quick review of Pogoplug. I have preordered the box, and it has finally arrived. Unfortunately, I'm deeply disappointed, because it has so much potential that's being wasted.

Pogoplug is essentially a small embedded computer, with Marvell's low-power ARM processor core with some DRAM and flash memory, one ethernet port and one USB port.
I pre-ordered it, figuring there's not much to lose - I figured this would be a perfect device that I can play with, as a small home server, given that this little box was supposed to run linux.

Now that I've received the box, it has a few critical flaws that make it not very usable in its current state.
  1. No power saving mode for the disk - I've been using an old laptop running Windows XP as a file/print server. Naturally, when I don't use the disk, the disk doesn't do any "seeks", and it's configured so that it spins down the hard disk fairly quickly when idle. This means my external hard disk spends most of its time spinned down, not consuming much power. This is in great contrast to Pogoplug - it constantly spins the disk, and even when I'm not using it, it does bunch of seeks, consuming power and wearing down the disk. For a box that's meant to be on all the time, this is...deeply disappointing, to say it politely.
  2. No CIFS/SMB support nor NFS - I don't know what Pogoplug people are thinking, but they didn't enable this, and there's no way to "properly" access the files, except...
  3. A priorietary software on Windows and Mac that show the drive hooked to Pogoplug as a network disk. This software, confusingly also called Pogoplug, doesn't connect if your machine and your pogoplug can't talk to pogoplug's server. For example, if you lose your connection to your ISP, you can't connect to your disk hooked to Pogoplug. This means...
  4. Total dependence on the proprietary webservice - as is, the box is useless without pogoplug website. If the company folds, the box will essentially become a deadweight.
  5. No printer server support - given how easy it is to support print server, it's crazy not to support this.
  6. No ssh into the box - even though this is my computer, I don't have root access. It's not like the box doesn't have sshd running - it has the port open (crazily, it has the telnetd running on port 22 as well - whoever left telnetd running by default needs some serious education on the network security).
As you can see, all the flaws are software - the hardware itself is compact, silent, and low power, and just the right form factor and the price. It's just the software that's not allowing the little-box-that-can from doing all things it's meant to do.

And scanning through the pogoplug support forum and reading some responses, I don't see enough good signs that the company is willing to listen to the similar requests that's already made on the board.

Thursday, March 05, 2009

The Bay Model

This is the first time I heard of this, but looks amazing. It seems like a perfect place to visit during spring break...

Monday, March 02, 2009

Validation, and Rent-a-person

A friend of mine sent me a link to a movie called Validation (thanks Tom!). It's an awesome movie, and my wife and I thoroughly enjoyed it - and guess what ? It turns out the same directory made a movie called Rent-a-person. It's equally entertaining...and those two movies are separate yet entwined :)

Friday, January 09, 2009

Ever heard of beef that's over $150 per lb ?

Costco online now sells Japanese Wagyu Beef. Price? $2299.99 for 15 lbs. That's over $150 per lb. That's gotta be more expensive than a regular cow in whole...