Saturday, March 17, 2012

Installing Zabbix server

Friday, March 16, 2012

Current Linux path


Purge MySQL

apt-get remove --purge 'mysql-.*'

apt-get remove --purge 'mysql-server.*'

Friday, January 27, 2012

Problems with ruby-rvm to install 1.9.3

run rvm get head before rvm install 1.9.3

ERROR: Error running 'bunzip2 < '/usr/share/ruby-rvm/archives/ruby-1.9.3-.tar.bz2' | tar xf - -C /usr/share/ruby-rvm/tmp/rvm_src_7196', please read /usr/share/ruby-rvm/log/ruby-1.9.3/extract.log
ERROR: There has been an error while trying to extract the source.
Halting the installation.
ERROR: There has been an error fetching the ruby interpreter. Halting the installation.

The best way to install is still
$ bash -s stable < <(curl -s

Remove broken rvm apt-get (if installed usign apt-get)

sudo rm -rf /etc/rvmrc /etc/profile.d/ /usr/local/rvm /usr/share/ruby-rvm

Monday, May 23, 2011

Qt and SQlite Database Basics

1.Add this into .pro file:

QT += core gui sql

2.Add this headers

#include QSqlDatabase
#include QtSql
#include Qtdebug

3.Add this code

QSqlDatabase db = QSqlDatabase::addDatabase( "QSQLITE" );

db.setDatabaseName( "nameAge.db");

if( ! )
qDebug() << db.lastError();
qFatal( "Could not find db.");

qDebug( "Connected!" );

QSqlQuery qry;

qry.prepare( "CREATE TABLE IF NOT EXISTS people ( name string, age integer)" );
if( !qry.exec() )
qDebug() << qry.lastError();
qDebug() << "Table Created";

/*qry.prepare( "INSERT INTO people VALUES ('Momontar',56)" );
if( !qry.exec() )
qDebug() << qry.lastError();
qDebug() << "Momontar Values inserted";*/

qry.prepare( "SELECT * FROM people");
if( !qry.exec() )
qDebug() << qry.lastError();
qDebug( "Selected success");

QSqlRecord rec = qry.record();

int cols = rec.count();

for( int c = 0; c qDebug() << QString( "Column %1: %2").arg( c ).arg( rec.fieldName(c) );

for( int r = 0;; r++ )
for( int c=0; c qDebug() << QString( "Row %1, %2: %3").arg( r ).arg( rec.fieldName(c) ).arg( qry.value(c).toString() );


4.You'll find the nameAge.db in the projectName-Build folder.

Thursday, May 19, 2011

Recover MediaWiki Admin password

query this line UPDATE user SET user_password = md5(CONCAT(’1-’,md5(‘yournewpassword’))) WHERE user_id = 1;