PHP + Unicode : http://www.ibm.com/developerworks/library/os-php-unicode/
Friday, May 31, 2013
PHP + Unicode -> Good articles
Unicode in general : http://www.joelonsoftware.com/articles/Unicode.html
Tuesday, May 28, 2013
Saturday, May 18, 2013
Using Hiphop for PHP static analysis
1. Install hiphop on Ubuntu ( I just got an AWS EC2 instance) following these steps :
https://github.com/facebook/hiphop-php/wiki/Prebuilt-Packages-on-Ubuntu-12.04
2. Then run the hiphop command for static code analysis :
hhvm --hphp --target hhbc --input-list /tmp/files.list --output-file hhvm.hhbc.sq3
https://github.com/facebook/hiphop-php/wiki/Prebuilt-Packages-on-Ubuntu-12.04
2. Then run the hiphop command for static code analysis :
hhvm --hphp --target hhbc --input-list /tmp/files.list --output-file hhvm.hhbc.sq3
Building hiphop php on Centos 6.3(Didn't succeed)
I tried to follow the instructions here : http://stackoverflow.com/a/8132054/49560.
There were few things missing, which I am mentioning here.
1. Path of the third party patches has changed in the hiphop repo. So, find the correct path and then proceed. For me it was :
cp /home/ec2-user/hiphop/hiphop-php/hphp/third_party/libevent-1.4.14.fb-changes.diff .
cp /home/ec2-user/hiphop/hiphop-php/hphp/third_party/libcurl.fb-changes.diff .
There were few things missing, which I am mentioning here.
1. Path of the third party patches has changed in the hiphop repo. So, find the correct path and then proceed. For me it was :
cp /home/ec2-user/hiphop/hiphop-php/hphp/third_party/libevent-1.4.14.fb-changes.diff .
cp /home/ec2-user/hiphop/hiphop-php/hphp/third_party/libcurl.fb-changes.diff .
2. The version/location of tbb has changed.
Get it from : wget http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130425oss_src.tgz
3. Before doing cmake .
A. yum install subversion
B. install google glog
C. install libunwind-1.1, https://github.com/facebook/hiphop-php/issues/563
D. yum install elfutils-libelf-devel
E. get libdwarf
git clone git://libdwarf.git.sourceforge.net/gitroot/libdwarf/libdwarf
cd libdwarf/libdwarf
./configure
make
sudo cp libdwarf.a /usr/lib64/
sudo cp libdwarf.h /usr/include/
sudo cp dwarf.h /usr/include/
cd ../..
4. Now you do cmake . and then make. You may get an error saying that lock_guard is not a member of boost. So you need to replace boost::lock_guard with std::lock_guard in ThreadLocalDetail.h.
5. Now do make again. I got some errors which were beyond me - so giving up.
Saturday, May 4, 2013
Set up hadoop cluster on EC2
I followed : http://blog.cloudera.com/blog/2012/10/set-up-a-hadoophbase-cluster-on-ec2-in-about-an-hour/
There are few things missing here and there but it's a great help otherwise.
Here are the missing parts :
1. Get the EC2 command line tools : wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip.
Your EC2_HOME will point to the place where the above file will be unzipped.
2. Here are all the lines you will put in your ~/.bash_profile :
export AWS_ACCESS_KEY_ID=BKIAISLDPUEUJN2ILNTP
export AWS_SECRET_ACCESS_KEY=n+v7BZhFy5CwUqpC27C/q8/vJiz5+vy0YH4Z8yyV
export EC2_PRIVATE_KEY=/mnt/aws/aws-pk.pem
export EC2_CERT=/mnt/aws/aws-cert.pem
export EC2_HOME=/mnt/aws/ec2-api-tools-1.6.7.3/
export JAVA_HOME=/usr
3. After you launch your ubuntu instance - you need to go to AWS console and the corresponding security group - add rule for SSH - so that you can login to the box.
4. On the ubuntu box : put these 2 lines in .bashrc :
export AWS_ACCESS_KEY_ID=BKIAISLDPUEUJN2ILNTP
export AWS_SECRET_ACCESS_KEY=n+v7BZhFy5CwUqpC27C/q8/vJiz5+vy0YH4Z8yyV
5. Here is your hadoop.properties file for whirr :
whirr.cluster-name=whirrly
whirr.instance-templates=6 noop
whirr.provider=aws-ec2
whirr.identity=${env:AWS_ACCESS_KEY_ID}
whirr.credential=${env:AWS_SECRET_ACCESS_KEY}
whirr.cluster-user=huser
whirr.private-key-file=${sys:user.home}/.ssh/id_rsa
whirr.public-key-file=${sys:user.home}/.ssh/id_rsa.pub
whirr.env.repo=cdh4
whirr.hardware-id=m1.large
whirr.image-id=us-east-1/ami-1db20274
whirr.location-id=us-east-1
Subscribe to:
Posts (Atom)