Posts

Showing posts from October, 2011

Abt Some Linux Commands

Interesting Linux Terminal Commands Notation => | - Cursor CTRL + w = Delete a word of the command typed Ex: $ echo this is a line| $ echo this is a |[After ^w] CTRL + b = Move the cursor one character left[Backward] Ex: $ cat filename| $ cat filenam|e CTRL + a = Move to the start of the command [Equivalent to Home] Ex: $ cat filename| $ |cat filename CTRL + u = Clear the command from the cursor's point Ex: $ cat file1 |file2 $ file2 CTRL + r = Reversed search, Searchs for the pattern in the commands entered in the past and displays one after another continuously [Last entered command first] CTRL + e = Move to the end of the command Ex: $ cat |file1 file2 $ cat file1 file2| !! = Executes the last entered commmand !$ = Returns the last argument of previously entered command Ex: $ mkdir /home/user/temp $ cd !$ !pattern = Executes the last command with this pattern !pattern:p = Prints the last command with this pattern instead exec

Cassandra CQL PHP

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)#