Linux.com

Community Blogs



HTML5 Speed Test: Firefox 3.7 Faster Than Internet Explorer 9

[video:http://www.youtube.com/watch?v=OIZUdZdFzOo&feature=player_embedded 480x300]

The boys from Download Squad made a test between Firefox 3.7, Internet Explorer 9, Chrome and Opera to see who's the faster browser for Windows. The results are:

Chrome is the slowest (even with hardware acceleration turned on via command line switches), Opera competes very well up to a point, but at the end just Firefox and Internet Explorer are the winners with 1000 fish swimming around.

Both Firefox and IE9 use Direct2D to utilize the GPU's rendering power -- so it's probably no surprise that they both show very similar results. It's most apparent when comparing CPU use; IE9 and FF3.7 are both miles ahead in performance, but both show the lowest CPU utilization!

This is just an experiment from the Download squad, but this can give us the idea on what to wait on the near future with the release of FF, IE, Chrome and Opera and of course the main attraction HTML5.

Source: Download Squad

 

HOWTO: Quick 'n' dirty networking commands

After my quick blog around command line networking and ethernet setup, I've decided to report here few useful command I use most. When you setup your own ethernet card on the fly you even need to use them quite often.

As usual these commands are easy and heavily used when you deal with command line setup, this is just a reminder for me and you, some sort of place where I can put "my most used commands", please feel free to add your own to the post as well

Here's something related to basic hostname handling (really really easy):

# Hostname lookup through DNS query
host www.linux.com

# lookup current host name and/or ip address
hostname

# WHOIS query for a domain
whois linux.com

Here's something related to netstat and ip tools (a little more interesting)

# Get a list of internet service on your current system
netstat -tup
netstat -tupl

# now some stats from your ethernet device (ethtool package needed)
boba:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pg
Wake-on: g
Current message level: 0x00000037 (55)
Link detected: yes

# Now let's change ethernet interface speed manually (sounds nice...)
ethtool --change eth0 autoneg off speed 100 duplex full

# Now some fun with IP command utility
#-----------------------------------------------------------------------

# networking stats with IP (ip addr show)
boba:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:46:ce:0e:59 brd ff:ff:ff:ff:ff:ff
boba:~# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:46:ce:0e:59 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.8/24 brd 10.0.0.255 scope global eth0

# Set network interface up (or down)
ip link set dev eth0 up

# Rename network interface (from eth0 to wifi0 or the name you want)
ip link set dev eth0 name wifi0

# some basic ip settings, already seen something on previous blog
# add ip and mask (255.255.255.0)
ip addr add 1.2.3.4/24 brd + dev eth0
# list routing table
ip route show
# add default gateway
ip route add default via 1.2.3.1

Let's add delay or latencies to devices (tricky), in this case 10ms latency to eth0

boba:~# tc qdisc add dev eth0 root handle 1:0 netem delay 10msec

# Ok, let's remove it
tc qdisc del eth0 root


And finally something related to wireless cards

# Scan wireless networks in range
iwlist scan

# Status advanced status of first wireless ethernet card
iwconfig eth1

# Manually set wireless card speed
iwconfig eth1 rate 2Mb/s fixed

I'll add my own commands to the article when something comes in my mind, you're free to add your own here if you want. See also my previous Howto: Setup ethernet from command line

Glad to see your comments

 

Andrea (Ben) Benini

 

RAID Disk Configuration, now LVM (lvm.conf)

Here's the second step of my raid MD tools config, in my previous article I've mentioned my mdadm.conf file and how I've defined my raid disk array with mdtools. As you've already seen : /dev/mapper/storage-storage, this volume is an LVM partition as you can see from:

/etc/lvm# lvm lvscan
ACTIVE '/dev/storage/storage' [xxx.xx GB] inherit

and its created under /dev/sdX4 for each disk

Here's my lvm.conf file, I've taken it from a Debian Lenny but it works fine with gentoo or other distros as well, take a look:

# This section allows you to configure which block devices should
# be used by the LVM system.
devices {

# Where do you want your volume groups to appear ?
dir = "/dev"

# An array of directories that contain the device nodes you wish
# to use with LVM2.
scan = [ "/dev" ]

# If several entries in the scanned directories correspond to the
# same block device and the tools need to display a name for device,
# all the pathnames are matched against each item in the following
# list of regular expressions in turn and the first match is used.
preferred_names = [ ]

# Try to avoid using undescriptive /dev/dm-N names, if present.
# preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ]

# A filter that tells LVM2 to only use a restricted set of devices.
# The filter consists of an array of regular expressions. These
# expressions can be delimited by a character of your choice, and
# prefixed with either an 'a' (for accept) or 'r' (for reject).
# The first expression found to match a device name determines if
# the device will be accepted or rejected (ignored). Devices that
# don't match any patterns are accepted.

# Be careful if there there are symbolic links or multiple filesystem # entries for the same device as each name is checked separately against
# the list of patterns. The effect is that if any name matches any 'a'
# pattern, the device is accepted; otherwise if any name matches any 'r'
# pattern it is rejected; otherwise it is accepted.

# Don't have more than one filter line active at once: only one gets used.

# Run vgscan after you change this parameter to ensure that
# the cache file gets regenerated (see below).
# If it doesn't do what you expect, check the output of 'vgscan -vvvv'.


# By default we accept every block device:
filter = [ "a/.*/" ]

# Exclude the cdrom drive
# filter = [ "r|/dev/cdrom|" ]
# When testing I like to work with just loopback devices:
# filter = [ "a/loop/", "r/.*/" ]

# Or maybe all loops and ide drives except hdc:
# filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ]

# Use anchors if you want to be really specific
# filter = [ "a|^/dev/hda8$|", "r/.*/" ]

# The results of the filtering are cached on disk to avoid
# rescanning dud devices (which can take a very long time).
# By default this cache is stored in the /etc/lvm/cache directory
# in a file called '.cache'.
# It is safe to delete the contents: the tools regenerate it.
# (The old setting 'cache' is still respected if neither of
# these new ones is present.)
cache_dir = "/etc/lvm/cache"
cache_file_prefix = ""

# You can turn off writing this cache file by setting this to 0.
write_cache_state = 1

# Advanced settings.
# List of pairs of additional acceptable block device types found # in /proc/devices with maximum (non-zero) number of partitions.
# types = [ "fd", 16 ]

# If sysfs is mounted (2.6 kernels) restrict device scanning to # the block devices it believes are valid.
# 1 enables; 0 disables.
sysfs_scan = 1
# By default, LVM2 will ignore devices used as components of
# software RAID (md) devices by looking for md superblocks.
# 1 enables; 0 disables.
md_component_detection = 1

# If, while scanning the system for PVs, LVM2 encounters a device-mapper
# device that has its I/O suspended, it waits for it to become accessible.
# Set this to 1 to skip such devices. This should only be needed
# in recovery situations.
ignore_suspended_devices = 0
}
# This section that allows you to configure the nature of the
# information that LVM2 reports.
log {

# Controls the messages sent to stdout or stderr.
# There are three levels of verbosity, 3 being the most verbose.
verbose = 0

# Should we send log messages through syslog?
# 1 is yes; 0 is no.
syslog = 1

# Should we log error and debug messages to a file?
# By default there is no log file.
#file = "/var/log/lvm2.log"

# Should we overwrite the log file each time the program is run?
# By default we append.
overwrite = 0
# What level of log messages should we send to the log file and/or syslog?
# There are 6 syslog-like log levels currently in use - 2 to 7 inclusive.
# 7 is the most verbose (LOG_DEBUG).
level = 0
# Format of output messages
# Whether or not (1 or 0) to indent messages according to their severity
indent = 1

# Whether or not (1 or 0) to display the command name on each line output
command_names = 0

# A prefix to use before the message text (but after the command name,
# if selected). Default is two spaces, so you can see/grep the severity
# of each message.
prefix = " "

# To make the messages look similar to the original LVM tools use:
# indent = 0
# command_names = 1
# prefix = " -- "
# Set this if you want log messages during activation.
# Don't use this in low memory situations (can deadlock).
# activation = 0
}

# Configuration of metadata backups and archiving. In LVM2 when we
# talk about a 'backup' we mean making a copy of the metadata for the
# *current* system. The 'archive' contains old metadata configurations.
# Backups are stored in a human readeable text format.
backup {

# Should we maintain a backup of the current metadata configuration ?
# Use 1 for Yes; 0 for No.
# Think very hard before turning this off!
backup = 1

# Where shall we keep it ?
# Remember to back up this directory regularly!
backup_dir = "/etc/lvm/backup"

# Should we maintain an archive of old metadata configurations.
# Use 1 for Yes; 0 for No.
# On by default. Think very hard before turning this off.
archive = 1

# Where should archived files go ?
# Remember to back up this directory regularly!
archive_dir = "/etc/lvm/archive"
# What is the minimum number of archive files you wish to keep ?
retain_min = 10

# What is the minimum time you wish to keep an archive file for ?
retain_days = 30
}

# Settings for the running LVM2 in shell (readline) mode.
shell {

# Number of lines of history to store in ~/.lvm_history
history_size = 100
}
# Miscellaneous global LVM2 settings
global {
# The file creation mask for any files and directories created.
# Interpreted as octal if the first digit is zero.
umask = 077

# Allow other users to read the files
#umask = 022

# Enabling test mode means that no changes to the on disk metadata
# will be made. Equivalent to having the -t option on every
# command. Defaults to off.
test = 0

# Default value for --units argument
units = "h"
# Whether or not to communicate with the kernel device-mapper.
# Set to 0 if you want to use the tools to manipulate LVM metadata # without activating any logical volumes.
# If the device-mapper kernel driver is not present in your kernel
# setting this to 0 should suppress the error messages.
activation = 1

# If we can't communicate with device-mapper, should we try running # the LVM1 tools?
# This option only applies to 2.4 kernels and is provided to help you
# switch between device-mapper kernels and LVM1 kernels.
# The LVM1 tools need to be installed with .lvm1 suffices
# e.g. vgscan.lvm1 and they will stop working after you start using
# the new lvm2 on-disk metadata format.
# The default value is set when the tools are built.
# fallback_to_lvm1 = 0

# The default metadata format that commands should use - "lvm1" or "lvm2".
# The command line override is -M1 or -M2.
# Defaults to "lvm1" if compiled in, else "lvm2".
# format = "lvm1"
# Location of proc filesystem
proc = "/proc"

# Type of locking to use. Defaults to local file-based locking (1).
# Turn locking off by setting to 0 (dangerous: risks metadata corruption
# if LVM2 commands get run concurrently).
# Type 2 uses the external shared library locking_library.
# Type 3 uses built-in clustered locking.
locking_type = 1

# If using external locking (type 2) and initialisation fails,
# with this set to 1 an attempt will be made to use the built-in
# clustered locking.
# If you are using a customised locking_library you should set this to 0.
fallback_to_clustered_locking = 1

# If an attempt to initialise type 2 or type 3 locking failed, perhaps
# because cluster components such as clvmd are not running, with this set
# to 1 an attempt will be made to use local file-based locking (type 1).
# If this succeeds, only commands against local volume groups will proceed.
# Volume Groups marked as clustered will be ignored.
fallback_to_local_locking = 1
# Local non-LV directory that holds file-based locks while commands are
# in progress. A directory like /tmp that may get wiped on reboot is OK.
locking_dir = "/var/lock/lvm"

# Other entries can go here to allow you to load shared libraries
# e.g. if support for LVM1 metadata was compiled as a shared library use
# format_libraries = "liblvm2format1.so" # Full pathnames can be given.

# Search this directory first for shared libraries.
# library_dir = "/lib/lvm2"

# The external locking library to load if locking_type is set to 2.
# locking_library = "liblvm2clusterlock.so"
}
activation {
# Device used in place of missing stripes if activating incomplete volume.
# For now, you need to set this up yourself first (e.g. with 'dmsetup')
# For example, you could make it return I/O errors using the 'error' # target or make it return zeros.
missing_stripe_filler = "/dev/ioerror"

# How much stack (in KB) to reserve for use while devices suspended
reserved_stack = 256

# How much memory (in KB) to reserve for use while devices suspended
reserved_memory = 8192

# Nice value used while devices suspended
process_priority = -18
# Size (in KB) of each copy operation when mirroring
mirror_region_size = 512

# Setting to use when there is no readahead value stored in the metadata.
#
# "none" - Disable readahead.
# "auto" - Use default value chosen by kernel.
readahead = "auto"

# 'mirror_image_fault_policy' and 'mirror_log_fault_policy' define
# how a device failure affecting a mirror is handled.
# A mirror is composed of mirror images (copies) and a log.
# A disk log ensures that a mirror does not need to be re-synced
# (all copies made the same) every time a machine reboots or crashes.
#
# In the event of a failure, the specified policy will be used to
# determine what happens:
#
# "remove" - Simply remove the faulty device and run without it. If
# the log device fails, the mirror would convert to using
# an in-memory log. This means the mirror will not
# remember its sync status across crashes/reboots and
# the entire mirror will be re-synced. If a
# mirror image fails, the mirror will convert to a
# non-mirrored device if there is only one remaining good
# copy.
#
# "allocate" - Remove the faulty device and try to allocate space on
# a new device to be a replacement for the failed device.
# Using this policy for the log is fast and maintains the
# ability to remember sync state through crashes/reboots.
# Using this policy for a mirror device is slow, as it
# requires the mirror to resynchronize the devices, but it
# will preserve the mirror characteristic of the device.
# This policy acts like "remove" if no suitable device and
# space can be allocated for the replacement.
# Currently this is not implemented properly and behaves
# similarly to:
#
# "allocate_anywhere" - Operates like "allocate", but it does not
# require that the new space being allocated be on a
# device is not part of the mirror. For a log device
# failure, this could mean that the log is allocated on
# the same device as a mirror device. For a mirror
# device, this could mean that the mirror device is
# allocated on the same device as another mirror device.
# This policy would not be wise for mirror devices
# because it would break the redundant nature of the
# mirror. This policy acts like "remove" if no suitable
# device and space can be allocated for the replacement.

mirror_log_fault_policy = "allocate"
mirror_device_fault_policy = "remove"
}
####################
# Advanced section #
####################

# Metadata settings
#
# metadata {
# Default number of copies of metadata to hold on each PV. 0, 1 or 2.
# You might want to override it from the command line with 0 # when running pvcreate on new PVs which are to be added to large VGs.

# pvmetadatacopies = 1

# Approximate default size of on-disk metadata areas in sectors.
# You should increase this if you have large volume groups or
# you want to retain a large on-disk history of your metadata changes.

# pvmetadatasize = 255
# List of directories holding live copies of text format metadata.
# These directories must not be on logical volumes!
# It's possible to use LVM2 with a couple of directories here,
# preferably on different (non-LV) filesystems, and with no other # on-disk metadata (pvmetadatacopies = 0). Or this can be in
# addition to on-disk metadata areas.
# The feature was originally added to simplify testing and is not
# supported under low memory situations - the machine could lock up.
#
# Never edit any files in these directories by hand unless you
# you are absolutely sure you know what you are doing! Use
# the supplied toolset to make changes (e.g. vgcfgrestore).

# dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
#}

# Event daemon
#
# dmeventd {
# mirror_library is the library used when monitoring a mirror device.
#
# "libdevmapper-event-lvm2mirror.so" attempts to recover from
# failures. It removes failed devices from a volume group and
# reconfigures a mirror as necessary. If no mirror library is
# provided, mirrors are not monitored through dmeventd.

# mirror_library = "libdevmapper-event-lvm2mirror.so"

# snapshot_library is the library used when monitoring a snapshot device.
#
# "libdevmapper-event-lvm2snapshot.so" monitors the filling of
# snapshots and emits a warning through syslog, when the use of
# snapshot exceedes 80%. The warning is repeated when 85%, 90% and
# 95% of the snapshot are filled.

# snapshot_library = "libdevmapper-event-lvm2snapshot.so"
#}

Ben

 

 

HOWTO: Setup an ethernet card from command line

Back again with very few commands regarding ethernet configuration.
When you deal with ethernet cards and you don't want to mess around with GUI stuff or utils you need to insert few basic commands to have your working network configuration.

When I'm in a totally new environment and I need to setup an ethernet card on the fly I've a script with few commands for it, I usually don't setup a new profile for the card, expecially if I don't need it or if it's just a test for casual usage. Again, when dealing with Live CD distros designed for special security tasks (my fav is BackTrack :-) ) I type these commands for getting everything done from the command line.
Let's see something:

Setting up the hostname and DNS stuff

# Setup hostname
hostname mycomputerhostname

# Here's a DNS setting
echo "nameserver 1.2.3.4" > /etc/resolv.conf
# adding 1.2.3.4 as nameserver

When dealing with a live CD distro you don't care about /etc/resolv.conf file but if you're running from your own HD you maybe need to take a backup copy of the file before overriding it (something like cp resolv.conf resolv.backup.conf)

Now let's flush the eth card and setup the new ip address (let's assume we've a /dev/eth0 card to setup)

# Flush every network address for the device /dev/eth0
ip addr flush dev eth0

# Add a new IP address to /dev/eth0 (use the form you want, that's just mine)
ip addr add 192.168.0.2/24 dev eth0
# adding 192.168.0.2, subnet mask (255.255.255.0) to my eth card

# Let's bring it up and running
ip link set eth0 up

# Now add a default route, 192.168.0.1 in the example
ip route add default via 192.168.0.1

And that's it !
Here're some basic settings for it, you can compose this material in a script like I did; again, no rocket science here but a very quick howto for command line fans

Next Step: Quick 'n' dirty networking commands

Hope it helps newbies and friends
Glad to read your comments

 

Andrea (Ben) Benini

 

Command Line Instant Messager With CenterIM

Well, I love the command line, I use Lynx to browse the web sometimes and I try to do all with the Command Line, and searching I found an Instant Messenger for the command line named CenterIM.

 

CenterIM

You can use this very cool IM to enable your Yahoo, Msn Messenger, ICQ, Jabber, etc account into one "Old School" menssenger. CenterIM has very useful tools to configure the messenger and the accounts. If you loe the CLI just like me, download it from here. Download the latest version (the previous has a problem with the msn login) Enjoy!!

Source: Voices in my Head

 

Creating OpenDocument slideshows with two simple scripts

A big issue with slideshows is that GUI presentation software, be it PowerPoint, OpenOffice Impress, KPresenter or anything else, can be quite time-consuming and distracting, no matter how you use it.

Writing bullets and sub bullets as simple text outlines is much faster, even when you're just pasting together notes you scrabbled on your PDA, email fragments, quotes from Web pages or thoughts of the moment. If you need to produce slideshows and think that the cleaner they are the better, but don't like the time it takes to put them together in a GUI, here's a solution: two scripts that take an empty OpenDocument template and insert into it the content of a plain text outline.

 

Converting my Acer Laptop from Windows XP to a Linux OS

I need help converting my Laptop into a Linux OS. I want to only use Linux now, I do NOT wish to use Microsoft anymore, so if someone can show me exacly how to convert my laptop, it would be a great help to me. I do not understand any site instructions I look up to do this, and everything is being very difficult to do, and no files I downloaded work that say use this to install linux. I go to sites, and follow the steps, and it leads me into NOTHING, a ERROR message or something that I can't do nothing about, which I don't understand, because I am the owner of my laptop, and no one else has access to it, unless someone from where I'm getting my internet from is abusing their power, knowing they won't get caught, do to rules, and regulations that are put forth in reality. Anyway, whoever can help me change from this stupid Microsoft to the GENIUS Linux, I'll buy you dinner...

 

Ubuntu With a K

Click here to read the original article on TechHaze - I'm starting to be very pissed off. “By what?” you might ask. Well, the answer has to do with cooperation.

When people do things separately, their strengths become apparent. Unfortunately, their weaknesses too. Linux is a great platform because it gives choice to its users. Two of the most debated choices in the Linux ecosystem are the choice of distribution / Operating System (OS) and the choice of Desktop Environment (DE). This diversity permits an incredible array of possible combinations, choices multiplied by choices, until each and every user can find what he or she needs. These choices also give us the possibility to compare, too see what we like and don't like, and to dig out the strengths and weaknesses of each of our choices.

The Limits of Ubuntu

Ubuntu has a great experience overall. It can satisfy most home users and in that it has reached its goal perfectly. Ubuntu is easy to use, in many respects easier to use than both Mac OS X and Windows 7, and I recommend it to many people I know.

After I did my review of Ubuntu Lucid, Florian Wardell told me he was tempted to install Ubuntu and give it a try. I spend a lot of my time criticizing his choice operating system (Mac OS X) and boasting the merits of Ubuntu, so it would have seemed natural if I had told him to go for it. This is not what i did however.

Instead of a continued praise of Ubuntu I hinted on what I percieve as one of it's chief weaknesses: GNOME. It's a pity Ubuntu still uses GNOME because it still feels and works like the last generation of Desktop environments, something that even a non-techie can feel if he has used one of the latest DE's extensively.

I do not question the creation of the GNOME Desktop Environment. GNOME is clean, simple and easy. At the time of it's creation, it was imperative for Linux to have a 100% free (as in freedom) desktop, something that the KDE project did not deliver (because of the Qt license at the time). As the two DE's evolved, GNOME took the smarter turns. It may have been simple, ugly, non-configurable and bland, but at least it wasn't confusing to use and remained simple. When KDE felt like a collection of features, GNOME felt like a solid desktop.

I do not question the original Choice of GNOME over KDE or any other DE or Window Manager either. I started using Linux several years ago with Ubuntu but I tried Kubuntu, the KDE version of Ubuntu, very early on. I liked several things about KDE, and my first thought was that it was a pity to have Kubuntu as a side-project, that it deserved as much attention as Ubuntu, and that it would have ben a better idea to have two Ubuntu derivatives, Gubuntu and Kubuntu. Very quickly, I changed my mind. Mainly, that was because my Kubuntu system was always far from stable, but I also felt the usability problems in KDE. The fact that it wasn't adapted for use by novice computer users and it's too high resemblance to Windows were my major concerns. GNOME was clearly the right choice at the time.

My opinion, however, is that this choice of GNOME over KDE is outdated. It doesn't consider the past and future evolutions of both desktop. I believe that GNOME doesn't serve the goals of Ubuntu.

But why Ubuntu?

At this point you might be asking why I even bother with Ubuntu. True, if I don't like its choice of desktop, I could easily switch to, say, OpenSuse. After all, that's precisely what Linux is about.

That said, Linux is evolving. Our beloved kernel is leaving the realm of geek exclusivity and going mainstream. In other words, it is now directly competing against the two major proprietary systems: Apple Mac OS and Microsoft Windows. In the forefront of this battle is Canonical's Ubuntu. Ubuntu has become popular for several reasons.

However, it is not because of its popularity that I'll use it as the sole opposition to Mac and Windows. Ubuntu is probably the only Linux distribution that fights against the two OS's on a level playing field. Ubuntu has the same goals as Windows and Mac OS, Ubuntu aims the same audience.

When new users come to Linux, they don't judge Linux, they judge the computer as a whole. I've had people telling me that “Linux is s**t” because they had tried the default Xandros installation on their EeePC (which sucks, for that matter), or because they had tested Strangebuntu/Tomboctubuntu, a variant of a variant of a variant of Ubuntu. Fortunately, most users will come to Ubuntu as their first Linux OS, and they will judge Linux by the (generally pleasant) Ubuntu experience. It is therefore extremely important for Linux as a hole that Ubuntu fares well.

Ubuntu is rather unique in the world of Linux. Despite all the criticism that it has received, it has managed to capture users. At every release, it improves, not only because Linux in general is improving, but because it rethinks the desktop in new and interesting ways. Ubuntu is also doing what only proprietary systems did in the past and is integrating services like Ubuntu One--an integrated cloud-based solution--and the Ubuntu One Music store.

If it were just that Ubuntu was at the forefront of Linux, I might jut give it some peace and let it grow. Ubuntu is much more than that, and Linux has a stake in it.

KDE over GNOME

KDE and GNOME are now very different projects, some may even say that they have changed roles. GNOME is a huge project, dominated in some part by its corporate support. Most of the major distributions – which are almost all supported by a company – use GNOME. It is not surprising that each has a stake in the GNOME evolution. As a consequence, GNOME can't be radical, GNOME can't take risks. In short, while GNOME is undergoing a steady evolution, it can't revolutionize anything which could put it's stability or usability at risk.

KDE, on the other hand, can boast being a free desktop. Qt (The cross-platform toolkit it is based on) is now licensed through the GNU LGPL, a free (as in freedom) and open-source license, which makes it the free option of the two. However, that's not what's important; the important part is its evolution. The latest version of KDE was built practically from scratch y the developpers, with no constraints nor pressure from third parties. This meant that KDE could really rethink the desktop. This also meant that KDE 4.0 outraged people, mostly because of its complete lack of stability, but also because it was not what people expected. The KDE developers decided to explore a new path in interface design, for the better or for the worst. The result is what we have today, KDE SC 4.4.

KDE4 is beautiful, powerful, integrated, simple and different.

  • KDE's Oxygen theme is one of the most beautiful themes out there, easily competing with Microsoft Windows' Aero or Apple Mac OS X's Aqua. I'll give the reader the freedom to decide which one is the most beautiful, but the facts are that most people are positively surprised when they experience Oxygen for the first time. Oxygen just feels right. It's clean, simple, and lightweight.
  • KDE's interface is in many sense what I would call "powerful". Qt permits a very clean but modulable panel system applicable to very different tasks and applications, as diverse as the kOffice suite and the Dolphin file browser. This makes Qt applications – both those installed in the default DE Software Compilation those not directly linked to KDE – more efficient than their GTK+ equivalents. In fact, I prefer most major KDE applications to their competitors on all OS's, and I often consider them be the best in their field. Sometimes, though, Some GNOME applications are better than the KDE equivalent. In these cases, I would argue that each and every one of these applications could easily have been written in Qt. The applications belong to GNOME because it is more popular or because it is the developper's choice desktop, not because GTK+ permits the developer to do anything that Qt wouldn't. When a GTK+ application is better, it could have been written in Qt. The opposite is not true.
  • KDE is an example of cross-integration; applications work together, use powerful common libraries, blend in the Plasma desktop seamlessly. KDE is the only open-source desktop that feels truly complete in the same way as Mac OS or Windows feel. There is no different theme of design from one app to the next. When you use a KDE4 application, you know you are using KDE4, and you're happy. I switched to KDE in great part thanks to this feel. I would never have done the same for GNOME, even when I was on Windows XP.
  • KDE is also simple. Since KDE4, the developing team has worked a lot on useability, and that shows. When Ubuntu was created, the choice between GNOME and KDE was the choice between simple applications and confusing ones. Today, KDE applications are generally only slightly more complex, even when they are more empowering. Again, the malleable panel system is great, but clean looks also play a great part in the experience. KDE also decided to hide most buttons by default and tweaked the experience of most apps. KDE is simple and clean, but that without compromising power, efficiency and configurability.
  • That doesn't mean KDE became a Mac OS- or Windows- like environment. KDE is definitively different. It has some details that resemble Windows here and there, but the experience it provides is as unique as any system's. This difference, however, has never been designed simply "to be different". Plasma is different because it is innovative. It created a new way to wey and interact with the desktop. It is different as Linux should be.

KDE is the positive side of Linux. The empowerment of the user. Without the fault it has suffered for so long: the lack of consistency. KDE is what Linux deserves.

The Best of Both Worlds

Ubuntu's mission from the start was to bring a simple Linux distribution to the masses while still remaining different. It has acheived this goal, mainly because GNOME uses a unique interface that is as different to Mac OS and Windows as they are to each other. The same, however, could be said about KDE. Even though it mimics the very basic parts of windows (the "K menu" is close to the "Start menu") it works in a unique way. In fact, the basic outlines of the desktop's layout that can be traced back to Windows can be changed.

There are also parts of GNOME that I love, kubuntu

Ubuntu still lacks a powerful desktop. KDE still lacks simple applications like the Ubuntu Software Center and commercial solutions like the Ubuntu One Music Store. Ubuntu could bring to KDE what it lacks, and vice-versa.

Kubuntu is not enough because it does not bring the Ubuntu experience to KDE. Instead, it simply pastes the KDE Plasma desktop un the Ubuntu OS. Kubuntu does not profit from Ubuntu's efforts on interface design, integration, and extra tools. If we ever want to see that, it is necessary that KDE becomes the default Ubuntu desktop or Kubuntu becomes Canonical's primary OS.

The best short-term solution would be if Canonical would spread its efforts between GNOME and KDE for a few years. Then they could keeps the one that gives them the best result. I am ready to bet much more than what I have that it would be KDE.

Near the end of 2009, I wrote an article telling people to use GNOME, but pray for KDE. KDE has made a lot of progress since then. That article is outdated. It is time that we forget GNOME, and use KDE.

 

Sometimes I have the impression that Linux is now all about Ubuntu versus KDE and no more about Ubuntu vs. other distros or KDE versus GNOME. It does not have to be that way as there's no logical reason why these two projects should be opposed. If the Ubuntu community was to concentrate its efforts on KDE instead of GNOME, we might finally get what we've been waiting for all along: a really good Linux OS that competes with–and beats–proprietary systems in all respects.

I believe KDE needs Ubuntu, and Ubuntu needs KDE. What do you think?

Contact the author via This e-mail address is being protected from spambots. You need JavaScript enabled to view it , or comment on the original post

 

Easily suspending programs

Have you ever been faced in a situation where your computer gets totally frozen, and you can barely move you mouse cursor, and wished that there is a pause button, like the control + alt + Escape from KDE that kills the selected applications window.

Now you can! - with my little BASH script.

(If the paste expires, please notify me, and I post a fresh one ;) )

