Tag Archives: Linux

Building Qt Jambi 4.7 on Ubuntu 10.04

NOTE: This is an Ubuntu-only tutorial. Some parts of it may not work on other Linux distributions. For the general building documentation visit: http://qtjambi.sourceforge.net/development/building/.

Finally I’ve managed to compile the latest version of Qt-Jambi framework, here I’ll share with you my build-experiences and highlight the points where you can break something.
There is also a Building document on the official website of Qt-Jambi, what gives an overview about building on several platforms, here I’ll focus to Ubuntu 10.04.
Grab the latest version from git, because the development happens here. Type in Terminal:

git clone git://gitorious.org/qt-jambi/qtjambi-4_7.git

Important: always check it twice before cloning, there are more qt-jambi repositories hosted at http://qt.gitorious.org/, but with the given build dependencies just this one compiles – eventually the trolltech one if you compile it against system Qt.
The URL after gitorious.org/qt-jambi/ will be change from time-to-time, you can make sure that you have typed the right URL by navigating to the community git repository of Qt-Jambi, and copying the URL from Clone & push urls.

Assuming that you are using Ubuntu 10.04 so you don’t need the kde-phonon backend. The list of dependencies is:

  • For Qt-Jambi:
  • openjdk-6-jdk (or alternatively the sun-java-jdk)

  • For Qt itself:
  • phonon-backend-gstreamer

    You can install these from synaptic or copy/paste to the Terminal:

    sudo apt-get install openjdk-6-jdk ant-optional ant libxext-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev build-essential chrpath libgtk2.0-dev libexpat1-dev libfontconfig1-dev libfreetype6-dev libpng12-dev libcups2-dev libgtk2.0-dev libssl-dev libasound2-dev libdbus-qt-1-dev phonon-backend-gstreamer libqt4-dev libphonon-dev

    After cloning the repository and downloading the build dependencies go to the root directory of the cloned repository.
    In the Terminal session where you have checked out the git clone type:

    cd qtjambi-4_7

    If you have installed the libqt4-dev through the package management system then you don’t need to change anything.
    If you have your own compiled version of Qt then modify the variables qt.libdir, qt.includedir, qt.pluginsdir in buildpath.properties according to your Qt installation.

    Modify the version.properties file according to your Qt version (take a look to aptitude show libqt4-dev).

    Add the following environment variables to your ~/.bashrc file:

    #QTDIR bin
    export PATH

    #set for Qt home
    export QTDIR

    #set for Qt Libraries, usually QTDIR/bin
    export LD_LIBRARY_PATH

    #set for Java home (the exact path depends on your Java version)
    export JAVA_HOME

    Restart the Terminal to apply the new environment variables, and in the directory qtjambi-4_7 type:
    ant all

    When the build finished you can try running the Qt-Jambi demo program, by typing:

    java -cp "qtjambi-4.6.2.jar:qtjambi-linux32-gcc-4.6.2.jar:qtjambi-util-4.6.2.jar:qtjambi-examples-4.6.2.jar:qtjambi-designer-4.6.2.jar" com.trolltech.launcher.Launcher
    If you have any questions or errors during the building, please drop a comment or take a look to #qtjambi IRC channel on irc.freenode.org.

    Happy hacking.


    Internet Connection Sharing on Ubuntu & Windows with Ad-hoc 2.

    A few months ago I made a quick tutorial about Internet Connection Sharing focusing to the case when we are sharing the connection from a machine with Windows installed to the other PC with Linux operating system. In this guide I’ll show you the contrary case, how to share your incoming connection with Linux.

    First of all, make sure that you have installed the appropriate drivers for your network interfaces.

    Let’s get started with my configuration: I have 2 laptops, one with Ubuntu 10.04 (Laptop 1) and the other with Windows XP (Laptop 2) installed. Both have 2 networking interfaces, Wireless and Ethernet – in the rest of the text just wlan and eth.

    We need to share the incoming Internet connection from Ubuntu machine. This laptop is connecting with its network card to the modem with automatic IP address (through DHCP).
    I’ll connect my laptops through Wireless. Here is the configuration for the first wireless card (wlan0) on the laptop which is directly connected to the modem:
    Create a new Wireless connection, name it and set the mode to Ad-hoc.

    Under the tab IPv4 Settings set the following parameters:

    Gateway: Leave empty or set to the IP of your Ethernet card on this machine.

    Type the following command in root terminal, do not use sudo:
    First, configure the laptop for NAT-ing with the following command:
    # iptables -t nat -A POSTROUTING -o ethN -j MASQUERADE # (1)
    in my case N is 0, replace N with the number of the card which is directly connected to your modem.
    Set IP Forwarding:
    # echo 1 > /proc/sys/net/ipv4/ip_forward
    Install dnsmasq using apt-get:
    # apt-get install dnsmasq
    and restart it:
    # /etc/init.d/dnsmasq restart
    Add the following line to /etc/sysctl.conf:
    "net.ipv4.ip_forward = 1"
    Reboot and repeat (1).

    Before continuing with the next laptop make sure that you have working Internet connection on Laptop 1.

    First you need to create an Ad-hoc network on your Windows machine too:

    Because we are doing our sharing without any security, switch to Open network under Properties > Associations.

    Set the following configuration for the Laptop 2 with Windows installed:

    DNS: (must be the IP of the wireless card on Laptop 1).

    Comments are welcome, happy surfing! 🙂

    Internet Connection Sharing on Ubuntu & Windows with Ad-hoc


    First I was very excited when my brother asked for my help to choose him a laptop. My other task was to share our internet connection between a Desktop PC and two laptops without using switch or router. Of course the story became more interesting due to the different operating systems. I’ll try to show how to set up your home network in such situations.

    Important to make sure that you have installed drivers for networking interfaces!

    About the connection: cable-net,  the modem is connected to the Desktop-PC with USB.

    Configuring the wired interfaces:

    Desktop-PC has two networking interfaces, the first (in the following text: eth0) has automatic network  address through the modem (DHCP). We need to allow to the other computers in our network (in this case just one laptop) to connect to the internet through this connection [1].

    The another network interface of Desktop-PC is eth1 – it has static address, set to with subnet mask . We need to connect this network card (eth1) to one of our laptops directly. I connected it first to the laptop with Windows XP, of course you can connect it to the laptop with Linux but the Internet Connection Sharing and the IP configuration becomes more complicated in that case. When connecting our Desktop-PC and laptop directly we must to use crossover (crosslink) cable! So, we connected our Desktop-PC’s card (eth1) with our Laptop’s ethernet card (in the following text: eth2). The address configuration for this card need to be also automatic – eth1 will deal for eth2 an address, subnet mask and gateway too.

    Configuring the wireless interface on Windows:

    At this point you have working internet connection on both Desktop-PC and laptop (with the interface eth2). We’ll share this connection with the second laptop through an ad-hoc network. First of all you need to configure the eth2 card to allow the other computers in the network to connect to the internet through this connection ( see [1]).

    Create an Ad-hoc wireless network with your integrated wireless card (wlan0 in the following)  on the laptop with Windows XP (no encryption used in this example to simplify the setup).

    After creating an Ad-hoc network,  set static address for wlan0, IP:, subnet: You have configured your Windows machines, move to the laptop with Linux.

    Configuring the wireless interface on Linux:

    In this example I’m using Ubuntu 9.10 Karmic Koala, but you will find the same expressions on other Linux distributions and in different Network Configuration Interfaces. Create a new wireless connection and set the connection type to Ad-hoc.

    The most important part is the IP configuration. On your Linux laptop for the wireless interface (wlan1) set static addresses for IP: (actually the end of this address can be anything – in the allowed range – the only important thing is that it must be different from the last part of your static address of the interface wlan0), subnet, for Gateway and DNS set the IP address of the interface wlan0.

    Apply the changes and connect to this Ad-hoc network on your Windows and Linux laptops.

    If you have any question, please comment.

    Find executables for missing start menu applications

    You will find the most programs in your Start menu. They have search function. Type there the programs name, that’s all. But, sometimes it happens that the installer doesn’t create start menu entry.
    Our freshly installed package called tightvnc. So, if the program isn’t there, then you need to find the executable for it. In windows, you go to the place where the program was installed, and double click to the executable. In Linux: you need to open the Terminal, Konsole, whatever – the Command line.
    Like in windows you can search for all installed programs in Add Remove programs. Here is the alternative – a bit faster. Type in Command line (CLI) the following:

    rpm -qa | grep tightvnc

    the output will be all installed packages containing the name tightvnc. Copy the FULL name (including number) of the tightvnc package, this is what you need. Now type this:

    rpm -q --fileprovide [pasteherethefullname]

    This will output the complete list of files installed from this package. The executables are mostly in the /usr/bin/ directory.
    My output:

    akoskm@linux-3fx0:~> rpm -q --fileprovide tightvnc-1.3.9-80.41

    Now you can simple start any of these executables in the /usr/bin/ directory by typing them to the command line.

    Creating and mounting ISO images in Linux terminal

    There are thousand of applications outside for creating ISO images, and also a thousand for mounting and reading these virtual disks – but, have you ever thought that it’s possible through the Linux terminal, by using 2 simple commands? You’ll need 2 core applications: dd (DiskDump) and mount. These small applications are core components in every Linux distribution, so you don’t need to install anything. So, how to create ISO image with them?
    Insert a disk into your optical drive – of course it’s also possible to create ISO image from an USB disk. Open the terminal window, and execute:

    dd if=/dev/sr0 of=test.iso

    where if points to your optical drive (input file), of is the patch, where the ISO image will be created (output file).
    Now, our ISO image is done, lets go mount it! The first thing what we need is a mount point for our ISO image. Lets create one:

    mkdir isoTmp

    this will be the name of the directory where the ISO image will be mounted. Now mount the ISO with the command (only root can mount so you need superuser rights – and his password :)):

    sudo mount -o loop test.iso isoTmp/

    where the -o specifies that our device is a loop device, after that comes the patch for the .iso file, and finally the directory where we mount this ISO image. After executing this command the image will be mouted, and you can browse it on the local filesystem.
    You can unmount it by executing:

    sudo umount tmpMnt/


    For more information about filesystems, and other specific options type:

    man mount

    in terminal.
    Happy hacking! 🙂

    Traffic Limit on Linux

    On the Unix-like operating systems the user can choose from many advanced tools to control the network. My opinion is that these tools are too advanced (for an everyday user – no programmers, admins, hackers 🙂 ) – so after some searching I’ve found a little script what can be easily modified and executed to limit the network speed.
    Grab this script from http://lartc.org/wondershaper/. Extract it, then with your favorite text editor open the script called wshaper. Intuitively, these lines:


    are indicating the upload, download speed (in kilobits!), and the network interface. After modifying these parameters you need to comment out the following two lines:

    echo Please read the documentation in ‘README’ first :-\)

    by adding the # sign to the beginning of these lines. Save your script. Open the console window and navigate to the directory which contains the script wshaper, get root powers with


    and execute the script:

    sh wshaper


    A little speedup.
    Use command line for every action. Command line is x10 faster then any GUI application. It’s easy to learn and use. Use the edit command for editing the wshaper script (assuming the you can navigate in console with cd command):

    edit wshaper

    . When the editor loads the script with arrow-keys navigate to the lines what you want to modify. Press A – now you can write into the text – and modify the values. To save, press the : key (SHIFT + ;) and type:

    save wshaper

    . Use the same commands to execute the script:

    sh wshaper