Installing MySQL for Python on Mac OSX Leopard

Yesterday, I have a sudden request from sysadmins group to make a web data presentation from their OVO data. I’ve already had some kind of template for the web apps using CodeIgniter based framework. The only “work” to do now is how to get, process and displaying the data from raw. It’s gonna be supplied via text file.

So, I came up with an idea to use Python to do collection, conversion and inserting into database 😛 Ya ya ya, I actually I just wanna try to learn Python and use it in a production environment 😀 So, it’s gonna be my first Python application hehehehehe.

My yukiyanagi (MB403LL/A MacBook) is already equipped with Python 2.5.1. Done with file checking, reading, parsing etc. It’s now time to put all parsed data into database.
What you need to do are:

  1. Download MySQL from dev.mysql.com/downloads and install it as instructed in the documentation.
  2. Download and extract the MySQL for Pythom from sourceforge.net. I’m using MySQL-python-1.2.2.tar.gz
  3. Open Terminal and go to the directory where MySQL-python-1.2.2.tar.gz was unpacked to.
  4. It’s better to delete build/ directory, just in case your installation might be interfered with any previous builds
  5. edit file site.cfg, and edit the value of mysql_config to the correct PATH where your mysql_config reside. Mine is:

    # The path to mysql_config.
    # Only use this if mysql_config is not on your PATH, or you have some weird
    # setup that requires it.
    mysql_config = /usr/local/mysql/bin/mysql_config

  6. After that, run the build and installation script.

    python setup.py build
    python setup.py install

During “python setup.py build”, you might have some problem here like I did. It seems that there is an extra ‘mysql’ in the path that the shared object looks for the .dylib. You may get an error like this:

