André-Philippe Paquet's Blog
Sunday, November 20, 2011
cps (count per second)
Monday, February 21, 2011
GoStore going OpenSource
Anyway, this post isn't really about the end of my degree, but about my end of degree project. My work at Wajam made me discover the world of distributed and scalable systems and I decided to dive into this world by creating my own distributed system. As I like learning new technologies, I decided to create a distributed file system in Go, a new programming language announced by Google at the end of 2009. Go combines the simplicity of a garbage collected language, the speed of a natively compiled language and new concurrency mechanisms. It's not an object-oriented language since it doesn't support inheritance, but it supports polymorphism using interfaces.
Tuesday, January 5, 2010
Blocking django admin to non-admin
from django.http import Http404class AdminDisableMiddleware(object):def process_view(self, request, view_func, view_args, view_kwargs):full_view_name = '%s.%s' % (view_func.__module__, view_func.__name__)if full_view_name.startswith('django.contrib.admin') and not request.user.is_superuser:raise Http404()
Thursday, December 3, 2009
Midealy
Finally, the project I have been working on for months now is online! Ok, it’s a closed alpha release, but it’s a major step for us! So, what is this all about?
The idea behind Midealy is to connect innovators, resources and organizations together and help innovators develop their idea collectively. First, it uses the power of social networking to match innovators to the people they need to develop their ideas. It also provides tools for those innovators to develop their ideas (wiki, checklists, etc.) and a way to tell the community what they need to develop their ideas (human resource, technical resource or financial resource). Those needs are shown on a dedicated section of Midealy on which people can find need they can fulfill and then join the idea. Finally, organizations can use Midealy to resolve their problems by submitting challenges that can be resolved by ideas that people suggest. This concept is called Open Innovation.
Maybe it’s hard to see what Midealy is all about from my description (maybe because I’m not that good to explain it in English), but giving it a try should help you find out. You can get an invitation by submitting your email address on Midealy and you will receive an email as soon as we are ready for some more users!
Thursday, July 16, 2009
Firefox + FirePHP
Monday, March 9, 2009
Hbase: Too many open files
2009-03-09 20:26:21,072 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: DatanodeRegistration(127.0.0.1:50010, storageID=DS-1758498865-127.0.1.1-50010-1236539641254
, infoPort=50075, ipcPort=50020):DataXceiveServer: java.io.IOException: Too many open files
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
at sun.nio.ch.ServerSocketAdaptor.accept(ServerSocketAdaptor.java:84)
at org.apache.hadoop.hdfs.server.datanode.DataXceiverServer.run(DataXceiverServer.java:130)
at java.lang.Thread.run(Thread.java:619)
The error is verbose, but I had problem raising this limit until I found this post. It seems like you have to modify two files to raise the limit on ubuntu. First of all, you need to add the following line to /etc/pam.d/common-session (as root):
- session required pam_limits.so
- hadoop hard nofile 65000
- hadoop soft nofile 30000
Saturday, November 29, 2008
Thrift + HBase + PHP
Hbase database has a Thrift interface, so it can be called from any language supported by Thrift. It's the easiest way right now to call Hbase from PHP. Here is a little tutorial on how to install Thrift on Ubuntu and how to generate PHP client files used for Hbase access.
First of all, for any information about Thrift, you can have a look at Thrift wiki. This tutorial also take in account that you have apache and php5 installed and working in your ubuntu system.
Install requirement
(From: http://wiki.apache.org/thrift/GettingUbuntuPackages)
You need to install the following packages in order to compile Thrift:
- Automake
- LibTool
- Flex
- Bison
- Boost Libraries
sudo apt-get install build-essential automake libtool flex bison libboost*Installing Thrift
(From: http://wiki.apache.org/thrift/ThriftInstallation)
Get latest Thrift sources, unzip and go into the directory:
wget -O thrift.tgz "http://gitweb.thrift-rpc.org/?p=thrift.git;a=snapshot;h=HEAD;sf=tgz"Take note that the above source couldn't compile on Ubuntu 8.10. I had to use a special snapshot from http://gitweb.thrift-rpc.org/?p=thrift.git;a=snapshot;h=1c8c4bb279578cb76bfcaa419d5b06fb7a187614;sf=tgz
tar -xzf thrift.tgz
cd thrift
Let's now configure, compile and Install Thrift
./boostrap.shGenerating Thrift client libraries
./configure
make
sudo make install
You should now have a fresh Thrift installation. We now need to generate PHP files that will be included in your application in order to access Hbase. Hbase definition file has been included in Hbase sources, so we will not have to write it. If you have installed Hbase into /usr/local/hbase/, you can copy Thrift definition file into your home:
cp -r /usr/local/hbase/src/java/org/apache/hadoop/hbase/thrift ~/thrift_srcElse, you need to modify the above command to match your Hbase installation path. We can now generate PHP files:
cd ~/thrift_src
thrift -php Hbase.thriftIf you have followed all above the steps correctly, Thrift should have generated a directory named gen_php wich contains 2 php files. Those two files contains classes you will use to access hbase. But those files also depends on Thrift base files that you can find in thrift source directory. Following steps assume that your apache home directory is /var/www. Let's copy Thrift base files and create a "packages" directory wich will contains previously generated files.
cp -r ~/thrift/lib/php/src /var/www/thriftLet's now start Hbase thrift server.
mkdir /var/www/thrift/packages
cp -r ~/thrift_src/gen_php /var/www/thrift/packages/Hbase
/usr/local/hbase/bin/hbase thrift startAll you need to access Hbase from PHP is now ready to be used. To test the installation, let's use the demo client from Hbase sources.
cp /usr/local/hbase/src/examples/thrift/DemoClient.php /var/www/DemoClient.phpYou need to modify the above file (/var/www/DemoClient.php) in order to change Thrift root path. Simply change the value of $GLOBALS['THRIFT_ROOT'] to /var/www/thrift. You should now be able to access the file through apache. The script simply test your hbase installation by creating a table, insert data in it, etc.
That's it. If you have any question, contact me!