Tip: Anatomy of "SELinux" or Security-Enhanced Linux

Linux ® has been described as one of the most secure operating systems available, but the National Security Agency (NSA) took Linux to the next level with the introduction of Security-Enhanced Linux (SELinux). SELinux takes the GNU / Linux operating system and extends it with a kernel and user space, changes to make bullet-proof. If you use a 2.6 kernel today, you might be surprised to know that you are using SELinux now! This article explores the ideas behind SELinux and how it is implemented.

The public networks like the Internet are dangerous places. Anyone who has a computer connected to the Internet (even temporarily) understands these dangers. Hackers can exploit the insecurity to access a system, to obtain unauthorized access to information, repurpose or a computer to send spam or participate in attacks on other high-profile systems ( using the SYN flood, as part of a Distributed Denial of Service attacks).

Read more at IBM.com


Read more...

Book Review of "C++ GUI Programming with Qt4"

Qt is a multi application development platform that is widely used for the development of a GUI and non-GUI programs. Among the most visible products that were developed using Qt are KDE, the Opera Web browser, Google Earth, Skype and Photoshop Elements to name a few. Some of the reasons relevant to the use of Qt are --

Library Qt is published under a dual licensing business model means that you can develop open source or source applications closed. If you develop the first case, then you do not have to pay money for the use of the library.

Two: It is truly multi platform - which filter through the fact that you can write code for your application in a platform - say Linux, then copy the code for Windows and recompile the code, without making any changes and that your application is guaranteed to run on Windows.

Three: Mobile phone giant Nokia's recent acquisition of Trolltech certainly has infused fresh energy and magnitude in the future Qt The latest version of Qt namely version 4.3 has many improvements that make the development of GUI applications using this library for a joy for most C + + programmers.

"C + + GUI Programming with Qt4" from Jasmin Blanchette and Mark Summerfield, published in the Prentice Hall Open source software development series is in its second edition. This book is presented as the "official book of Trolltech Qt."

The main objective of this book is to learn to write programs using graphical interface Qt4 and addresses the entry-level and advanced C + + programmer. Thus, he started on a curve, hand holding the reader of the first rudimentary steps in preparing a simple C + + GUI Qt4 program using. And on chapters gradually up steam and providing readers with complex scenarios such as creating plugins, 3D graphics, application script and more. Through the book, I did not feel like I've been studying a framework rather I found the language used to explain things quite lucid, clear and interesting nonetheless.

The book is divided into three parts. A new programmer in Qt find the first part really useful, as it covers the basic concepts and practices necessary for programming in Qt The second and third part of this book comprises 12 chapters and 7 respectively specialized subjects and can be read in any order. For example, if I want to build a GUI program that needs to connect to a database at the back, so I can immediately read chapter 13: "Databases", this book provided I am aware of Part I of this book covers the basics of programming in Qt 4.

The second edition of this book is based on the first edition and contains many changes. On the one hand, a couple of new chapters have been included as "Look and Feel Personalize" and "Application Scripting." The book has been thoroughly revised to include changes incorporated in Qt 4.2 and 4.3 qt The original "Graphics" chapter has been divided into 2D and 3D graphics chapters respectively. The small chapter on Embedded programming has been expanded to include programming in Qtopia, which makes it not smaller.

What I really liked this book is realistic examples which are used to introduce each Qt control or concept. There are many images scattered inside, impart visual appeal to the pound. Moreover, these images will hopefully give the reader an idea on how to design their software.

Through this book, I find that the authors have explained the different scenarios of development programmes in Qt 4 overwhelming exhaustively, without a player. Each program is divided into digestible pieces of code with detailed explanation succeed. It is therefore very easy to understand what each line of code is doing.

The appendices contain a new section namely "Introduction to Qt Jambi." Qt Jambi is publishing Java application Qt development framework. Beyond that, there are of course other sections in the annex to the Qt installation, construction applications Qt and concise an article listing the main nuances of programming in C + + to Java and C # programmers.

One thing I noticed is that the hard book, I received did not have a CD containing the Qt library, and FDI used for the design of your applications. Then again, you can always visit the Trolltech and obtain library Qt 4.3 and applications which is available for free download. Even better, if you develop your Qt applications on Linux, it is very easy to install all necessary libraries based on the Linux distribution you use.

On the whole, this is a great book not only for any newcomer in Qt but also for the programmer made Qt to use as a reference.

Book Specifications
Name : C++ GUI Programming with Qt4 - Second edition
ISBN No : 0-13-235416-0
Authors : Jasmin Blanchette & Mark Summerfield
No of pages : 720
Publisher : Prentice Hall
Price : $ 59.99 (US), $ 65.99 (Canada)
Rating : 9/10


Read more...

High Performance XEN On Ubuntu 8.04

This tutorial provides step-by-step instructions on how to install XEN on a Ubuntu 8.04 Server System amd64 without compromising on the disk I / O and network bandwidth. You can find all software used in the Ubuntu repositories, so no external files or source of compilation are needed.

