Code Snort
Snorting........mmmmm
Saturday, March 17, 2012
Friday, March 16, 2012
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 https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Remove broken rvm apt-get (if installed usign apt-get)
sudo rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/share/ruby-rvm
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 https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Remove broken rvm apt-get (if installed usign apt-get)
sudo rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /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( !db.open() )
{
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();
else
qDebug() << "Table Created";
/*qry.prepare( "INSERT INTO people VALUES ('Momontar',56)" );
if( !qry.exec() )
qDebug() << qry.lastError();
else
qDebug() << "Momontar Values inserted";*/
qry.prepare( "SELECT * FROM people");
if( !qry.exec() )
qDebug() << qry.lastError();
else
{
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; qry.next(); 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.
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( !db.open() )
{
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();
else
qDebug() << "Table Created";
/*qry.prepare( "INSERT INTO people VALUES ('Momontar',56)" );
if( !qry.exec() )
qDebug() << qry.lastError();
else
qDebug() << "Momontar Values inserted";*/
qry.prepare( "SELECT * FROM people");
if( !qry.exec() )
qDebug() << qry.lastError();
else
{
qDebug( "Selected success");
QSqlRecord rec = qry.record();
int cols = rec.count();
for( int c = 0; c
for( int r = 0; qry.next(); r++ )
for( int c=0; c
}
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;
Subscribe to:
Posts (Atom)