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.

May 102011
 

Disable a service in Ubuntu using upstart

Answer:

In newer version of Ubuntu such as 10.04, some services are managed by upstart and you cannot disable them by using the old method.

For example, to disable the OpenSSH server, you need to edit the file /etc/init/ssh.conf, comment out the following lines:

# start on filesystem
# stop on runlevel [!2345]

Then this service will not start when you reboot your machine next time. All the upstart configurations files are under this folder and feel free to try it out.

Mar 242011
 

Allow a remote IP for incoming connection in UFW (Uncomplicated firewall)

Answer:

To allow a remote IP for incoming connection in Ubuntu's UFW (Uncomplicated firewall), you can use the following command:

# sudo ufw allow from x.x.x.x

Of course you need to reload the firewall.

# sudo ufw reload

Mar 162011
 

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_())
Nov 252010
 

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.