Monday, January 21, 2013

One line command to add host in /etc/hosts at mac os


If i simply echo and output to /etc/hosts, i will get permission denied



sudo echo 127.0.0.1 myhelloword.localhost >> /etc/hosts
-bash: /etc/hosts: Permission denied


That's because echo is being run as root, but shell is the one who actually performing the redirection. The solution will be spawn a new shell to make this work:


sudo -- sh -c "echo 127.0.0.1 myhelloword.localhost >> /etc/hosts"

VMware CentOS 6.3 Network issue

I just grab new centos and start with "basic server" installation within VMWare delivered no IPAddress and etc.

Simply just run
"ifup eth0" to solve the problem



Friday, January 18, 2013

Avoid WordPress Asking FTP Credentials When You Install/ Upgrade Plugins


If you are using php fastcgi and PHP runs under the same user as the owner of the files you don’t have to use FTP at all. WP can directly access the files. Just add the following to your wp-config.php file:

define( 'FS_METHOD', 'direct' );
define( 'FS_CHMOD_DIR', 0777 );
define( 'FS_CHMOD_FILE', 0777 )

Friday, January 11, 2013

Passbook


PASSBOOK COUPONS AND PASSES DELIVERY

Passbook is a new app in iOS that works as a virtual container for all your passes, ticket, discount coupons, loyalty cards and gift cards. As a web developer you may want to serve the user with a discount coupon, a ticket to an event, an e-ticket for your next flight or a loyalty card.
Apple allow websites to deliver this kind of passes from a website without the need of a native app.
To deliver the pass on your website you just need to use the MIME type application/vnd.apple.pkpass or send it through email
Apple provides a tool that you can install on your server to package and sign customized passes on the fly that may include current user information
To pass file is just a JSON meta-data file and a couple of images. We need to package the file and sign it. Unfortunately, to sign the pass we need a signature from Appleand that means that the web developer needs an iOS Developer Program account ($99/year). If you receive the pass already signed, you can just insert it on your own site.
One of the great features of passes is that once installed you can provide some web services on your end and through Push Notification Services, the operating system will call your web services to update the information on the pass.
More information at developer.apple.com/passbook
There are website for you to create passbook coupons

There is  

For android, this is the app can import ios PKPass https://play.google.com/store/apps/details?id=com.attidomobile.passwallet&hl=en