What the script does:
when the script is connected with a keyboard shortcut, when one pressed the combo:
control + alt + ~ or the chosen combination, the mouse cursor will change to a cross, which we can now click on any window, than the program will suspend using the STOP signal.

Another shortcut is used to wake the application, it's the same procedure, point and click the suspended applications window :D.

This is an exported settings file for the shortcuts in KDE4, just change $HOME to your path to the script, and than import it using KDE4 System Settings in the category Input Actions.

It works on programs made in>
Python, C, C++, mono-C#,  perl and other languages, except for Java, which has one central virtual machine that loads Java classes.


Usage of my scrpt, for instance, one needs to search something, but the system is overloaded due to the programming IDE (like Eclipse), so it points to the Eclipse window, the scripts the PID from the xwindow-id and suspends the application with kill -STOP ourPid.

Looking forward to make my GNU/Linux box faster and more usable :), despite my machines power  :D.

P.S: if someone knows any better script/program or have made one, please give me a link, please :).

 

 

Few functions to draw lines, circles and ellipses in Java.

These days I'm working on few games which I'm writing in Java. I needed functions to draw lines and circles etc. Instead of using the Java libraries, I wrote my own functions. Thinking may be some day, some body else  use them too I'm putting the source code to these functions here, in my blog.

////////////////////////////////////////////////////////////////////////////
// NibblesFunctions.java                                                            //
// Written by, Sohail Qayum Malik                                              //
// Last modified on, Monday, 7th of March, 2010 @7:12AM           //
////////////////////////////////////////////////////////////////////////////

