Friday, October 03, 2008

SSH to your iPhone without password

Previously I wrote about offline browsing which involves SSHFS that requires you type in the root password of your iPhone everytime. To save some typing, you could setup SSH public/private keys. Here are the steps.

On the host that you mount iPhone's filesystem, execute:
ssh-keygen -t rsa
which generates a public and a private key. The former is ~/.ssh/id_rsa.pub

On your iPhone
1) create a ~/.ssh directory and copy the above public key over. Name it as .ssh/authorized_key.
2) Uncomment the following line in your /etc/ssh/sshd_config:
AuthorizedKeysFile .ssh/authorized_keys

Now you could ssh (and thus sshfs) to your iPhone without password.

Friday, September 05, 2008

Turn off Google Chrome auto-suggest

Here is why and how. I think Google knows enough about me so I'd rather not send even more info to them through the "Omnibox" (or "address bar" for the old school folks) Of course, no one force you to use it instead of Firefox but you are not in if you haven't tried it. I just hope there's a more obvious way to turn off auto-suggest. I thought it would be under "Option" but I had to Google a bit and finally found the above link.

How to read .docx?

The short answer is to ignore them so that nobody will use it anymore. The way this format (OOXML) became an ISO standard was not without controversy.

The long answer is to install a converter. (Microsoft provided one but I haven't tried) After you install this converter on Windows, simply double-click the .docx file on your computer and the converter will automatically convert it to OpenOffice.org's format (.odt) and open it in OpenOffice.org Writer.

Friday, August 22, 2008

iPhone Offline Browsing Step 4: httrack

As I said in my previous post, just install HTTRACK from Synaptic. Then execute:
httrack URL-of-the-site-to-mirror -O /mnt/iphone/ -%v

Once httrack finished, you could open: http://localhost from your mobile Safari to browse those pages. Don't forget to bookmark it!

iPhone Offline Browsing Step 3: sshfs

I want the /var/mobile/Site directory on iPhone to appear like a local drive on the host where I will execute HTTRACK. SSHFS is perfect for this, except there is no Windows port and my Linux box has died. So I installed andLinux Then it won't be easier to install SSHFS and HTTRACK. Simply use Synaptic. And look for these packages. Synaptic will take care of the dependencies for you.

Once SSHFS is installed, create a mount point (an empty directory) which you will use to refer to your remote directory (the one on iPhone) e.g. /mnt/iphone

Then execute:
sshfs root@:/var/mobile/Sites /mnt/iphone

BTW, to "disconnect" (more precisely, unmount), simply:
fusermount -u /mnt/iphone

iPhone Offline Browsing Step 2: lighttpd

Since Safari only works with websites but not local files, the way to get around this is obviously running a website on your iPhone using local HTML files (more precisely, running a HTTP server that serves those files) I installed lighttpd from Cydia for this purpose. Unlike OpenSSH:
1) it's not a featured app so you have to search for it
2) it requires a minimal amount of config (to understand the config, check its wiki. Otherwise you could always cut-and-paste)
3) it requires creating some directories if your iPhone is "virgin"
4) it requires a setup step (add a plist file) to make it start everytime you boot up the phone.

The directories I created are:
- /var/mobile/Sites: directory that stores your local HTML files
- /var/log/lighttpd: directory for log files
- /usr/etc: directory for config files

Basically I followed the steps by this poster except I cut-and-pasted the /usr/etc/lighttpd.conf from this poster in the same thread.

iPhone Offline Browsing Step 1: OpenSSH

One of the most useful "gateway" that opens up access to your phone is the widely used SSH (secure shell)

Once you have OpenSSH installed on your phone, you could connect to your phone from another host using SSH.

I easily found OpenSSH under the Featured App section in Cydia (an iPhone app that helps you to install other Apps. You can think of it as the "unofficial" App Store.)

Once it's installed, it runs in the background automatically. There is no icon for OpenSSH and no need to config it.

iPhone Offline Browsing Step 0: Jailbreak

Having heard all these horror stories of rendering the iPhone unusable after Jailbreak, I still couldn't resist the temptation to make my iPhone at least as good as my old WinMo. And the very first step is jailbreaking. Currently the fastest (and easiet to me) way is using QuickPwn. You could also try the download link here.

