Archive for the ‘Uncategorized’ Category

Linux Desktop Environment

The Desktop is an environment. When the Desktop appears as the computer session begins hundreds of programs and settings work together to provide the working environment for each user. In other words, when you turn on a computer the working area that is viewable is the Desktop. All graphical operating systems have an environment which they create, Windows, Mac or Linux. Understanding the purpose and design of the Desktop is an important aspect of employing the Desktop to work for you and with you.

Modifying the Gnome Panel

Desktop Components
The Linux system can either run with the graphical user interface which is the interface that allows users to see images and text. Or the Linux system can run only in text mode which allows you to do everything faster and more efficiently but requires extensive knowledge of Linux commands and programs. Each option can compliment the other. In fact, many users find it more productive to use both interfaces.

The GUI, graphical user interface, gives you a background which you can change, icons which are links to programs, and visual aids which are available for word processing, image manipulation, spreadsheets, etc. The GUI uses images to help the user make decisions as to how to use the operating system through the use of icons. This process is intuitive, meaning for the most part if a user sees a series of options in button form they instantly realize that these represents options to programs. This intuitive process makes it much easier in terms of training as most computer aware users can easily pick this up rapidly.

The text mode has no hints through the use of icons, or arrows, etc. The user must know the commands necessary to accomplish each task. For a new Linux user the aspect of understanding even a fraction of the 10,000 Linux commands with variations is overwhelming. However, every Linux user must be able to use 10-20 commands so the command line still is important in Linux.

The graphical interface of Ubuntu 8.04 opens to the Desktop. This is where everything will start for the user. Desktop icons provide shortcuts to programs that are commonly used and the bar across the bottom of the desktop includes minimized programs, a place to change to another workspace, minimize all programs and a trash can. On the top of the Ubuntu 8.04 Hardy Heron desktop you will see another grey panel that includes a full Gnome main menu to the left broken up into three sections Applications, Places, and System. The main menu contains access to most of the applications computer locations and system commands that are needed with Ubuntu 8.04 Hardy Heron. Also on top are icons that link to Firefox 3.0, Evolution, and help. To the right of the top panel is a clock and numerous shortcut icons including a red power icon which allows the user to log out, lock screen, switch user, hibernate, restart or shutdown. Ubuntu 8.04 Hardy Heron includes Gnome 2.22 which offers a sleek environment to operate in along with many new features.

Note that much effort goes into creating icons which are intuitive, for example the Evolution mail program link is represented by an envelope. The terms “Applications”, “Places” and “System” are self descriptive terms which help a user understand immediately the basic concept behind each of the terms.

Another important concept in terms of the Desktop environment is that it is a flexible environment. Each aspect of the Desktop is able to be manipulated and configured in a way that is most effective for the user.


Working Directory

The Working Directory is the location of the directory that you are currently in. For example if you log into the system, it is designed so that you will begin in your home directory. For example, if your username was tom then your home directory by default would be /home/tom. When tom logs into the system it places him in the /home/tom directory, which is the current working directory. So if tom issues the command ls, then it will list the contents of /home/tom. If tom moves to the /usr directory by using the command cd /usr (which means change directories to /usr) then the current working directory is /usr Current working directory is the current directory that a command will interact with. Now, that does not mean that you have to be located in a directory to issue a command in the shell. Regardless of your current working directory you can use a command that interacts with any directory by using a path. For example, if you were located in the /home/tom directory you could list the contents of the /usr/share directory by using the path of that directory so the command would look like this:
ls /usr/share

One command that will verify your working directory is the command pwd, which stands for print working directory.

Moving Around in Directories

The cd command is the basic way to move around in the directory system. Cd followed by the directory location will move the users current working directory. For example,
cd /home

This command moves a user to the /home directory where all user directories are located. If the user fred wanted to move to their /home directory they would use:
cd /home/fred

There is a shortcut to moving to your home directory. The ~ is equivalent to the home directory. As a result fred can move to his home directory with this command:
cd ~

This makes it easier than typing the full path.

Managing Resources in Ubuntu 8.04

When any Linux system is operating there hundreds of processes that could be running. A basic understanding of how these processes function is a great advantage to a Linux user. There are a number of ways to view these processes and the resources that they may use.