ImportError: dlopen(./_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib

Referenced from: ./_mysql.so
Reason: image not found

The solution is by making a symlink from /usr/local/mysql/lib to /usr/local/mysql/lib/mysql

cd /usr/local/mysql/lib
ln -s /usr/local/mysql/lib mysql

Another error which might be occured is gcc related like the picture below:
MySQL for Python installation error

Line 47 of /usr/local/mysql/include/mysql.h is:

#include <sys/types.h>

Line 93 (and 93) of /usr/include/sys/types.h is:

typedef unsigned short ushort; /* Sys V compatibility */
typedef unsigned int uint; /* Sys V compatibility */

All you need to do is comment those 2 lines (dont forget to make the backup first)
and do the “python setup.py build”.
Voila! Everything will be running well.

Howto: Setup Huawei E220 HSDPA USB Modem with Leopard

In my previous post, I wrote that I was having trouble to get ZTE MF622 work on my Leopard. Not solved yet until now. 

Today, Derry was kindly enough to lend me his Huawei E220 HSDPA Modem. It’s Telkomsel Flash modem package but already been unlocked. So, I can use any SIM card from any available GSM operator. But unfortunately, the E220 driver for Mac from Telkomsel is not working on Leopard. So, I need to google to find the suitable driver for that.

So, how to install Huawei E220 HSDPA USB modem on Mac OSX Leopard:

  1. Download the driver here or here (add .dmg after the file name)
    E220.dmg
  2. Extract the package file (E220.dmg) and run the file "Mobile_Connect_Drv_App.pkg"
    Run installer
  3. Follow the wizard
    Continue
  4. Read the agreement, and continue if you agree
    Agree

    Aggree

  5. Select installation destination
    Agree

    Aggree

    Password

  6. Continue Installation

 

How to setup GPRS/3G/HSDPA connection with Huawei E220 on OSX Leopard:

  1.  Insert the SIM card into the data card. 
  2. Connect the data card to your PC. 
  3. Open the Finder window, and select Mobile Connect in the Application directory. 
    mobile connect
  4. Then launch the management program of the Mobile Connect. If the Personal Identification Number (PIN) code of the data card is locked, the system displays the Verify PIN dialog box for you to enter the PIN code. 
  5. If you enter wrong PINs for three consecutive times, the system displays the PIN Unblocking Key dialog box for you to enter the valid PIN Unblocking Key (PUK). Then the Mobile Connect interface is displayed.

    Note: 

    • If you enter wrong PUKs for ten consecutive times, the SIM card is invalid permanently
    • The PIN and PUK are delivered with the SIM card provided by your service provider. For details, consult your service provider.
  6.  Now, we create a profile. From Mobile Connect UI above, click on Setting button
    Create profile

    Click on New button
    I’m using Telkomsel Flash service, therefor I create a profile like picture above.
    Dont forget to use PAP as Authentication method.
    Click Save then OK if you finish creating profile

  7.  Select the profile you want to use and click Connect
  8. During the dial-up access, the Mac OS X system requires you to enter the account and password of the system administer. You can access the Internet only when the correct account and password are entered.
  9. When you access the internet successfully, the system displays the prompt, saying “Connection successful!”.

  10. IMHO, I think Huawei have better english in the UI compare to his ‘brother’ 😀 This is what i’ve got from MF622 UI 😛 Connect estalish
  11. Voila! Now I’m connected to Telkomsel Flash network

  12. When you try to browse for the first time after connected, you will be redirected to http://flash.telkomsel.com/id/HalamanUtama.php.
    Choose the package you want.

  13. You’ll have this page after finish selecting a package
  14. Checking IP
  15. Start browsing

That’s all. I hope this tutorial can help you (the Leopard & Telkomsel Flash users) to setup Huawei E220 modem on your Mac 🙂

 

Read this post on my new blog
http://nuy.nurikidy.com/2008/05/21/howto-setup-huawei-e220-hsdpa-usb-modem-with-leopard/

IndosatM2 ZTE MF622 driver on Leopard = problem?

 Anyone having this kind of problem?

Installation failed

I have a ZTE MF622 USB HSDPA card (not mine actually), provider is IndosatM2. Try to install the driver downloaded from IndosatM2 download page. But after trying and trying, I got no luck to make it work …. *sigh*

Some friends said that ZTE MF622 is SUX for Leopard and Linux, and i think they’re right about that… *pats* Belutz 😀

Anyone could help? Indosat ppl?

I think I need to borrow Huawei E220 to test on my Mac 🙂

Telkomsel Prepaid Blackberry Internet Service

As I promised regarding to Telkomsel’s new service Prepaid Blackberry Internet Service, these are the information I’ve got

Features:

  • Tariff Rp.180K/30 days
  • Unlimited Access for BlackBerry.net APN
  • BlackBerry.net APN can be used for send/receive emails, browsing, IM, etc if subscribers using BlackBerry Handheld
  • BlackBerry.net APN can be used for send/received emails if subscribers using BlackBerry Connect device.
  • Support 10 POP3/IMAP4 email accounts + 1 telkomsel.blackberry.com email account
  • Support BlackBerry Connect (Nokia, Sony Ericsson, Dopod, HTC, Motorola, etc)
  • Self Activation by Subscribers via SMS

Registration:

  • Send SMS BB<Space>REG to 333 to request for activation
  • For confirm the activation, subscribers must send BB<space>ON to 333, It will activate the service on subscriber’s SIM Card
  • Subscribers will be charged Rp.350,-/SMS for send to 333
  • After that, restart the handset
  • And register PIN, IMEI, & Email accounts on http://telkomsel.blackberry.com or via email setting on BlackBerry HandHeld

Unregistration:

  • Send SMS BB<Space>UNREG to 333 to request for deactivation
  • For confirm the deactivation, subscribers must send BB<space>OFF to 333, It will deactivate the service on subscriber’s SIM Card
  • Subscribers will be charged Rp.350,-/SMS for send to 333
  •  

 

The 1st in Asia

Telkomsel will lauch a new service called Telkomsel Prepaid Blackberry Internet Service (BIS).

To be noted:

  • It’s for Telkomsel PREPAID subscriber (simPATI, kartuAS)
  • It’s claimed to be the 1st in ASIA
  • You don’t need to buy a new special SIM Card, use your existing Telkomsel Prepaid SIM Card
  • You don’t need to buy a special voucher. You can buy any regular Telkomsel Prepaid voucher
  • Price? Well it’s planned to be offically launched on May 15th, 2008. So wait after that or you can visit the nearest Ghrapari or contact Telkomsel callcenter 🙂

I’m not a Blackberry user, I dont even have one and  dont intend to have one also (except somebody give me one for free :P)

But I got this invitation, hehehehehe

tsel blackberry invitation

Well, all I need is a mini laptop (such as Asus EEEPC 900 or HP Compaq 2133) and highspeed internet connection

I wish someday I could afford to buy one, or at least having my MacBook upgraded into MacBook Pro 😛

 

 

Internet Bank Permata = SUX

Saya dah banyak nulis keluhan di sini soal Bank Permata, it was sux and now still sux.

Barusan saya login untuk cek saldo dan transfer duit buat beli kaos, dan ternyata saya ga bisa login sama sekali dengan error message ga jelas di IE dan muncul error message soal username di Safari. And i’m not making mistake with my username and password.

*(^*)!%*_!_$^!*(_$^(_!^$%@*

Saya jadi semakin ragu sampe ke lowest level soal kualitas internet banking Bank Permata ini. Buat user yang lain, berhati-hatilah …..