Archive for the 'Tutorial' Category

Sync iPhone Or iPod Touch Contacts With Nokia Using SyncML

Just got myself an iPod Touch 2G. I really like it though I don’t listen to music very much. iPod Touch comes with Contacts app but I didn’t use it because obviously iPod Touch can’t make a phone call (without VOIP app that is), unlike iPhone. So I thought it might be useful as a backup for my Nokia N95 8GB. After much of researching (technically it’s not really a research but a simple Google search but who cares, right?) I finally managed to sync contacts from Nokia to iPod and vice versa.

Okay, here are the things you’ll need:
1. Synthesis SyncML Client for iPhone/iPod Touch. Available for free in App Store.
2. iPod Touch/iPhone. Obviously.
3. Any phone that supported SyncML. I use Nokia N95 8GB for this matter.
4. An online SyncML account. I use Mobical.net.

Now, let’s get started:
1. Register an account with Mobical.net and configure your phone by following the instruction provided. For example my device’s configuration is like this:

Open the synchronization settings by navigating through the following menus:
Tools -> Sync
Select “Options” -> “New sync profile”
Select “No” to the copy value question
Sync profile name: Mobical.net
Select “Applications”
Select “Contacts”
Include in sync: yes
Remote database: con
Select “Back”
Select “Calendar”
Include in sync: yes
Remote database: caltask
Select “Back”
Select “Notes”
Include in sync: yes
Remote database: pnote
Select “Back”
Lifeblog: Not supported
Select “Text message”
Include in sync: yes
Remote database: sms
Select “Back”
Bookmarks: Nokia bookmark sync not supported by this service yet
Select “Back”
Select “Connection settings”
Server version: 1.2
Server ID: leave empty
Data bearer Internet
Access point Your default Internet connection
Host address: http://www.mobical.net/sync/server
Port: 80
Username: {yourusername}
Password: {yourpassword}
Allow sync requests: Yes
Accept all sync requests: No
Network authentication: No

NOTE: Before you start sync, make sure that the are no duplicate field name in a contact. For instance, if your contact keep several mobile numbers, make sure you label them as mobile for the first one, mobile (home) for the second one and mobile (work) for the last number. Some phone can’t display several info under one label. If this happens to you, log in to Mobical.net and edit from there, after that, start sync and all the infos will be back in your phone.

2. Once your device is configured, sync it to Mobical.net. The sync menu is found under Organiser, Tools, Communications, Settings, Connectivity or something similar.
3. Now, install Synthesis SyncML Client to iPhone/iPod Touch if you’re not done so yet.
4. When the client is installed, tap the icon labeled SyncML to run the client then tap Settings. Put the configuration below in the Server Settings.

Server
URL: http://www.mobical.net/sync/server
SyncML Version: SyncML DS 1.2/OMA DS 1.2
Ignore SSL errors: Off
Use Proxy: Off

Server Login
User: {yourusername}
Password: {yourpassword}

5. Back to Settings, tap Done. Tap Start Synchronisation and wait for it to finish populating iPod/iPhone’s Contacts database.

That’s it! Any changes made from iPod/iPhone will be available in your phone when you sync and vice versa. To automate the sync from your phone, install Swim if your phone is running on Symbian S60. You can read about Swim at Symbian-Guru.

 If you like this post, please buy me a coffee.

CakePHP ACL and Ajax

I’m building a web based application using ExtJS as the frontend and CakePHP as the backend. CakePHP built-in ACL returns 200 OK status even when the access was denied. The application uses Ajax a lot so I need CakePHP to returns appropriate response status so that I can inform the user if the requested access was denied. To configure ACL properly, you can follow the posts from Mark Story here and here for the part 2.

After that, just add the following code in app_controller.php

function beforeRender() {
        if ($this->RequestHandler->isAjax()) {
                if ($this->Session->check('Message.auth')) {
                        $this->Session->del('Message.auth');
                        header('HTTP/1.1 403 Forbidden');
                }
        }
}

Now, instead of receiving 200 OK status I get 403 Forbidden when access is denied. Hope this helps!

 If you like this post, please buy me a coffee.

Ubuntu Media Server: DHCP To Static IP

In my last post, I wrote about a mini PC I bought. After the PC arrived, I installed Ubuntu Server 8.04 LTS but I can’t get the LAN to work. After few hours trying to fix it, I simply gave up. Then, I downloaded daily build of Ubuntu Server from http://cdimages.ubuntu.com, burn the image to CD and installed it. LAN worked like a charm this time. During the installation, don’t forget to tick OpenSSH Server when prompted. We’ll need this to administer the server from outside LAN network. OK, next is to give it a fixed IP. This is how I (and everybody else) did it. Type the command below

sudo nano /etc/network/interfaces

It will open a file and it will show something like this

1
2
3
4
5
6
7
8
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp

Replace the last line to

8
iface eth0 inet static

and include these underneath it

9
10
11
12
13
        address 192.168.1.5
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1

Save and quit nano and then restart networking.

/etc/init.d/networking restart

Lastly, verify the IP by using

ifconfig

In the next post, I’ll show how to set up an FTP server.

 If you like this post, please buy me a coffee.