Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Render web page using PyQt

Answer:

Qt bindings to WebKit have been added since 4.4, so you can use PyQt to script the browser (Webkit based).

Firstly, make sure you have installed the need packages:

# sudo apt-get install libqt4-core libqt4-webkit python-qt4

Then you can write a simple script to test, e.g.

#!/usr/bin/env python

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

app = QApplication(sys.argv)

web = QWebView()
web.load(QUrl("http://www.google.com"))
web.show()

sys.exit(app.exec_())

How to update RubyGems?

Answer:

To update the the RubyGems installed in Ubuntu, enter the command below:

# sudo gem update --systemNow

That's it.

How to get the full list of Ubuntu's managed Perl modules?

Answer:

The full list of Ubuntu's managed Perl modules is here (for lucid): http://packages.ubuntu.com/lucid/perl/

You can use apt-get into install those modules, instead of CPAN. The advantage is you can remove them easier with the apt-get command, while for CPAN, you need to do it manually.

Install RubyOnRails in Ubuntu

Answer:

In the last article, we talked how to install Ruby in Ubuntu. Now, we are going to install a very popular web framework for Ruby - RubyOnRails.

Firstly, you need to install RubyGems, a gem is a packaged Ruby application or library.

# sudo apt-get install rubygems

Then, we use the gem command to install rails.

# sudo gem install rails

That's all.

Install Ruby in Ubuntu

Answer:

To install Ruby under Ubuntu, you need to type the commands below:

# sudo apt-get install ruby-full build-essential

The above command will install more than the Ruby interpreter, but they are useful when you want to play with RubyOnRails later.