May 15, 2013

How to charge iPad/iPhone on linux(OpenSuse)

Im not sure if this already in the package repository OpenSuse. Since Spec file already already found opensuse. As I say Im NOT SURE, But I want you to try if you are use the latest/later version of OpenSuse. Currently Im using OpenSuse 11.2.

Try to go in your YAST package and search "ipad_charge". If exists, your lucky. :) But If not. Try to compile it. Please follow instruction below.

Initial requirement:
1 libusb-1.x.x and libusb-1.x.x-dev
2. gcc

1. Download the ipad_charge source to Rainbow Software or ipad_charge.

2. Remember to Install libusb-1.x.x and libusb-1.x.x-dev.
3. Extract the downloaded source code of ipad_charge.
syntax3rror@syntax3rror:~/Utils> tar -xzf ~/Installer/ipad_charge_1.1.tar.gz
4. Change the directory where you extractthe source. For me I extract Utils.
syntax3rror@syntax3rror:~/Utils> cd ipad_charge-1.1/
5 Compile and install the source code.
sudo make install
That's it, your DONE.

Possible error encounter.
syntax3rror@syntax3rror:~/Utils/ipad_charge-1.1> make
gcc -Wall -Wextra ipad_charge.c -lusb-1.0 -o ipad_charge
ipad_charge.c:7:31: fatal error: libusb-1.0/libusb.h: No such file or directory
compilation terminated.
make: *** [ipad_charge] Error 1
This error encounter when you forgot to install libusb-1.x.x and libusb-1.x.x-dev.

May 2, 2013

magento: How to get the current login customer?

Get the customer session
$customer = Mage::getSingleton('customer/session')->getCustomer();

Get customer properties.
$customer->getName(); // Full name
$customer->getFirstName(); // First name
$customer->getLastName(); // Last name

You can also get other customer custom attribute, like nick_name

If you think you need to know the current admin user try this one.