Xen is an open-source para-virtualization virtual machine monitor (WWW), or "hypervisor", for the x86 processor architecture. Xen can run safely several VMs on a single physical system with near-Native Performance. Xen allows corporate quality functions, including:

- Virtual Machines with performance relatives of equipment.
- Live migration management VMs between physical hosts.
- Up to 32 virtual processors by guest virtual machine, with VCPU hotplug.
- x86/32, x86/32 with EAP, and x86/64 platform support.
- The virtualization technology Intel (VT-x) for unmodified guest operating systems (Microsoft Windows).
- The virtualization technology AMD (aka Pacifica SVM) on strengthening AM2 and F Opterons (2006H2)
- Excellent support equipment (supports almost all Linux device drivers).

1. Partition And Primary OS Installation

I will use Ubuntu Hardy Heron (x86_64) for the two host OS (dom0) and customers operating systems (Domu). Before that, you must have a ready target system partitions as in the following example:

For example, we have 120 gigabytes of disk space and we want to use 2 guest operating systems on:
- Take as the minimum required for host operating system (dom0), say 10-12GB => to create the first partition accordingly.
- We will divide the rest of the free space in 2 partitions, each for 2 guest OS (Domu) => to create the next two partitions accordingly.
Install Ubuntu Hardy Heron (x86_64) Server Edition (http://www.ubuntu.com/products/whatisubuntu/serveredition) on the first score. Then, on this we will install Xen things and use what OS host (dom0). As a best practice, dom0 should not be used for any purpose in production, except for the control guest OS. While select "ssh" in the selection of packages during the OS installation.

After the OS installation the first job is to update/upgrade the OS. Login to the system as root and type following commands:

# apt-get update

# apt-get upgrade


2. Host OS And Xen Installation
To install Xen and all needed dependencies, all we have to do is run the following command:

# apt-get install ubuntu-xen-server

The ubuntu-xen-server package installs the Ubuntu kernel 2.6.24-17-xen and other dependent xen packages.

Also upgrade the vi editor as follows:

# apt-get install vim

We also need to add the loop module to the kernel every time we boot our system, so we edit /etc/modules. If you already have a loop line in there, make it look like this, otherwise add it at the bottom of the file:

# vi /etc/modules

loop max_loop=64
That's all. Now reboot the system. And after the reboot check the OS and xen service as follows:

# uname -a

# xm list


3 Creating Filesystem For Guest OS (domU)
For the creation of domU we will be using "debootstrap". Here we will be using direct physical disk partitions and no filesystem images for better disk I/O for the guest OS. So format the partition for your filesystem choice. If you are interested in the xfs filesystem then you must install the "xfsprogs" package on dom0 like this:

# apt-get install xfsprogs
class
To create a filesystem on the second partition we use the following command:

If you are choosing ext3 then:

# mkfs.ext3 /dev/sda2

If you are choosing xfs then:

# mkfs.xfs /dev/sda2

Post creation of filesystem in target partition mount it to /mnt:

# mount /dev/sda2 /mnt


4. Installing The Guest OS
Install the base OS stuff in /mnt using "debootstrap":

# debootstrap --arch amd64 hardy /mnt http://archive.ubuntu.com/ubuntu

This is going to take sometime depending on your Internet connection speed.

Once done, prepare the chroot environment for /mnt:

# mount --bind /dev /mnt/dev

# mount proc /mnt/proc -t proc

# chroot /mnt /bin/bash

Open another terminal and copy a couple of files from dom0 to /mnt's respective folder:

# cp /etc/resolv.conf /mnt/etc/resolv.conf

# cp /etc/network/interface /mnt/network/interface

# cp /etc/apt/source.list /mnt/etc/apt/sources.list

# cp -R /lib/modules/2.6.24-17-xen/* /mnt/lib/modules/2.6.24-17-xen/

(If the respective folder is not present, then please create it before copying.)

Now again from the domU chroot environment use the following commands:

# apt-get update

# apt-get upgrade

# apt-get install vim ssh

If you are using the xfs filesystem then also install xfsprogs as follows:

# apt-get install xfsprogs

Update /etc/fstab as follows:
If you are using the ext3 filesystem then:

/dev/hda1 / ext3 defaults 1 2
If you are using the xfs filesystem then:

/dev/hda1 / xfs defaults 1 2
This is the minimal setup of the domU environment. Not set the root password as:

# passwd


It's going to prompt you for root's password, so provide some secret for it.

Now exit from the chroot environment:

# exit

Now umount all partitions:

# umount /mnt/dev /mnt/proc /mnt


5. Creation Of Xen Config File
Now create the first guest OS's xen config file named domu1.cfg in the /etc/xen/ folder like this:

vi /etc/xen/domu1.cfg

kernel = '/boot/vmlinuz-2.6.24-17-xen'
ramdisk = '/boot/initrd.img-2.6.24-17-xen'
memory = '512'
#
# Disk device(s).
#
root = '/dev/hda1 ro'
disk = [
'phy:/dev/sda2,hda1,w',
]
#
# Hostname
#
name = 'domu1'
#
# Networking
#
vif = [ 'ip=192.168.1.102,mac=00:16:3E:62:DA:BB' ]
#
# Behaviour
#
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
vcpus = '2'
extra = 'xencons=tty1'

You must use a free and different IP for each guest OS.

Then start the first domU like this:

# xm create /etc/xen/domu1.cfg -c

Log in using root and that's all... your first guest OS (domu1) is ready now.

In dom0, to list running OS's, type:

# xm list

The steps to create /dev/sda3 for the second domU are similar...

The same steps can be followed for i386 also...


Read more...

Oracle - Free Linux DVD set

First, it was Ubuntu and now it is the turn of Oracle. That's right, here is a wonderful chance to get a DVD of Oracle Unbreakable Linux. Essentially Unbreakable Linux is Red Hat Enterprise Linux without the trademarks of Red Hat.

Oracle Unbreakable Linux book claims enterprise-class support for Linux with Prime Minister backports, comprehensive management, the group of software, compensation, testing and more, all at a lower cost significantly.

Figure 1. Enter Your Email


Figure 2. Enter Your Contact Detail


To order your free DVD Oracle Unbreakable Linux with free delivery and all, visit this page and click on "Sign Up". If this is your first visit to the site of Oracle, you must create an account Oracle. Next enter your shipping address, which is the address to which you wish to receive the DVD and click on "Submit". That's it. Oracle will ship a new DVD Unbreakable Linux.



Read more...

Screen for Power Session

Screen is a full-screen window manager of the console, which comes with every flavor of UNIX and Linux. He is best known for multiplexing a physical terminal between several processes. By using it, you can run any number of console-based applications within a single hotel.
For example, suppose I want to launch the 'top' to keep track of the system load, change my programming code and check my mail at the same time ... Usually, I must open at least 3 terminals to do that. But using the screen utility, I can run all these programs at the same time and physical terminal. Another feature of this wonderful utility is its ability to separate the terminal emulator program running, which ensures your work is in progress, even if you inadvertently close your window, or where you disconnect. After detaching, you can once again over the same session and resume control of the management jobs.
Here how to use this utility.

1) First open a terminal and type :
$ screen
2) Screen starts and creates a new single window with a shell, pretty much like what you had before. The path name of the shell is taken from the $SHELL variable. New windows can be created within the same physical terminal using the screen commands.
3) Now that you have started screen in a terminal, suppose you want to run the 'top' program to check the System load and at the same time you want to compile a program too - Also you would like to switch between the two to see the progress made by both.
For that, first execute the first program to be run (say 'top'). now 'top' will start in the terminal.
Now open a new window in screen by pressing the '[Ctrl + a] c' - which I will state as 'C-a c' . This will create a new window in the same terminal. Here, you can give commands to compile your program.
In screen, each window is given a unique identifier. The first window is numbered 0, the next window is 1 and so on. Now to switch between your 'top' and the compiling program, you can use the key 'C-a 0' and 'C-a 1' respectively.
You can also associate names with each running window - use 'C-a A' to give a name to the current window.
Here are a few other commands that might come in handy while toggling between various running windows :
  • 'C-a p' and 'C-a n' can be used to switch to the next or previous window respectively.
  • 'C-a N' - where N is the number from 0 to 9, that can be used to jump to the corresponding window.
  • 'C-a w' displays a list of all windows. The unique ID of each window with its name and running process is displayed, for each window. The current window is marked with an asterisk(*).
  • 'C-a k' - can be used to kill the current window. You can also type 'exit' to kill the current window. If no more windows are open, then screen exits. 'C-a \' also does the same thing.
  • 'C-a d' - detaches the present screen session. You can also detach by closing the terminal running your screen utility. Though, this appears to close your terminal session, in reality this does not happen. It only unbinds your session from the current terminal. All the programs started under screen will still keep running.
You can also log out from the machine and re-login. Then start any terminal session and type 'screen -r' to once again be connected from where you left.
In case, there were more than one screen sessions running on the machine, Screen prompts for a host.tty.pid.
For example, say I have two screen sessions. So when I type 'screen -r' command, it gives the following message:
$ screen -r
There are several suitable screens on:
2999.pts-6.localhost (Detached)
1920.PTS-6.localhost (Detached)
Type
"screen [-d] -r [pid].tty.host" to resume one of them.
Choose the right tty.host to connect and you control your program. You can also share your screen session with others as the use of VNC. Imagine that you are having a problem with your code and you want to share with your boss which is located in another office. You can use the screen to share your session with your boss, and he can see what you are referring. The first user launches the screen in normal mode and executes the following ...
User1:
[Ctrl-A]:multiuser on [RET]
[Ctrl-A]:acladd
The second user starts a new screen session and connects it to the first session using ...
User2:
screen -x
Screen website at Official Screen Home Page


Read more...