Posts

Showing posts from March, 2013

SSH passwordless login - debug2: we did not send a packet, disable method

Image
When managing a lot of server it's quite convenient to set up SSH to login without asking for a password. The method consists of just 4 simepl steps. generate a public and a private key pair ssh-keygen -f keysfile upload the public key to the server in your home folders "~/.ssh" directory (create it if it's not there) keysfile.pub to remotehost/~/.ssh folder dump that key to the accepted keys (in the same .ssh folder) cat keysfile.pub > authorized_keys login to the server using the private key from your client ssh -i keysfile [email protected] If something goes wrong, try running SSH with debug messages: ssh -i keysfile [email protected] -vv If you see the following error message: debug2: we did not send a packet, disable method it's most probably because the server cannot access the authorized_keys file. Some howtos just add your keyfile's name to authorized_keys but that failed for me all the time. Dumping the public key to the

Android jQuery AJAX requests may be missing parameters

Image
When using jQuery to fetch JSON data from a service on an Android browser, depending on the setup the server may or may not receive all the parameters with the request. Even though the following code is perfectly correct the "active" parameter is some cases never reaches the server: $.ajax({ url : "/survey/listjson", dataType : "json", contentType: "application/json", cache : false, data: {"active" : activeOnly}, success : function(e) { var surveys = []; for ( var i = 0, survey; survey = e[i]; i++) { surveys.push(new Survey().extend(survey)); } callback(surveys); } }); To fix it, try removing the contentType and dataType parameters. It does not really help either the server or the client but in some (older) mobile browsers will cause issues.

Getting started with HBase in Java - column family, column, key, value and timestamp

Image
Apache HBase is a very interesting database inspired by Google Bigtable . Its main purpose is to look up and store multiple key-value pairs by a single key. Even though it requires a bit different thinking than relational databases, for not (too) relational but extremely large datasets it is pretty much the only scalable approach. Working with very large amount of data in HBase is quite easy as each keys (which are byte arrays too) are simply mapped to single machines in the cluster so the lookup by key is still very fast and very simple. If you want to look up by anything else the best approach is either rely on an external indexing service (like Apache Lucene ) or roll your own. Key to Value HBase itself is just a simple storage that provides mapping from a Key -> [Column Family A] [Column Family B] … and from each column family [Column Family A] -> [[Key K] [Value] [TS]], [[Key L] [Value] [TS]] … The timestamp is a very important part of HBase, as each write modi