пятница, 25 февраля 2011 г.

Installation mongodb+php on Ubuntu/Debian

By looking in internet for way to install mongodb driver I have found only truncated instructions. And there will be my complete guide :)

First of all we need to install mongodb server:
 sudo aptitude install mongodb  
And try whether it works:
 $ mongo  
 MongoDB shell version: 1.6.6-pre-  
 connecting to: test  
 > show dbs  
 admin  
 local  
Now we can install pear
 sudo apt-get install php5-dev php-pear  
and download & install mongodb driver for php
 sudo pecl install mongo
now we have to create file /etc/php5/conf.d/mongo.ini and write 1 line in it
 extension=mongo.so  
restart apache
 sudo /etc/init.d/apache2 restart  
and try some php code like that:
 <?php
 var_dump(new Mongo());  
in my case output was
 object(Mongo)#1 (4) {  
  ["connected"]=&gt;  
  bool(true)  
  ["status"]=&gt;  
  NULL  
  ["server":protected]=&gt;  
  string(0) ""  
  ["persistent":protected]=&gt;  
  NULL  
 }  

среда, 9 февраля 2011 г.

putty autoreconnect

I'm having hard time right now... while using Windows. And one of problems is using PuTTY. This is great software for Windows world, but extremely unusable for me as Linux user.
Having all the time yakuake terminal running number of sessions, I sometime open ssh-sessions and they never lose connection even if I'm not using them (except internet loss or downtime). So I was expecting same with putty or auto-reconnect feature at least.

In fact there is simple solution, which i get on superuser.com. I just set up keepalive in Connection settings.