System Monitor on the Gnome desktop gives you excellent access to the workings of your computer. The graphical charts provide a quick glimpse of activity on the system and the process Listing allows you to switch between the processes that you are running, all processes and active processes. If you go to System/Administration and System Monitor you will find excellent tools to monitor your Ubuntu 8.04 system. The first tab will display you Linux Kernel, memory, CPU and available disk space.

The second tab describes the processes that are running on your system. These processes provide you with an excellent tool to see where the most memory or CPU time is going. This is great for trouble shooting.

The third tab is a easy way to glance at a graphical output showing your CPU usage, memory and network connections.

The last tab will show you how your system is partitioned.

A common method of viewing processes is by using the terminal. The ps command generates a snapshot of the currently running processes. In order to really see the whole picture three options are usually added to the command:

ps aux

a shows processes used by other users
u the user format showing user names ans start times
x includes processes not started from a terminal like a daemon such as ftp

The results show several important categories;the user, PID (Process ID), % of CPU usage, % of Memory and the start time. This is an easy way to locate a process that is taking too many resources or too large a percentage of CPU and Memory on the system that can cause all other processes to be very slow. This is a good way to review your system to look for problems.

The pstree command not only shows the processes but it also shows how each process is related to other processes, a tree if you will.
Use this command to see the tree with the process ID;
pstree -p

This is a very interesting way to view the system processes and helps you understand how it is all working together.

The final command that is often used to view processes is the top command:

The top command is just filled with information. The upper section of the screen gives you a summary of the whole system:
uptime – how long the system has been running
users – how many users are currently logged in
load average
tasks – the example shows 87 tasks with one running and 86 sleeping
zombie – programs that are running but are dead
CPU – user %, System %, idle % –all interesting stuff
Memory Usage
Swap Space usage

In addition, top gives you the PID, user, etc. that the other commands do. From this information you can get a feel for what is happening on the system as well as locate bottlenecks and programs that are misbehaving.

Ubuntu 8.04 Hardy Crash and Freeze After Login

After performing recent updates to my Ubuntu 8.04 Hardy Heron desktop i’ve noticed my system started to experience random freezing. At first i thought it was from using Firefox 3.0 or just after login in but after some trial and error it appears to be a much more serious problem. This bug has been reported to the Ubuntu bug list and is bug # 228633.

Bug # 228633 causes system hangs, offers no mouse movement, gives no keyboard response, errors or logs. Some think it is due to the use of a wireless card and by disabling the wireless and using a wired connection have been able to work around this problem until the bug is fixed. I still had problems after doing this and it appeared to be USB-related.
For a detailed bug description go here
For Ubuntu 8.04 Hardy Heron training designed to resolve issues like this visit

gOS a Company With New Ideas

June 17, 2008 2 comments

gOS is a Linux distro that is struggling to find innovative areas and create new ideas. In many ways that is the kind of concept that brought me to Linux years ago…10+ actually. 10 years ago Linux was not much fun and the innovative Desktop options that we all take for granted were not even in the dream stage.

Here is a link to the gOS Website

Concepts that I Like About gOS:
1. Innovative Ideas
This is a company that is not just trying to make a minor modification to create a new version of Ubuntu. They have ideas that are different. Recently that have developed an OS focused on MySpace Users. I think that is great, I don’t like MySpace but that is not the point, innovation is what is driving Linux in unique directions that I like to support. The Google Apps version “Rocket” was another innovative idea that many people who are only doing basic things with Linux can use and enjoy. I use “Rocket” on the Cloud Laptop which I have used for travel and found the ideas surrounding “Rocket” to be sound as it provides options when traveling that people want.

2. Mistakes Are Made
Quite frankly the support that has been provided in the past on the web site has been poor. People who purchased gOS machines at Walmart as first time Linux users have been frustrated and often have take back their Linux PCs out of that frustration. Currently the updates on MySpace Apps does not work…wow what a mess. However, out of this there are some good things about this company. They are taking risk and breaking new territory instead of sitting and only doing the safe and easy options of other companies. I can live with some of their mistakes…I can even be patient with the problems because I like innovation and where it is taking us.

gOS Rocket Training CD with Flash Movies

Al in all, gOS is in for a rough ride as they are small and have limited resources to make things happen quickly. However, I will be using gOS and buying their products because to Linux has always been about New Ideas.