package Nibbles;

import java.lang.Math;
import java.awt.Graphics;

public class NibblesFunctions {

   //Bresenham circle
   //Read the following book at page 29...
   //http://books.google.com.pk/books?id=7gT1MhI1SbIC&pg=PP3&dq=+"Computer+Graphics++"SCHAUM's+outline+series"&cd=1#v=onepage&q= "Computer Graphics  "SCHAUM's outline series"&f=false
   // a and b is an origin ordinate pair(a,b)
   // r is the radius                                   
   public static void drawCircle(Graphics graphics, int a, int b, int r) {
 
      //We'll start at the right hand side of the circle
      //First point is always on the circle so error is zero and we know that x is r and y is 0
      //There are only two valid moves...
      //Up = x^2 + (y + 1)^2 - r^2 and Left = (x - 1)^2 + (y + 1)^2 - r^2
      //Our d = Up + Left     
      int x = r, y = 0, d = 3 - 2*r;
 
      // x is initially r, x will be same as y at 45(degree) angle
      while(y <= x) {
         
         // Eight way symmetry of circle
         graphics.drawString(".", x + b, y + a);
         graphics.drawString(".", y + b, x + a); 
         graphics.drawString(".", (-1)*y + b, x + a);
         graphics.drawString(".", (-1)*x + b, y + a);
         graphics.drawString(".", (-1)*x + b, (-1)*y + a);
         graphics.drawString(".", (-1)*y + b, (-1)*x + a);
         graphics.drawString(".", y + b, (-1)*x + a);
         graphics.drawString(".", x + b, (-1)*y + a);
       
         if(d < 0) // move Up = d + Up + 2  
            d = d + 4*y + 6;
         else { // move Left = d + Left + 2
            d = d - 4*(x - y) + 10;
           //Since we've started at the right hand side of the circle
            x = x - 1;
         }
         
         // Since we have started at top of the circle
         y = y + 1;                                
      }      
   }
   
/*
   //Bresenham circle
   //Read the following book at page 29...
   //http://books.google.com.pk/books?id=7gT1MhI1SbIC&pg=PP3&dq=+"Computer+Graphics++"SCHAUM's+outline+series"&cd=1#v=onepage&q= "Computer Graphics  "SCHAUM's outline series"&f=false 
   // a and b is an origin ordinate pair(a,b)
   // r is the radius                                   
   public static void drawCircle(Graphics graphics, int a, int b, int r) {
 
      //We'll start at the top of the circle
      //First point is always on the circle so error is zero and we know that x is zero and y is r         
      int x = 0, y = r, d = 3 - 2*r;
 
      // x is initially zero, x will be same as y at 45(degree) angle
      while(x <= y) {
         
         // Eight way symmetry of circle
         graphics.drawString(".", x + b, y + a);
         graphics.drawString(".", y + b, x + a); 
         graphics.drawString(".", (-1)*y + b, x + a);
         graphics.drawString(".", (-1)*x + b, y + a);
         graphics.drawString(".", (-1)*x + b, (-1)*y + a);
         graphics.drawString(".", (-1)*y + b, (-1)*x + a);
         graphics.drawString(".", y + b, (-1)*x + a);
         graphics.drawString(".", x + b, (-1)*y + a);
       
         if(d < 0) // move right
            d = d + 4*x + 6;
         else { // move down
            d = d + 4*(x - y) + 10;
           //Since we've started at the top of the circle
            y = y - 1;
         }
         
         // Since we have started at top of the circle
         x = x + 1;                                
      }      
   }
*/   
   