Some info that you might find helpful:
1) QuickPwn is supposed to work with 2.0, 2.0.1 or 2.0.2 firmware. Mine is 2.0.1 so I have no experience with the other ones.

2) QuickPwn needs your ipsw from Apple. I found it under "C:\Documents and Settings\\Application Data\Apple Computer\iTunes\iPhone Software Updates" I recommend you to make a copy of it just in case.

3) The real "action" happens inside the command-line window launched by the GUI. Just follow its instructions which involve turning your phone off and then back on (with a special sequence/combo of key pressing) It might sound weird but don't be scared.

Disclaimer: I am not encouraging anyone to jailbreak their phone and you have to understand that QuickPwn is beta software. I am not responsible for any potential damage done to your phone.

iPhone Offline Browsing

This is a 5 part series that describe all the steps it takes to archive a Web site to your iPhone and allows you to browse it offline (by now you all know that your iPhone doesn't always have an internet connection)

Step 0: Jailbreak your iPhone
Step 1: Install OpenSSH
Step 2: Install lighttpd
Step 3: sshfs to mount your iPhone to a PC
Step 4: HTTRACK to archive a your favourite website thru the sshfs mount

BTW, after all these is done, my iPhone could finally match my good old WinMo PDA in terms of offline browsing functionality.

Thursday, August 21, 2008

If your iPhone App refuses to launch......

You iPhone users might have run into this before: after you press the icon of an app, it opens a blank screen and then quickly close itself and go back to the home screen. Worse yet, it happens to all other apps too! You could try what works for me: uninstall the app and re-download it from the AppStore. Not only the downloaded app but also the existing apps will start working again.

This is so tricky that it doesn't sound like a plausible solution but apparently other users have figured this out too so it's probably legit.

Monday, August 18, 2008

Olympics and Globalization

Three Americans, Chris Kaman, J.R. Holden and Becky Hammon, are playing on basketball teams other than USA (Kaman plays for Germany while Holden and Hammon play for Russia)

And by now we are used to the many gymnasts, table tennis and badminton players who were trained in China and play for other countries.

Finally, the arguably biggest name in Chinese volleyball, Jenny Lang Ping, is coaching the American team.

For those who still don't believe in globalization, it's time to turn off the TV (and radio, internet...)

Wednesday, August 13, 2008

Where to find the geotags?

We all know iPhone 3G is capable of geotagging photos taken by the camera. The coordinates are stored in the EXIF data section of the JPG. So, what tool allows you to view the EXIF? JHead is one of such tool on Windows (command line, i.e, runs under DOS prompt) BTW, I googled to find out if GIMP allows you to view EXIF and couldn't find a definitive answer. If you know, please leave a comment here.

Wednesday, August 06, 2008

Apple helps fighting recession?

...... or making inflation worse? I'm no economist. All I know is Apple has altered its "universal connector" (found on iPod and iPhone) in iPhone 3G and made all sorts of accessories incompatible (glad that Apple chose the word "universal" instead of "Plays for sure" :P)

I found that out by plugging my old iPod FM transmitter/charger into my iPhone and it warns that it won't charge. So I googled and confirmed that charging thru the "Firewire" pin is no longer supported (only the "USB" pin works) and you will be surprised to see how many accessories out there uses the Firewire pin (perhaps a relic from the 1st gen iPod. Anyone remember it? It WAS the reason people putting Firewire on their PC!)

Fortunately my old charger was a gift but I feel bad for those who spent $200+ moding their car for iPhone and found that their 3G won't charge (Ridax "saved" the day for them, sort of)

Apple is indeed the best friend of the iAccessory industry. Not so much for the iUsers. And I'm surprised so few people are complaining. I see a lot of posters in various forums simply accept this fact, move on and buy brand new accessories all over again. That should be good for the economy, right?

Tuesday, August 05, 2008

Firmware 2.0.1 is out

I have not tried yet but I saw someone who has not tried and posted about it and got highly ranked by Google so I think I might as well do the same.

I did a quick search and found that it is supposed to reduce lags (especially for Contacts) so it might worth a try. Use at your own risk though!

The microphone is a button!

For my first few days of using the iPhone, I wish there are buttons for (1) accepting phone calls when I'm using the included wired hands-free headphone and (2) pausing music.

It's obvious that I could use the "Software" buttons (i.e., the one on the touch screen) What is not so obvious is that the microphone on the hands-free is THE button for both (1) and (2). (Thanks to this post by Matt Ryall)

Monday, August 04, 2008

Custom ringtone on iPhone

For some reason I always put this on my top priority list for my phone even though I hardly get any phone calls at all! I could use any song from the library on my old phone (SE W800i) However, it's not as simple on the iPhone:
1) convert your song to AAC
2) cut it to under 30 seconds (could do this before Step#1)
3) change the extension of the file to .m4r
4) add the file to iTunes and it should appear in the Ringtone section.