Build a Simple iptables Firewall

June 16, 2008 2 comments

Simple iptables Firewall
This simple firewall is OK for a desktop system so that you can use it and then modify it later and in the process learn iptables. The script will work with basically any Linux distro and of course you must make all modifications as root. Be sure to test your set up before you depend upon it.

Create the script with a text editor and save it in /etc/rc.d/rc.firewall . Change the permissions so that it is executable:
chmod 755 /etc/rc.d/rc.firewall

One modification you must make is to place the IP Address of the DNS server you want to use and replace:

Here is the script:
# Simple firewall placed in /etc/rc.d/rc.firewall
# chmod 755 /etc/rc.d/rc.firewall

iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p udp -s your_dns_server_ip –sport 53 -j ACCEPT
iptables -A INPUT -p tcp –syn -j REJECT
iptables -A INPUT -p udp -j REJECT

Explanation of the Script:
This script will clean out all previous rules when it starts and will provide you security in that it will not allow any computer to initiate a connection to your box. This is the line that shows no –syn connections.
iptables -A INPUT -p tcp –syn -j REJECT

That way you have a simple firewall and you can add to it later.

If you want the script to start automatically on boot edit your /etc/rc.local file and add the line:
sh /etc/rc.d/rc.firewall

Here is an example of rc.local.

#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0” on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.
sh /etc/rc.d/rc.firewall
exit 0

Using rsync to Backup Data


The rsync command will create an exact copy of your information in a new location based on what has changed. It takes a look a timestamps to determine what file have changed. This synchronization process is a reliable way to keep two directories exactly the same.

The Trailing Slash
It is important to understand the difference in use with or without the trailing slash.

rsync -av /home/office/ /bk
This example does not move the office directory folder only the contents.

rsync -av /home/office /bk
This example will result in the office directory located under the /bk = /bk/office.

Note the differences and choose the method you want to use for your backups.

If you want to make your transfer smaller then use the -z option to compress your transfer.

rsync -avz /home/office/ /bk

Archive Mode -a
This will ensure that all symbolic links, devices, attributes,permissions, ownerships,etc. are preservered and transferred. This is the same as rlptgoD

Verbose -v
This will provide you with information.

Get Stats on Transfer –stats

rsync -avz –stats /home/office/ /var/bk

Here is an example of the stats you will have available.
Number of files: 324352
Number of files transferred: 70613
Total file size: 20610660916 bytes
Total transferred file size: 11504455981 bytes
Literal data: 11504455981 bytes
Matched data: 0 bytes
File list size: 17670110
File list generation time: 37.718 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 11527010557
Total bytes received: 1887490

sent 11527010557 bytes received 1887490 bytes 21212323.91 bytes/sec
total size is 20610660916 speedup is 1.79

File size Transferred
11.5 MB

Exclude a Pattern

rsync -avz –exclude=*.rpm –stats /home/office/ /var/bk

Linux Training Packages CLICK HERE

Create an exclude file.
If you have a number of extensions you want to exclude, create a file and then tell rsync where the file is so that these extensions or patterns will not be transferred.

rsync -avz –exclude-from=/home/office/exclude –stats /home/office/ /bk
Here the file containing the patterns is listed by using –exclude-from= followed by a path to the file. As you can see the patterns in the file are not transferred.

home/office/exclude file contents, one pattern on each line.

rsync script
This script will sync the /home where user mail is kept to a directory on a separate drive. Once the file is synced then it will be backed up with a tar command in the example above.

/usr/bin/rsync -a – -verbose – -stats /home /bk/home
if [ $? -ne 0 ]; then

Crontab By using crontab -e you will be able to setup cron jobs that will run the two scripts above as often as you need.
17 8-17 * * * /root/
47 8-17 * * * /root/

If you created a script like this, below is the output.

/usr/bin/rsync -a –verbose –stats /home /bk/home


Number of files: 8195
Number of files transferred: 7376
Total file size: 6677491116 bytes
Total transferred file size: 6677490762 bytes
Literal data: 6677490762 bytes
Matched data: 0 bytes
File list size: 218205
Total bytes sent: 6678839831
Total bytes received: 147540

sent 6678839831 bytes received 147540 bytes 12045062.89 bytes/sec
total size is 6677491116 speedup is 1.00