   //Bresenham line
   //Read chapter 3 at page 28 of the following book   
   //http://books.google.com.pk/books?id=7gT1MhI1SbIC&pg=PP3&dq=+"Computer+Graphics++"SCHAUM's+outline+series"&cd=1#v=onepage&q= "Computer Graphics  "SCHAUM's outline series"&f=false
   //I also went through following two documents
   //http://cs.fit.edu/~wds/classes/graphics/Rasterize/rasterize/rasterize.html
   //http://en.wikipedia.org/wiki/Bresenham's_line_algorithm
   public static void drawLine(Graphics graphics, int x1, int y1, int x2, int y2)  {
      
       int x, y, dx, dy, d, ystep, tmp;

      //This algorithm only deals with lines having shallow slopes. When a line has steep slope then we take the advantage of the fact that steep line can be reflected across the line y = x
      boolean steep = Math.abs(y2 - y1) > Math.abs(x2 - x1);   

       //Yes line has steep slope make it shallow  
       if(steep) {
  
          //swap(x1, y1) 
          //Because Java for scalar types is pass by value
          tmp = y1;
          y1 = x1;
          x1 = tmp;
 
          //swap(x2, y2)
          //Because Java for scalar types is pass by value
          tmp = y2;
          y2 = x2;
          x2 = tmp;               
       }
  
       //We always move from left to right(that is x is always incremented)
       if(x1 > x2) {
  
          //swap(x1, x2);
          //Because Java for scalar types is pass by value
          tmp = x2;
          x2 = x1;
          x1 = tmp;

           //swap(y1, y2)
           //Because Java for scalar types is pass by value
           tmp = y2;
           y2 = y1;
           y1 = tmp;
       }
  
       dx = x2 - x1;  
       dy = Math.abs(y2 - y1);
       //Initial value, the first and the last points are always on the line, so error is zero(2e=2(0)=0)
       //e = dyX - dxY + c
       //eR = dy(X + 1) - dxY + c = e + dy
       //eD = dy(X + 1) - dx(Y + 1) + c = e + dy - dx
       //d = eR + eD
       d = 2*dy - dx;
  
       //Find out if we'll increment or decrement y
       if(y1 < y2) 
          ystep = 1;
       else
           ystep = -1;

       //Initial values(initial ordinate pair) 
       x = x1;
       y = y1;
  
       while(x <= x2) {
   
           //x is reflected as y(transitive)  
           if(steep)
              graphics.drawString(".", y, x);
           else
              graphics.drawString(".", x, y);   

           //We only allow two moves, move to the right, or move diagonally. when we move to the right we only increment x otherwise we increment both(sign of ystep)
           if(d < 0) 
              d = d + 2*dy;
           else {
    
               d = d + 2*dy - 2*dx;
               y = y + ystep;
           }

           x = x + 1;      
       }                  
   }