If you think these steps are too complicated, good news for you: the freeware iRinger does all these for you.

Finally, you need to sync the ringtone to your phone. You can't just drag-and-drop from the item you see in Step#4 to your phone in iTunes. Instead, click on the name of your phone on the left pane. You will see the main page for your phone on the right pane. Click the "Ringtone" tab and check the "Sync" radio button (make sure the ringtone you want is selected) Then "Apply" this change.

Now you could choose these ringtones under custom on your iPhone!

How to tell when iPhone 3G is fully charged?

The iPhone is fully changed when the icon in the top bar changes from a lightning bolt to a two prong power symbol. (Thanks to the reply to this post by aristotles. Like the other posters, I also wonder why it has to be so subtle.)

Friday, August 01, 2008

Outlook and iPhone

One of my bigger concern before buying the iPhone is that my address book has been carefully maintained in Outlook (Yeah, I know I should have gone Open Source but I need it in order to sync to my WinMo PDA) And from the Google result I have mistaken that I need MobileMe to sync Outlook with iPhone. That's a misunderstanding: iTunes took care of it out-of-the-box. It found my Outlook and asked me what I want to sync (Address book, Calendar...) As simple as that!

This post will not exist if iPhone is really that easy to use

Enough with the negativity in the title :P You could also see this post as tips for "advanced user." Indeed, I didn't need to read any manual and these things are kinda easy to Google for:
1) Bluetooth headset
To pair it with your non-Apple brand headset, go to Settings->General->Bluetooth. Turns it on. Then put your headset into "pairing mode" (for my Motorola headset that has only 1 button, I simply turn it off. Then turn it on. Keep pressing the button down for a while and it will go into this mode) Your headset should appear on iPhone's screen. Depends on whether iPhone is in a good mood, you may or may not need to enter the passcode (usually 0000)

Next, how to tell it's paired? Check the bluetooth icon on the top-right corner. If it's greyed out, something's wrong.

2) Force quit an application
The ability to "kill" an app when it is misbehaving is pretty standard functionality. Apple calls it "force quit" (I suppose it's more humane than kill) To force quit on iPhone, simply press and hold the "Home" button (the one below your screen!) for six seconds.

Friday, April 18, 2008

DGS to OGS

I've decided to move from the Dragon Go Server to the Online Go Server, suggested by the folks at GoDiscussions.com in this thread about players who let time run out instead of resigning. Still not sure if I'll get the same treatment over at OGS but I do need a notifier application for OGS. There is a .NET based OGSNotifier. I try to avoid Microsoft specific technology if possible so I found this program called Your Move written by Adrian Petrescu. His version works with DGS and the Mac specific notification system Growl. I modified his code to add an OGSNotifier and work with the Windows equivalent of Growl called Snarl. (See this thread to get the Snarl Python API) If you're interested, leave me a comment. (I doubt anyone else who want to use it other than myself though since it has 2 dependencies: Python and Snarl, instead of the 1 dependency of OGSNotifier!)

Wednesday, April 09, 2008

Olympic protest - both sides of the story

This is the hottest topic for San Franciscan as the Olympic torch has arrived and the relay will begin at 1pm today.

Pictures of protesters:




Pictures of supporters:


Clearly I'm biased.

Monday, April 07, 2008

Do you want to have your identity protected

... by a company whose CEO has his identity stolen?

I'm talking about the CEO who advertise his own SSN. I found it funny that whenever I run into an annoying ad, there are always some interesting stories behind it.

Thursday, April 03, 2008

Burn a music CD on Ubuntu

The application K3b is very good for this purpose, except for one problem: it doesn't support MP3->CD out of the box. On K3b's startup screen, it says:

"Mp3 Audio Decoder plugin not found.
K3b could not load or find the Mp3 decoder plugin. This means that you will not be able to create Audio CDs from Mp3 files. Many Linux distributions do not include Mp3 support for legal reasons.
Solution: To enable Mp3 support, please install the MAD Mp3 decoding library as well as the K3b MAD Mp3 decoder plugin (the latter may already be installed but not functional due to the missing libmad). Some distributions allow installation of Mp3 support via an online update tool (i.e. SuSE's YOU)."

Fortunately the solution is extremely simple:
1) open your terminal
2) execute this:
sudo apt-get install libk3b2-mp3

