Setting up chrome/firefox in linux based x86_64 EC2 instance In this post we'll see how to setup chrome/firefox in EC2 instance. Further we'll discuss the way to setup chromedriver with selenium [java] in EC2 instance aswell. Why is that difficult? Linux based EC2 instances lack gtk+ , which is a must to launch any GUI enabled applications. How to solve? Compile gtk+ from source. This gist by joekiller has the complete dependency tree resolved for installing gtk+ for x86_64 machines. Line 77 Basically installs firefox from its tarball. You can comment it out incase if you don't wish to. Incase Line 42 fails. Do a wget for direct tarball from here , instead the complex recursive wget. For Ex: wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-x86_64/en-US/firefox-18.0.2.tar.bz2 So, All done? Nopes, Now we can't run either of the browsers as we lack X11 server which does graphics operations & screen outputing. As our envir...
Hi, I think now I'm eligible to publish a blog post regd CQL. I wish this blog to be a tutorial rather a Syntax provider for various CQL queries Points to remember 1. CQL doesn't support Composite Types[likely to chage] 2. CQL doesn't support Super columns 3. Counter values are returned in native format [atleast in php/using cqlsh] Why should I prefer CQL? 1. Readability 2. Ease of use 3. SQL like 4. Stable Support: PHP => My Posts using PHPCassa Python => Refer Here and Download it here Java => JDBC Driver and Example is here Ruby => This might help Creating a Keyspace: cqlsh> CREATE KEYSPACE sample WITH strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' ... AND strategy_options:replication_factor = 2; Note: : => Option Specifier Use a Keyspace: cqlsh> USE sample; Note: Don't forget to USE before use 'Sample' and 'sample' are different. Create Column Family: cqlsh...
After lots of googling I figured out how to access counter columns value via PHPCassa + CQL. Though it might not be efficient, this is all I was able to figure out after a long struggle :) First Connecting to and Selection from Cassandra Instance via PHP using PHPCassa $pool = new ConnectionPool("Stats",$servers); $raw = $pool->get(); $rows = $raw->client->execute_cql_query("SELECT 'a' FROM Impressions WHERE KEY='xxx'", cassandra_Compression::NONE); To Return Connection $pool->return_connection($this->raw); To Update Counter value via PHPCassa $pool = new ConnectionPool("Stats",$servers); $raw = $pool->get(); $rows = $raw->client->execute_cql_query("UPDATE TestCounter SET 'counter'='counter'+1 WHERE KEY='xxx'", cassandra_Compression::NONE); You can find a wrapper here So, once you are done with fetch successfully. This is the result you may get object(cassandra_CqlResult)#...
Really nice :)
ReplyDelete