   // Trigonometric method
   // a = length of major axis, b = length of minor axis
   // h,k ordinate pair for the center of the ellipse
   // x = a * cos(0 to PI/2 radians) + h 
   // y = b * sin(0 to PI/2 radians) + k
   // Inorder to rotate on axis, make minor greater than major
   public static void drawEllipse(Graphics graphics, int h, int k, int a, int b) {      
   
        int x = 0, y = 0; 
  
        //i is the magnitude of increment to radian at each step, this should not be fixed as it is now
        double radian = 0, i = 0.01;

        while(radian <= Math.PI/2) {
             
            x = (int)(a*(Math.cos(radian)));
            y = (int)(b*(Math.sin(radian)));
 
            //Ellipses have 4 way symmetry
           graphics.drawString(".", x + h, y + k);  
           graphics.drawString(".", (-1)*x + h, y + k); 
           graphics.drawString(".", (-1)*x + h, (-1)*y + k); 
           graphics.drawString(".", x + h, (-1)*y + k); 

           radian = radian + i;  
        }             
   }   
     
   // It is easy, no special algorithm there, just draw four lines
   public static void drawRectangle(Graphics graphics, int x1, int y1, int width, int height) {
   
      drawLine(graphics, x1, y1, x1 + width, y1);
      drawLine(graphics, x1, y1 + height, x1 + width, y1 + height);
      drawLine(graphics, x1, y1, x1, y1 + height);
      drawLine(graphics, x1 + width, y1, x1 + width, y1 + height);      
   } 
   