Now you could drag-and-drop MP3 tracks into K3b.

You might ask: who still listens to CD? That's another story :D

Monday, March 31, 2008

Top of the (Fantasy Baseball) World


This may be the only day I lead all season.

Thursday, March 27, 2008

Spring Break Day 2

Day 2 started with a trip to Hobby Town USA. Then Fremont Central Park, Hooter's, Mountain View Shoreline Park, and finally, Palo Alto Junior Museum.

So excited flying a kite for the first time! Lesson learned: gotta fly at somewhere spacious (and windy, of course) We failed at Fremont Central Park but it was piece-of-cake at Shoreline.

Monday, March 24, 2008

Spring Break Day 1

It was a field trip day to SF: Caltrain, Muni, Rincon Center, Metreon, SFMOMA, and finally, SpecialTea.

Use DLink DI-704P as a hub

Now that I got my ethernet ports activated. The next step is, of course, to hook up all my desktops who have been on wireless for too long. To hook up 2 computers to 1 port, I need to repurpose my long unused DLink DI-704P router as a hub. I figured out the setup after a bit of Googling and trial-and-error:
For the WAN setting, I chose "Dynamic IP Address" (I don't think it really matters but I'm not sure)
For the LAN setting, I picked an IP address for the hub that is in the range of my router. Disable DHCP (since that's the job of my router)
You would think the cable from the wall plate should be inserted into the WAN port (i.e., "input") and this is the most important/non-trivial part: plug the cable into a regular/numbered ("output" if you will) port instead of the WAN port.
And you're all set.

Sunday, March 23, 2008

Put a RJ45 connector on a Cat 5 cable

Why did I have to do this? My house is pre-wired: each room has 1 or more RJ45 (ethernet) port wired directly to a central cabinet, where I put my router. However, the wire at the cabinet end has no connector (I guess the builder gives opportunities for others to make some money) Fortunately, my brother knows this very well and taught me how to do this. We bought our crimper from Home Depot for $20.

The first thing he did was unscrewing the wall plate to figure out how it is wired at the port. In our case, it's 568-B standard. Next, we look up the wiring diagram at Wikipedia All these colored wire are actually inside the jacket of the Cat 5 cable. So we use the crimper to "peel" off the tip of the cable. Un-twist the wires. Straighten and fan them out. Arrange them according to the diagram, pin 1 - 8 (left to right) Then insert those 8 wires into the RJ45 connector "upside down" and make sure each wire gets into its own "slot." Finally, insert the connector into the crimper and press real hard (make sure the wires won't come lose) For a better description with pictures, check out this web page.

Friday, February 29, 2008

komi for 9x9 and 13x13 games

I'm about to lose my first DGS game :( I thought I could blame it on the high komi used: 6.5 but it turns out to be a reasonable one according to the folks @ godiscussions.com I guess I just need to work harder!

Wednesday, January 23, 2008

Convert a VCD to CD

You might ask: can't you just listen instead of watching the video? Well, my car has CD player only and I listen to some of my CD converted from VCD in the car, thank to this guide. The key piece of software is VirtualDub and we make use of its Audio->Full Processing function. You could even choose the left or right channel, which is useful for Karaoke VCD. Why pay for 2 if you could convert 1 from another?

