Monday, September 13, 2010

WTF of the day

I showed this to a co-worker of mine and he said I should record a song and send it to him in reply, which I'm tempted to.



From: ...

Date: ...

Subject: Linux/Unix Rockers Wanted! - SE

Greetings Seongbae,

ROCK OUT! with Yahoo's Service Engineer and Operations!!!

We have some amazing opportunities for guitarist, drummers and even lead singers! And of course we're looking for the best band managers the world has ever known!

Send me a demo and let's ROCK This!

Take a peek at some of our new products and initiatives:

Rock ON, & Thanks!

Senior Recruiter Sorcerer
Office (408) ...-....

View/reply to this message

Monday, August 02, 2010

Fine print

Can you spot what's wrong with the coupon offer l I received from Expedia below ?

From: Expedia Service Center
Date: Mon, Aug 2, 2010 at 10:00 PM
Subject: Thanks for planning your trip to Seoul on Expedia
To: ....
Vacation Packages | Hotels | Cars | Flights | Cruises | Activities
Dear Seongbae,

Thanks for planning your trip to .... on Expedia. We hope your trip went well and that you had a good experience--both with Expedia and the companies that provided your travel.

Just to make sure, we hope you'll share your thoughts by completing a short satisfaction survey. It takes only a few minutes and your comments help us improve your future travel experiences, our service, and our site.

As a "thank you" for your time, we will email you a coupon for $10 off each night of your next hotel stay*.

Rest assured your identity and information will be kept confidential and will never be sold or rented to any third party.

Take the survey now

We appreciate your time and business.
Expedia Travel Team
*This single-use coupon is valid only for a discount of $10 per night towards the new booking on of a room at an Expedia® Special Rate hotel for two (2) nights or longer. The cost per night of the booking must be at least $75 before taxes and fees. Coupon must be used by 11:59 PM (Pacific Time) on July 31, 2010. Travel must be completed by August 31, 2010.

You are receiving this survey as a customer of

Please do not reply to this e-mail as we are not able to respond to messages sent to this e-mail address. To contact us or send feedback, please click here or contact us via postal mail at: Expedia, Inc., attn: EMC Team, 333 108th Avenue NE, Bellevue, WA 98004. For additional assistance, visit the Customer Support Center, or call 1-800-Expedia.

CST# 2029030-50

© 2010 Expedia, Inc. All rights reserved. Expedia, Expedia Extras, Best Price Guarantee, and the Airplane logos are registered trademarks, or trademarks, of Expedia, Inc. in the U.S. and/or other countries. Other product and company names mentioned herein may be trademarks of their respective owners.

(EMID: SUR_PSTEP_01_C)(MD: 20100802110059)(EPID: 131962498)(ETID: 177120)

The fine print says the coupon must be used before July 31, but guess when it was sent ? :)

Tuesday, May 04, 2010

This time, Intel is coming down the microprocess ladder.

One of the key reasons in x86's rise in laptop, desktop and server market can be summed up in one sentence: climbing up the performance ladder. Intel and AMD were able to improve the performance and the performance/$ of x86, to catch up with the competitors and they eventually exceeded most of their competitors. No matter how you look at it, x86 chips are extremely competitive, boasting either the best performance or the best performance/$, or both.

Now, I wonder if the history will repeat itself at the opposite end of the performance spectrum. The news of Intel's Moorsetown might just be the beginning of another repetition. Various ARM implementations have been the choice for mobile phones, but if I were to believe Intel's announcement (there's no reason not to believe it - in actuality, ARM is not exactly the best ISA if you care about performance), Intel's new Moorestown might just start the x86's expansion into mobile phones, this time by providing the best performance/watt. In fact, in my opinion, there's just no doubt that Intel with its best process technology and design prowess will either match or exceed most of its competitors. Clearly they are capable of producing the best, and x86 isn't much more complicated compared to the ARM which is a hodge-podge collection of oddities.

That said, just as the 90's ISA (instruction set architecture) survival game, the software will play an important role in deciding which ISA will survive, but this time software might actually slow down the expansion of x86 into mobile phone. Why? Apple and iPhone. Having lost the microprocessor war in the desktop era (remember PowerPC?), Apple looks determined to win the processor for mobile device - its acquisition of two processor startups and producing their own SoC testifies its resolve to control their own processor. And iPhone and, more importantly, Apps on iPhone are, just like DOS/Windows of the day, completely tied to ARM. All iPhone apps are native apps, meaning they are compiled to the machine code that is ARM. While it's not impossible for Apple to pull off an ISA switch for iPhone, similar to what they did with Mac, there are considerable costs with that approach and it looks like Apple will try its best to push for their own processor. This means ARM will have a non-trivial software platform that will stick around.

On the other hand, iPhone's primary competitor, Android, practically doesn't have this native code problem. That's because almost all android apps are written in Java the language, and compiled to bytecode for Dalvik VM. The bytecode is inherently ISA-neutral, so it is nearly trivial to switch the processor ISA of an android phone - all apps will just work, assuming Android OS itself is ported to the ISA, which already happened since android already runs on x86. Give this, I fully expect handset manufacturers to start selling Moorsetown-based handset running Android. They will start claiming huge performance advantage. Of course, Apple will respond just the same way it did when PowerPC lagged behind x86.

In the next few years, we'll see if the history will repeat itself, and what kind of twists there will be if any. Fun and exciting time indeed.

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
> 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
< 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
> #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"

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

<!-- 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"/>

<!-- 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"/>

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">
<name replace-wildcards="yes">%h</name>

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 -nosavepassword -allowroot
The key part is "" - as far as I tried, this and 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 "" in the top directory of the exported volume you want to use as timemachine. e.g.:

$ touch /tmp/.cemnt/mnt_sda1/TimeMachine/

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 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 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...