   public static void fillRectangle(Graphics graphics, int x1, int y1, int width, int height) {
   
        int x, y;
  
        if(width < 2 || height < 2) {
  
           drawRectangle(graphics, x1, y1, width, height);
           return;
        }
  
        for(y = 0; y < height + 1; y++)
            for(x = 0; x < width + 1; x++)      
                graphics.drawString(".", x1 + x, y1 + y);             
   }

   public static void fillCircle(Graphics graphics, int a, int b, int r) {
   
        int r1;
  
        for(r1 = r; r1 > 0; r1--)  
            drawCircle(graphics, a, b, r1);     
   }          
};

 

 

Legal Use of Codecs in Linux

I am still a Windows XP user thinking about trying out a Linux distribution.

I installed VLC Media Player recently on XP, and then applied my ultimate test for any media player: I popped in a DVD and checked if VLC could play it. Even on a copy of XP, it could not as the required codecs were missing.

If I switch to Linux I would like to be able to play DVDs legally, even if I have to pay to use the codecs.

Read more... Comment (0)
 
Page 6 of 10

Upcoming Linux Foundation Courses

  1. LFS422 High Availability Linux Architecture
    08 Sep » 11 Sep - Raleigh, NC
    Details
  2. LFS426 Linux Performance Tuning
    08 Sep » 11 Sep - New York
    Details
  3. LFS520 OpenStack Cloud Architecture and Deployment
    08 Sep » 11 Sep - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board