Monday, January 21, 2008

Watch video on mobile phone

I used a software called Fever link Super for converting video to the 3gp format to watch on my SE phone. Haven't used it for a long time since I have a small memory stick but I upgraded to a 4GB yesterday. I converted a RMVB video. Worked like a charm. Definitely deserved more love. Here is the latest version.

Sunday, January 20, 2008

TRENDnet TEW-424UB 3.0R USB Wifi Adapter working on Ubuntu

No, it's not deja vu. I got a PCI Wifi card working on my brother's PC last week. It's more complicated for my desktop since I use a USB adapter. The additional piece of the puzzle is Ndiswrapper. Just follow this guide on how to install Ndiswrapper using the Windows (XP) driver files (I copied it straight from the included CD)

The weird part is that I was not able to use iwconfig to enter the Wifi setting successfully so I use the GUI instead and it worked. (Not the first time but after a reboot)

Tuesday, January 15, 2008

RealPlayer on Ubuntu Gutsy

Another example of user-unfriendliness of Linux: Remember I called RealPlayer a success from my experience with Feisty? I followed the same steps on my brother's PC, on which we install straight from the Gutsy Live CD, but it didn't work. The installer complained libstdc++5 is missing. Sounds like this version was included in Feisty but not Gutsy. At that time we couldn't get it connected to the internet so apt-get was out of the equation. Fortunately we were able to download the .deb package from here on another machine.

Another alternative (probably a better one anyway) is to bypass RealPlayer completely and install the codec and MPlayer plugin instead. Of course that would be easier if one has internet connection.

USB Modem on Ubuntu

Linux is notorious for diffcult to get USB Modem to work for dialup networking. (Built-in Modem on most notebook are so called Winmodem. It's used to be difficult to get them to work as well but much progress has been made thanks to http://www.linmodems.org/)

After much research and a little bit of experimentation, I got a Dynex DX-M300 USB modem working on Xubuntu. This modem is relatively cheap and easy to find online. Here are my steps:

1) Download the HSF driver from Linuxant. Choose the link for Ubuntu.

2) Install using dpkg (i.e. Method B on this page)

3) Open a terminal and run wvdialconf

4) Edit /etc/wvdial.conf and change Phone/Password/Username for your ISP

5) Run wvdial. It will dial the number and make the PPP connection for you. After it connects successfully, it will show the local and remote IP as well as the primary/secondary DNS server IP. Keep the terminal open.

6) Now you could surf web!

Notes:
1) For some reason the modem doesn't work after I boot the machine with it plugged in. In that case only the power light come on. I had to disconnect and reconnect. Then the MR light will also come on and it will work.

2) The free version of the Linuxant driver has its max speed limited to 14.4kbps. If you want to go full speed at 56k, you could buy a license from them for $20. (I haven't tried it)

3) If your modem is plugged into USB and is detected properly, lsusb should show:
Bus 002 Device 002: ID 0572:1301 Conexant Systems (Rockwell), Inc.

Saturday, January 12, 2008

Wine problem on Gutsy

We got an error when we follow WineHQ's suggestion on installing Wine thru apt-get. Basically it complains about the dependency on libaudio2 but it is not installable.

Solution? Open Synaptic Package Manager and follow
sdibias's reply on this thread

Netgear WG311v2 PCI Wifi working on Ubuntu

We repurposed my brother's old PC to a Ubuntu Gutsy Gibbon-based Media Center. (It's free upgrade! What's not to like?) However, it is not for the faint hearted. Even though the current generation of Linux is much user friendlier than the past. You still couldn't expect everything just works out of the box. For example, we tried using just the GUI to config the Wifi adapter to connect to the AP without success. Finally we found this very useful guide. Basically, all that were required are:
1) run iwlist (see section 6.8) to find out details of your AP (most importantly, the MAC address)
2) run iwconfig (see section 3.3 for the specific options) The command must include:
- the "name" of the AP, i.e, the ESSID,
- the MAC address
- the "password" (if you use WEP. I haven't tried WPA)

My iwconfig command complains about the mode but it still works.

May your installation to be as smooth as ours.