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.

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_())
Dec 062010
 

Executing jobs in parallel using GNU parallel

Answer:

GNU parallel is a tool for executing jobs in parallel. It is not part of standard Linux distribution yet, so it is so worth to install it.

You can download the latest version from: http://ftp.gnu.org/gnu/parallel/

E.g.

# wget http://ftp.gnu.org/gnu/parallel/parallel-20101202.tar.bz2
# tar -jxvf parallel-20101202.tar.bz2
# cd parallel-20101202
# ./configure
# make && sudo make install

Example usages:

#  echo -e "a\nb\nc"  | parallel echo "foo"

foo a
foo b
foo c
Nov 302010
 

Show the Domain Name Servers for a domain

Answer:

To show the Domain Name Servers for a domain, use the command below:

E.g. example.com

# nslookup -type=ns example.com
Server:         203.98.160.11
Address:        203.98.160.11#53

Non-authoritative answer:
example.com     nameserver = b.iana-servers.net.
example.com     nameserver = a.iana-servers.net.

Authoritative answers can be found from:
a.iana-servers.net      internet address = 192.0.34.43
b.iana-servers.net      internet address = 193.0.0.236
b.iana-servers.net      has AAAA address 2001:610:240:2::c100:ec