Friday, January 30, 2009

Customizing the GNOME Panel - Adding Amusing Applets to the Panel

The GNOME Panel not only allows you to add very functional utilities, but it allows you to add quite seemingly useless amusements as well. In this part of the project, we will be adding two such amusements: Geyes and a little fish called Wanda.

At first glance, Wanda does little more than bat her tail around and spurt out a bubble or two. However, if you click on her, a window pops up in which Wanda will spew out quotes and offbeat one-liners.

To get a glimpse of Wanda in action, limited though that action may be, but I’ll run through them one more time:

1. Right-click any open space on the top panel.

2. From the popup menu, select Add to Panel, after which the Add to Panel window will appear.

3. In that window, click Fish once to highlight it, click the Add button, and then click Close.

Wanda will now appear on your panel, so go ahead and give her a click to see what she has to say.

Now you can add Geyes, which is a pair of eyes that follows your mouse cursor around as it moves about your desktop. Follow the same procedure, but click Geyes instead of Fish in step 3.

Source of Information : Ubuntu for Non-Geeks (2nd Ed)

Thursday, January 29, 2009

Customizing the GNOME Panel - Adding Utility Buttons to the Panel

The GNOME Panel allows you to add a number of utility applets. Each of these has some specific function, such as tracking your stocks, telling you the weather, or performing some particular system-related function. To start out, let’s add a clearly useful utility to the top panel: the Force Quit button. The Force Quit button lets you quickly and easily deal with non-responding windows.

Yes, it does happen on occasion: A window suddenly refuses to do anything. Regardless of what you want it to do or what it is supposed to be doing, it just sits there as if it is on strike (maybe it is). With just one click of the Force Quit button, your cursor becomes a powerful surgical instrument that will kill the window you click. You definitely don’t want to be without this button, so here’s how to add it to the panel:

1. Right-click any open space on the top panel.

2. From the popup menu, select Add to Panel, after which the Add to Panel window will appear.

3. In that window, click Force Quit once to highlight it. Click the Add button, and then click Close to finish the job.

To reinforce what you’ve just learned how to do, let’s add another utility to the panel: the Run Application panel applet. Once you start installing applications in Ubuntu, you will find that some of those applications do not automatically install program launchers in your Applications menu. This means that you have to open a Terminal window and type a command every time you want to run such programs, which can get old rather fast. The Run Application panel applet is one way around this problem.

To add the Run Application applet to the panel, just follow the same steps you used in adding the Force Quit button; but this time in step 3, highlight Run Application in the Add Launcher window instead of Force Quit.

If you later decide not to keep the Run Application panel applet on the panel, or if you just prefer keyboard shortcuts to pointing and clicking, it is worth noting that you can also bring up the applet by pressing ALT-F2.

Source of Information : Ubuntu for Non-Geeks (2nd Ed)

Tuesday, January 20, 2009

Ubuntu System Monitoring

Ubuntu provides the GNOME System Monitor for displaying system information and monitoring system processes: choose System Administration System Monitor. Four tabs appear on the System Monitor window: System, Processes, Resources, and File Systems. The System tab shows the amount of memory, available disk space, and the type of CPU on your system. The Resources tab displays graphs for CPU, memory and swap memory, and network usage.

The File Systems tab lists file systems, where they are mounted, and their type, as well as the amount of disk space used and how much is free. This is a fast and easy way to check how much space is left on your system.

The GNOME hardware monitor display detected temperatures for your CPU and, if available, for your graphics card. First download and install the lm-sensors package (Ubuntu main repository). In a terminal window enter sudo sensors-detect to first activate sensors. These services will detect hardware sensors on your computer. They run as Hardware Sensor services in System Administration Services. You can then download and install the sensors-applet package, the GNOME applet for sensor information. Once the applet is installed, right-click the applet icon and open its preferences window, where you can set the temperature scale and display information.

Another useful applet is the CPU Frequency Scaling Monitor, which will display CPU use (as shown in the previous illustration). This applet used the powernowd service to detect how much of the CPU is being used. Most current CPUs support frequency scaling, which will lower the CPU frequency when it has few tasks to perform. Intel CPUs will scale down to 60 percent and AMD by 50 percent.

Source of Information : McGraw Hill Ubuntu The Complete Reference

Saturday, January 17, 2009

Using Bluetooth in Ubuntu

Ubuntu provides Bluetooth support for both serial connections and BlueZ protocol supported devices. Bluetooth is a wireless connection method for locally connected devices such as keyboards, mice, printers, and even PDAs and Bluetooth-capable cell phones. You can think of it as a small local network dedicated to your peripheral devices, eliminating the need for wires. Bluetooth devices can be directly connected through your computer’s serial ports or through specialized Bluetooth cards connected to USB ports or inserted in a PCI slot.

BlueZ is the official Linux Bluetooth protocol and has been integrated into the Linux kernel since version 2.4.6. The BlueZ protocol was developed originally by Qualcomm and is now an open source project located at http://bluez.sourceforge.net. It is included with Ubuntu in the bluez-utils and bluez-libs packages, among others. Check the BlueZ site for a complete list of supported hardware, including adapters, PCMCIA cards, and serial connectors.

To configure Bluetooth on Ubuntu, choose System Preferences Bluetooth Preferences to open the Bluetooth Preferences window with two tabs, Services and General. The Services pane has entries for Input Service, Audio Service, Network Service, and Serial Service. Use the check boxes to start or stop a service. Input Service and Audio Service are selected and running by default. Add Network Service if you are using a personal area network (PAN). On the General tab, you can select such features as Authorization Requests, Automatic Hardware Detection, and Device Notification.

To enable the Bluetooth service, be sure that the Bluetooth service is checked in servicesadmin by choosing System Administration Services.


Bluetooth Configuration
BlueZ includes several modules and drivers, including the core Bluetooth protocols for Host Controller Interface (HCI) devices (HCI USB, UART, PCMCIA) and virtual HCI drivers, along with modules to support protocols for Logical Link Control and Adaptation Protocol (L2CAP), serial port emulation (RFCOMM), Ethernet emulation (BNEP), Synchronous Connection-Oriented (SCO) links for real-time voice, and the Service Discovery Protocol (SDP), which automatically detects services available for an application. In addition, extended services are supported such as PAN and LAN access over Point-to-Point Protocol (PPP).

Configuration information is located in the /etc/bluetooth directory, along with the /etc/pcmcia directory for notebooks. The HCI information is saved in /etc/bluetooth/hcid.conf, and RFCOMM configuration information is in /etc/bluetooth/rfcomm.conf. The Bluetooth service script, /etc/rc.d/init.d/bluetooth, is used to start and stop Bluetooth services. This script will start up the Bluetooth daemon for HCI devices, hcid, and run any detection and configuration tools, including sdpd for the Service Discovery Protocol, and rfcomm. It will also activate any serial Bluetooth devices, using hciattach to detect them.

From the command line, you can use the hciconfig command to configure Bluetooth devices and hcitool to configure Bluetooth connections. Use hciattach to attach serial devices to a serial port such as /dev/ttyS1, and use rfcomm to configure and attach RFCOMM devices. Use l2ping to detect a Bluetooth device.

PAN allows you to use Bluetooth to implement a PAN supporting IP protocols, much like a wireless LAN for a small number of computers and devices. Bluetooth supports a much smaller bandwidth (1 to 2 megabits) than that used for a standard LAN, but it is sufficient for connecting and transferring data from handheld devices. Several devices and computers can be configured as PAN users, connecting through a central Group Network (GN) computer.

Alternatively, PAN users could connect to a gateway system operating as a network access point connecting the Bluetooth personal network to a large LAN network. The PAN nodes run their own service daemon, pand. Dial-up networking uses the dund daemon.

Source of Information : McGraw Hill Ubuntu The Complete Reference

Friday, January 16, 2009

File System Access in Ubuntu

Various file systems can be accessed easily on Ubuntu. Any additional internal hard drive partitions on your system—both Linux and Windows NTFS—will be automatically detected and can be automatically mounted, providing immediate and direct access from your desktop. In addition, you can access remote Windows shared folders and make your own shared folders accessible.


Access Linux File Systems on Internal Drives
Other Linux file systems on internal hard drives will be detect by Ubuntu automatically. Icons for these systems will be displayed on the Computer window (choose Places Computer). Initially, they will not be mounted. You will first have to validate your authorization before you can mount a disk. To mount a file system for the first time, double-click its icon. A PolicyKit authorization window will appear. You then enter your user password. The option to Remember Authorization is checked, keeping the authorization indefinitely. Whenever you start up your system again, the file system will be mounted for you automatically.

Once your file system is mounted, it displays its icon both in the Computer window and on the desktop. The file system will be mounted under the /media directory in a folder named with the name of the file system label, or, if unlabeled, with the device name such as sda3 for the third partition on the first SATA drive.

Once granted, authentication access will remain in place for a limited time, allowing you to mount other file systems without having to re-enter your password. These file systems will then be automatically mounted as well, provided the Remember Authorization remains checked in the Authenticate window.

Any user with administrative access on the primary console is authorized to mount file systems. You can use PolicyKit agent to expand or restrict this level of authorization, as well as enable access for specific users. In addition, your partitions will automatically be displayed on the desktop and in the Computer window as disk icons.


Access for Local Windows NTFS File Systems
If you have installed Ubuntu on a dual-boot system with Windows XP, NT, or 2000, or you otherwise need access to NTFS partitions, Linux NTFS support is installed automatically. Your NTFS partitions are mounted using Filesystem in Userspace (FUSE). The same authentication control used for Linux file systems applies to NTFS file systems. Icons for the NTFS partitions will be displayed in the Computer window.

The first time you access the file system, you may be asked to provide authorization. The NTFS is then mounted with icons displayed in the Computer widow and on the desktop. Whenever you start up your system, they will be automatically mounted for you. The partitions will be mounted under the /media directory with their labels used as folder names. If they have no labels, then they are given the name disk, and then numbered as disk0, disk1, and so on for additional partitions (unlabeled removable devices may also share these names). The NTFS partitions are mounted using ntfs-3g drivers.


Access to Local Network Windows NTFS File Systems
Shared Windows folders and printers on any of the computers connected to your local network are automatically accessible from your Ubuntu desktop. The DNS discovery service (Ahavi) automatically detects hosts on your home or local network, and will let you access directly any of the their shared folders.

To access the shared folders, select Network from the Places menu to open the Network Places window. Your connected computers will be listed. If you know the name of the Windows computer you want to access, just click on its icon, otherwise, click on the Windows network icon to see just the Windows machines. However, local systems cannot access your shared folders until you install a sharing server, Samba for Windows systems, and NFS for Linux/Unix systems. Should you attempt to share a directory, an error notice will be displayed asking you to install Samba or NFS.


Shared Folders for Your Network and Windows: NFS and Samba
To share a folder on your local network, right-click on it and select Sharing options. This opens a window where you can allow sharing, and whether to permit modifying, adding, or deleting files in the folder. You can also allow access to anyone who does not have an account on your system (guest).

To allow others to access your folders be sure the sharing servers are installed, Samba for Windows systems and NFS for Linux/Unix systems. The serves will be automatically configured for you and run. You will not be able to share folders until these servers are installed. This sharing feature is enabled using nautilus-share, and is meant to be used instead of the older GNOME admin-shares. You can still use admin-shares by entering admin-shares in a terminal window, and then clicking the Unlock button to gain administrative access To share folders (directories) with other Linux systems on your network, you use the NFS service (nfs-kernelserver). For Windows systems you use the Samba service (samba).

Source of Information : McGraw Hill Ubuntu The Complete Reference

Tuesday, January 13, 2009

Manual Display Configuration in Ubuntu

Your display will be detected automatically, and Ubuntu will configure both your graphics card and monitor. Normally you should not need to perform any configuration manually. However, with some hardware, your display or graphics card may not be correctly detected. Also, you may want to configure an additional screen(s) for multi display output. All configuration tools and drivers will generate an X Window System configuration file called /etc/X11/xorg.conf. This is the file the X Window System uses to start up. Whenever you change your settings, your current configuration is saved to /etc/X11/xorg.backup.conf. Should you need to restore your old settings manually, you can just replace your current xorg.conf file with the backup file. You are advised to make your own backup of an xorg. conf file that works. Should your display configuration become unrecoverable, you can always resort to the reliable backup. The following code creates a backup file called xorgmybackup.conf:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg-mybackup.conf

If you are using a vendor’s graphics driver (restricted hardware) such as the Nvidia or
ATI graphics driver, the respective vendor configuration tools will be installed for you. You can access these by choosing Applications System Tools. The Nvidia configuration tool will be named something like Nvidia X Server Settings. You should use the vendor’s configuration tool for configuring a vendor’s drivers. The Nvidia configuration tool is in the nvidia-settings package (see the following line of code). It is not installed with the Nvidia driver. You must use Synaptic Package Manager to install it yourself. You’ll then see the Nvidia X Server Settings entry when you choose System Administration Nvidia X Server Settings. This interface provides Nvidia vendor access to many of the features of Nvidia graphics cards, such as color correction, video brightness and contrast, thermal monitoring, screen resolution, and color depth.

nvidia-settings

ATI/AMD provides a Linux version of its Catalyst configuration tool for use on Linux. Much of the ATI video drivers have now become open source, making the ATI video driver much more Linux-compatible. The ATI/AME Catalyst configuration tool for Linux is in the fglrx-control package, which you will have to install with the Synaptic Package Manager, like so:

fglrx-control

Alternatively, if you are not using a vendor driver, and you have to perform specific configurations such as selecting the correct monitor type, you can manually configure your graphics driver using the Screen and Graphics tool (displayconfig-gtk). Choose System Administration Screen And Graphics. The monitor and resolution should be selected automatically.

If your monitor is not correctly set, you may have to make sure your monitor is selected. Click the small monitor icon next to the Model text box to open a Choose Screen window with manufacturer and model listings. First select the manufacturer. All supported monitors for that manufacturer will then be listed in the model listings. Then select the correct model. You will see the horizontal and vertical frequencies for that selected monitor displayed. Check with your monitor documentation to make sure they are correct. You can try to use the Detect button to automatically detect the monitor settings, but this may not always be accurate.

You also have the option of creating different location profiles. This is useful if you are using different monitors at certain locations or for different purposes. So, for example, your laptop could have one location for its own screen and another for an attached larger screen. Others could use one location for a standard PC monitor and another for a home theater display such as an LCD TV. You can also select which driver to use. The appropriate driver will already be selected, but if you are having problems with a vendor’s driver, you may want to switch to the X.org driver. Click the Driver button to open a Choose Graphics Card Driver window, where you can then select the drivers from a list or by graphics card model.

Source of Information : McGraw Hill Ubuntu The Complete Reference

Monday, January 12, 2009

Login Window Configuration

To change the login window, use the Login Screen Setup window accessible by choosing System Administration Login Window. This configures the GNOME Display Manager (GDM), which runs your login process. Here you can set the background image, icons to be displayed, the theme to use, users to list, and even the welcome message. You can also set up an automatic login for a particular user, skipping the GDM login screen on startup. Login screens can be configured for local or remote users. You can choose between a plain screen, a plain screen with face browser, or a themed screen. The Local tab lets you select what screen to use for local logins, and you can browse among available themes. From the Remote tab, you can select Plain, select Plain With Browser, or use the same configuration used for your local logins.

On the Users tab, you can select which users you want displayed when using a face browser. On the Local tab, you can choose from a number of themes. The Ubuntu theme is selected by default. You can also opt to have the theme randomly selected. On the Security tab, you can set up an automatic login, skipping the login screen on startup. You can even set a timed login, automatically logging in a specific user after displaying the login screen for a given amount of time. In the Security area of the tab, you can set security options such as whether to allow root logins or allow TCP (Internet) access, as well as setting the number of allowable logins. Click the Configure X Server button to open a window for configuring X server access. Check the GNOME Display Manager Reference Manual, accessible with the Help button, for details.

You can configure automatic login for a particular user on the Login Window Preferences configuration’s Security tab. This feature is useful for single-user systems in which the same user logs in.

Source of Information : McGraw Hill Ubuntu The Complete Reference

Sunday, January 11, 2009

Installing Asian Language Input Support for SCIM in Ubuntu

So what do you do if, for example, you want to be able to type Chinese, Japanese, Korean, Hindi, Thai, or Nepali while still in your usual English environment? What if you want to be able to type all of those languages in the same document? Can you do it? You bet. There are actually several ways of going about this, but the one of the most straightforward to use is Smart Common Input Method (SCIM), the base for which comes preinstalled in Ubuntu. SCIM supports most Asian languages, including Chinese, Japanese and Korean, and it provides a number of input methods for many of these.


Downloading and Installing SCIM Input Method Modules
Despite coming preinstalled on Ubuntu, SCIM will not be able to do anything for you right out of the box. In order to enable SCIM so you can input CJK and other similar types of characters, you will need to install a package called im-switch. Then you will need to install the appropriate input modules for the language you wish to type in. The easiest and least problematic way of getting these packages is via the Language Support utility. Just go to the System menu, select Administration -> Language Support, and then install support for the languages you want. After the installation of the language support modules is complete, there is still one simple step left. Just log out, and then once you’re back at the login screen, log back in. A SCIM applet will appear at the right side of the top panel, letting you know that SCIM is ready for action.


Typing in Asian Languages with SCIM
To get a feel for how SCIM works, try using it with Gedit (Applications -> Accessories_Text Editor). Once Gedit appears, click the SCIM panel applet. A list of the available languages that can be handled via SCIM will then appear in a drop-down menu. Remember, however, that the number of languages appearing in that menu will be dependent on the number of language packages you installed.

From that list, select the language you want to use, and then, for those languages where you are given a choice, select the input method you prefer. The icon for the SCIM panel applet will reflect the change by showing the icon for the language you have chosen. You can then start typing. At this point, a small input palette will appear at the bottom-right corner of the screen. This palette, in addition to displaying the language and input method currently in use, also allows you to easily switch between English and the current language of input, or to switch from the language in which you are currently typing to another. By clicking the red button at the far-right end of the palette, you can also find out what the hotkeys are for the input method you are currently using. Regardless of the input method you are dealing with, probably the most important hotkey combination you will want to use is SHIFT-spacebar, which toggles you back and forth between English and the language you currently have selected in SCIM.


Installing Additional Input Methods
You may find that the input methods supplied for the languages you have chosen may include some that you are not familiar with. For example, the default Korean set is not based on the standard keyboard (the only one I’m familiar with), and it does not have Hangul-to-Hanja conversion capabilities like the hiragana-to-Kanji ones included by default in the Japanese module. Fortunately, this is easily remedied by using Synaptic to install additional input modules. Which package you download depends, of course, on the language in question. To add additional modules for Korean, install scim-tables-ko. For additional Japanese input methods, install scim-tables-ja. Finally, for additional Chinese modules, install scim-tables-zh. You can also use SCIM to conveniently type in other Asian languages that do not require special conversion routines, such as Thai, Hindi, Telugu, Bengali, and Punjabi. To get input support for these languages, install scim-tables-additional.

Source of Information : Ubuntu for Non-Geeks (2nd Ed)

Saturday, January 10, 2009

Typing Nonstandard Characters in Ubuntu

Typing characters that are not standard in English, such as é, ç, ß, ø, æ, and å, can be done quite easily in Linux without any modifications. In most situations, you can do this by using the Character Map utility included in your system, which can be found at Applications -> Accessories -> Character Map.

To input the character you want, just select the language or character set in the left pane of the window, and then, in the right pane, click on the character you want to input. The character will appear in the little input box next to the words Text to copy at the bottom of the window. Just click the Copy button, and then paste the character wherever you want to place it. In certain applications, such as the various OpenOffice.org modules, this method will not work. In these cases, the program usually offers a method of its own. In OpenOffice.org, for example, you can click Insert in the menu bar and then select Special Character. A selection window will open, and you can select the character you want there. Once you’ve done that, click the OK button, and the character will appear in your document, after which the selection window will close by itself.


Using the Compose Key Option
If you only need to type an accent or umlaut once in a while, and don’t feel particularly keen on opening an application or going to a special menu to do so, using the compose key option for your keyboard is a good way to go. Basically what this means is that you use one of the lesser-used keys on your keyboard in conjunction with six symbols (` , ' ~ " ^) to help in the creation, so to speak, of accented characters. By default, the compose key is the right ALT key. Let’s say, for example, that you wanted to type an umlauted u (ü). While pressing the right ALT key, you would press ". Then you would release the right ALT key, press u, and . . . voilà, you’d have yourself an ü.


Using the Keyboard Indicator
If you often type in a particular foreign language, it might be more convenient for you to use the Keyboard Indicator GNOME Panel utility. This utility lets you switch quickly among various keyboard layouts. For example, if you often type in Swedish, and thus use the characters å, ä, and ö regularly, using the appropriate keyboard layout would be easier than repeatedly using the Character Map. Of course, you will have to familiarize yourself with the keyboard layout, or keymap, for each language you choose, but this is a relatively easy task.

The Keyboard Indicator is already included in your system, so there is no need to install it. To access it, simply right-click somewhere on the GNOME Panel where you would like to place a launcher for it. Then, from the popup menu select Add to Panel. When the Add to Panel window appears, scroll down and click Keyboard Indicator, and then click the Add button. The letters USA or GBr will then appear on the panel.

Now, this alone will give you nothing except your default keymap, so you must configure Keyboard Indicator if you want to be able to use other keymaps. To do so, just right-click the icon, and from the popup menu select Open Keyboard Preferences, which will open the Keyboard Preferences window.

To add a keymap, click the Layouts tab in that window, and then once in the new tab, click Add. After you do this, the Choose a Layout window will appear with a list of the keymaps available to you. In the left pane of that window, scroll down to the keymap for the country of the language you want to add, and then click it to select the standard keyboard layout for that locale (click the arrow next to the country for a list of optional layouts if you prefer). Once you’ve made your selection, click the OK button, which will bring you back to the Keyboard Preferences window, where you will find your new keymap listed along with the original. You can then click the Close button to complete the setup.

After closing the Keyboard Preferences window, the keyboard layouts can be changed by clicking the icon in the panel. You can also change between keyboard layouts by going to the Layout Options tab of the Keyboard Preferences window and assigning a keyboard shortcut. If you are not sure where the keys you want to type are located in your new keymap, switch to the keymap in question by clicking the panel Keyboard Indicator until it appears and then right-clicking it. In the popup menu that appears, select Layout View, after which a map of the new layout will appear in a separate window. The default window size is quite small, but it can be resized in the usual dragthe-corner manner.

If you just want to choose a single keyboard layout to replace your present one (such as British English instead of American English or German instead of Spanish), you can do so from the Keyboard Preferences window by adding the keyboard layout you want to use, checking the box next to the word Default, and then removing the original layout by clicking it once to select it and clicking the Remove button.

Source of Information : Ubuntu for Non-Geeks (2nd Ed)

Friday, January 9, 2009

Chinese, Japanese, and Korean Input in Ubuntu

For most European languages (and many other alphabet-based non-European languages), pressing a letter on the keyboard simply prints that letter to the screen. However, Chinese, Japanese, and Korean require a kind of conversion process that is handled by a special application (actually a set of applications) called an Input Method Editor (IME). Of course, this is a Windows-world term, but I will use it here for convenience’s sake. In any case, each of these languages has its own IME, and each is quite different due to the basic differences in the three writing systems.


Chinese
While most people (at least those in the linguistic know) would think that Chinese would be the most complicated system, because the writing system consists of thousands of characters, it is in fact the simplest. The Chinese IME simply takes the romanized keyboard input, known as pinyin, and converts it into Chinese characters, or Hanzi. For the IME, it is essentially a simple dictionary lookup task—big dictionary, simple IME. In the event that there is more than one character for the pinyin input, a list of possible candidates will appear, and the user can then simply select the appropriate character from that list.


Japanese
The Japanese IME has a considerably more complicated task to perform, as it has three writing systems to deal with: Kanji (ideographic characters borrowed long ago from China), hiragana (the phono-alphabetic system used mainly for tense and case endings), and katakana (used mainly for words borrowed from other languages). Still, the standard input method for Japanese is primarily via the standard Roman keyboard layout, plus a few extra specialfunction keys. Thus, typing in Japanese is a two-step process whereby the IME first converts the romanized text into hiragana as it is typed and then converts it to appropriate Kanji, katakana, or hiragana elements after the spacebar is pressed. In the first line, the IME has already converted the romanized input on the fly. It has converted rinakkusdenihongonyuuryokumodekimasu (which means You can also input Japanese in Linux) to hiragana. The fact that line is underlined means that it has not yet been converted beyond that. In the second line, however, the user has subsequently pressed the spacebar, which caused the IME to convert the hiragana string into the appropriate Kanji, hiragana, and katakana elements. The first word, Linux, has been converted to katakana text, as it is a borrowed word, while Japanese input has been converted to Kanji; the rest stays in hiragana.


Korean
The job of the Korean IME is again quite different from that of the Chinese and Japanese IMEs, as the language itself is written in a very different way. Korean is written either entirely in alphabetic letters, called Hangul, or in a combination of Hangul and ideographic characters borrowed from Chinese called Hanja. While the Hanja characters are essentially the same as their Chinese and Japanese counterparts, Hanzi and Kanji, the Korean phonetic alphabet, Hangul, has it own unique appearance, as you can see in the
Korean word for Korea, Hangug(k),.

This seems simple; however, the representation is not quite correct, as Korean is very unique in the way that its alphabetic characters are put to the page. Unlike the usual side-by-side positioning of hiragana, katakana, and most other languages written with an alphabet, Hangul letters are grouped in pairs, triplets, or even quadruplets, which are written, as a general rule, clockwise. The IME, therefore, must take the input (usually based on a Korean alphabetical keyboard layout) while it is being typed, and it must adjust the size, spacing, and positioning of each of the letters as it puts them into appropriate clusters.

Source of Information : Ubuntu for Non-Geeks (2nd Ed)

Thursday, January 8, 2009

Viewing Your System in Another Language in Ubuntu

One of the many things that originally attracted me to the Linux world was being able to install language support for languages other than English. On one of my machines, I have installed support for Chinese, Japanese, Swedish, and my default, English. With just a simple logout and a few more clicks, I can log back in with an interface in a totally different language. I can have a Chinese, Japanese, or Swedish system whenever I want.

This is very useful if you are going to be doing a lot of work in a foreign language, or if you are studying a foreign language and want to give yourself as much exposure as possible to it. It is also very handy when you have users with different native languages using the same machine. At my former university, for example, where my Japanese and Chinese students sometimes used my computer, the additional language support allowed them to log in using their own language. All in all, it is a very useful feature.

Taking advantage of this feature in the GNOME environment is very easy and, depending on the language you wish to use, requires little in terms of special installation measures. Basically all you have to do is install a group of support files for each language you want to add to your system. You can do this quite easily by going to the System menu and selecting Administration -> Language Support.

You will be prompted for your password at this point, so provide what is required, and the Language Support window will appear. In that window, check the boxes next to the languages for which you want to install support. Once you have made your selections, click the Apply button, and the Language Selector will begin downloading and then installing the support packages you specified.

Language Support is another graphical front end for APT, and that being the case, be sure to close all other APT-related tools before using it.


Multilingual Login
Once you have installed support for any additional languages you want, you can log out of your current session and log in to a new one in a different language environment. The actual switch is made from your login screen.

Just below the text box where you would normally type your username, click the link that says Language, after which a window with a list of the languages you have installed will appear. Select the language you want to use in the next session by clicking once on its name and then clicking the OK button. The language list window will then close automatically, and you can proceed as usual by typing your login name and password (pressing the ENTER key after each, of course). A little window will then pop up asking you if you want to use the language you’ve chosen as your default language forever and ever. You can either click Just for This Session or Make Default depending on your personal preferences. Whatever you do end up choosing, fear not; it’s no big deal to change back at a later point in time by logging out of your system, logging back in to your system under your previous default language, and clicking Make Default.

Your startup process will then continue, and everything will progress as it usually does. Depending on what language you’ve chosen, once your desktop appears you will be in another linguistic world. Your menus, applications, and even the little Tips windows that pop up when you run your mouse over a panel icon will all be in the newly selected language.

Source of Information : Ubuntu for Non-Geeks (2nd Ed)

Wednesday, January 7, 2009

Startup Scripts

Startup scripts are not quite a part of the information stored in the users’ database in Linux. But they nonetheless play an important role in determining and controlling a user’s environment. In particular, the startup scripts in Linux are usually stored under the user’s home directory… and hence the need to mention them while still on the subject of the directory (home directory) field in the /etc/passwd file. Linux/UNIX was built from the get-go as a multiuser environment. Each user is allowed to have his or her own configuration files; thus, the system appears to be customized for each particular user (even if other people are logged in at the same time). The customization of each individual user environment is done through the use of shell scripts, run control files, and the like. These files can contain a series of commands to be executed by the shell that starts when a user logs in. In the case of the bash shell, for example, one of its startup files is the .bashrc file. (Yes, there is a period in front of the filename—filenames preceded by periods, also called dot files, are hidden from normal directory listings.) You can think of shell scripts in the same light as batch files, except shell scripts can be much more capable. The .bashrc script in particular is similar in nature to autoexec.bat in the Windows world. Various Linux software packages use application-specific and customizable options in directories or files that begin with a dot (.) in each user’s home directory. Some examples are .mozilla and .kde. Here are some common dot (.) files that are present in each user’s home directory:

• .bashrc/.profile Configuration files for BASH.

• .tcshrc/.login Configuration files for tcsh.

• .xinitrc This script overrides the default script that gets called when you log into the X Window System.

• .Xdefaults This file contains defaults that you can specify for X Window System applications.

When you create a user’s account, a set of default dot files are also created for the user; this is mostly for convenience, to help get the user started. The user creation tools discussed later on help you do this automatically. The default files are stored under the /etc/skel directory.

Source of Information : McGraw Hill Osborne Media Linux Administration A Beginners Guide Fifth Edition

Tuesday, January 6, 2009

The /etc/passwd File

The /etc/passwd file stores the user’s login, encrypted password entry, UID, default GID, name (sometimes called GECOS), home directory, and login shell. Each line in the file represents information about a user. The lines are made up of various standard fields, with each field delimited by a colon


Username Field
This field is also referred to as the login field or the account field. It stores the name of the user on the system. The username must be a unique string and uniquely identifies a user to the system. Different sites use different methods for generating user login names. A common method is to use the first letter of the user’s first name and append the user’s last name. This usually works, because the chances are relatively slim that one would have users with the same first and last names. There are, of course, several variations of this method. For example, for a user whose first name is “Ying” and whose last name is “Yang”—a username of “yyang” can be assigned to that user.


Password Field
This field contains the encrypted password for the user. On most modern Linux systems, this field contains a letter x to indicate that shadow passwords are being used on the system. Every user account on the system should have a password or, at the very least, be tagged as impossible to log in. This is crucial to the security of the system—weak passwords make compromising a system just that much simpler.

The original philosophy behind passwords is actually quite interesting, especially since we still rely on a significant part of it today. The idea is simple: Instead of relying on protected files to keep passwords a secret, the system would encrypt the password using an AT&T-developed (and National Security Agency–approved) algorithm called Data Encryption Standard (DES) and leave the encrypted value publicly viewable. What originally made this secure was that the encryption algorithm was computationally difficult to break. The best most folks could do was a brute-force dictionary attack, where automated systems would iterate through a large dictionary and rely on the nature of users to pick English words for their passwords. Many people tried to break DES itself, but since it was an open algorithm that anyone could study, it was made much more bulletproof before it was actually deployed.

When users entered their passwords at a login prompt, the password they entered would be encrypted. The encrypted value would then be compared against the user’s password entry. If the two encrypted values matched, the user was allowed to enter the system. The actual algorithm for performing the encryption was computationally cheap enough that a single encryption wouldn’t take too long. However, the tens of thousands of encryptions that would be needed for a dictionary attack would take prohibitively long. But then a problem occurred: Moore’s Law on processor speed doubling every 18 months held true, and home computers were becoming powerful and fast enough that programs were able to perform a brute-force dictionary attack within days rather than weeks or months. Dictionaries got bigger, and the software got smarter. The nature of passwords thus needed to be reevaluated. One solution has been to improve the algorithm used to perform the encryption of passwords. Some distributions of Linux have followed the path of the FreeBSD operating system and used the Message-Digest algorithm 5 (MD5) scheme. This has increased the complexity involved in cracking passwords, which, when used in conjunction with shadow passwords (discussed later on), works quite well. (Of course, this is assuming you make your users choose good passwords!)


User-ID Field (UID)
This field stores a unique number that the operating system and other applications use to identify the user and determine access privileges. It is the numerical equivalent of the Username field. The UID must be unique for every user, with the exception of the UID 0 (zero). Any user who has a UID of 0 has root (administrative) access and thus has the full run of the system. Usually, the only user who has this specific UID has the login root. It is considered bad practice to allow any other users or usernames to have a UID of 0. This is notably different from the Windows NT and 2000 models, in which any number of users can have administrative privileges. Different Linux distributions sometimes adopt different UID numbering schemes. For example, Fedora and Red Hat Enterprise Linux (RHEL) reserve the UID 99 for the user “nobody,” while SuSE and Ubuntu Linux use the UID 65534 for the user “nobody.”


Group-ID Field (GID)
The next field in the /etc/passwd file is the group-ID entry. It is the numerical equivalent of the primary group that the user belongs to. This field also plays an important role in determining user access privileges. It should be noted that besides a user’s primary group, a user can belong to other groups as well.


GECOS
This field can store various pieces of information for a user. It can act as a placeholder for the user description, full name (first name and last name), telephone number, and so on. This field is optional and as result can be left blank. It is also possible to store multiple entries in this field by simply separating the different entries with a comma.


Directory
This is usually the user’s home directory, but it can also be any arbitrary location on the
system. Every user who actually logs into the system needs a place for configuration files
that are unique to the user. This place, called a home directory, allows each user to work
in a customized environment without having to change the environment customized by another user—even if both users are logged into the system at the same time. In this directory, users are allowed to keep not only their configuration files, but their regular work files as well.

For the sake of consistency, most sites place home directories at /home and name each user’s directory by that user’s login name. Thus, for example, if your login name were “yyang,” your home directory would be /home/yyang. The exception to this is for some special system accounts, such as a root user’s account or a system service. The superuser’s (root’s) home directory in Linux is usually set to /root (but for most variants of UNIX, such as Solaris, the home directory is traditionally /). An example of a special system service that might need a specific working directory could be a web server whose web pages are served from the /var/www/ directory. In Linux, the decision to place home directories under /home is strictly arbitrary, but it does make organizational sense. The system really doesn’t care where we place home directories, so long as the location for each user is specified in the password file.


Shell
When users log into the system, they expect an environment that can help them be productive. This first program that users encounter is called a shell. If you’re used to the Windows side of the world, you might equate this with command.com, Program Manager, or Windows Explorer (not to be confused with Internet Explorer, which is a web rowser). Under UNIX/Linux, most shells are text-based. A popular default user shell in Linux is the Bourne Again Shell, or BASH for short. Linux comes with several shells from which to choose—you can see most of them listed in the /etc/shells file. Deciding which shell is right for you is kind of like choosing a favorite beer—what’s right for you isn’t right for everyone, but still, everyone tends to get defensive about their choice! What makes Linux so interesting is that you do not have to stick with the list of shells provided in /etc/shells. In the strictest of definitions, the password entry for each user doesn’t list what shell to run so much as it lists what program to run first for the user. Of course, most users prefer that the first program run be a shell, such as BASH.

Source of Information : McGraw Hill Osborne Media Linux Administration A Beginners Guide Fifth Edition

Monday, January 5, 2009

What Is SMB?

Years ago, Microsoft and IBM came up with the SMB (Server Message Block) protocol to compete with Novell's IPX-based file and print sharing. Though it's hard to believe now, there was a time when pretty much all corporate networks were running IPX and Novell Netware servers. The relatively few home networks were running IPX, while military and research networks used TCP/IP. SMB was the first protocol to run over multiple network protocols: TCP/IP, NetBEUI, and IPX/SPX. In other words, an SMB server could replace a Novell server without need of changing the rest of the network infrastructure. The promise was that of an open system—one where any server that could speak SMB could serve any SMB-speaking clients, over any of several network protocols. Bear in mind, though, that this promise would go pretty much unfulfilled for quite some time. The only servers that spoke SMB were OS/2 and MS Windows. When OS/2 failed to gather much market share, Joe User was left with an "open" solution that was available from only one vendor.

Note, as well, that this "open" solution (which, to the best of my knowledge, was never marketed as such) had nothing for Unix users. SMB was strictly PC stuff, and PC stuff was shunned by Unix users as being too dinky, too underpowered, and incapable of running a "real OS." As MS Windows quickly became a de facto standard, so did the SMB protocol. Users began using MS Windows' built-in (SMB) file and print sharing to offer new levels of data sharing. When Windows 95 came along, it got even easier. Using the standard GUI approach, anyone with a mouse and a finger to click it could set up file shares, shared printers, password-protected shares, and even drive mappings. Gone was the need for the arcane batch files required by earlier versions of Windows and by contemporary versions of Novell Netware. So today, we are left with a single great divide: the Microsoft, PC, SMB world, on the one hand, and the Unix, big iron, NFS world on the other. So what are the differences? There are quite a few, and we'll start by looking at naming.

Every machine on a Windows network is identified by a NetBIOS name, which is similar to a Linux hostname. NetBIOS names are at most 15 characters and are case-insensitive. Unlike hostnames, they also contain a resource-type byte, which describes the role or roles of the machine on the network. Multiple names and multiple types can be associated with a single physical machine. As an example, here is a listing of the NetBIOS names associated with the primary Linux box on my home network:

HOMER <00> - B
HOMER <03> - B
HOMER <20> - B
__MSBROWSE__ <01> - B
WORKGROUP <00> - B
WORKGROUP <1d> - B
WORKGROUP <1e> - B

The NetBIOS names are on the left, and the hex value of the resource-type byte is shown in angle brackets. Type <00> means a standard workstation, type <03> means a WinPopup service, and type <20> means a file and print server. So my computer HOMER advertises itself as a workstation and a file server and as capable of receiving WinPopup messages.

The other name, __MSBROWSE__, is Microsoft's way of identifying a domain master browser. A master browser is responsible for periodically checking what machines and shares are available on a network and caching that information. Then when another computer wants to "explore" the network, it needs to ask only the master browser what is available instead of doing a network-intensive broadcast request.

What about the WORKGROUP entries? These describe the workgroups, or domains, to which my machine belongs. I only have one workgroup on my network, WORKGROUP, and HOMER advertises itself as a workstation (type 00) in that domain. The other two lines refer to the machine's role as a master browser.

Every machine that understands SMB advertises itself as providing certain services. These services do not have to be limited to file sharing; in a typical Windows network they include print sharing, remote administration capabilities, popup messaging, and other features. Every service has a name unique to the machine where it is offered. On a network, a service is identified with the following syntax:

\\machine-name\service-name

This notation is called the universal naming convention (though it's hardly universal!). Since backslashes are shell metacharacters under Linux, most of the Samba utilities will conveniently accept UNCs using forward slashes and automatically convert them to backslashes as necessary.

On a Windows file server, any directory can be defined as the root of a file-sharing service. There is no dependence on the physical layout of the file system, and the directory being shared can itself be connected to a file share on a third machine. All subdirectories of the file-sharing root are accessible through a share. Access to a share is controlled both by the permissions on the share and by the permission on the underlying file system, if applicable.

A Windows print share allows network access to a locally connected printer. The service does not provide drivers for a printer, only the ability to send a pre formatted print job from a remote machine. As a result, if you intend to use a Windows printer from a Linux machine, you must have Linux drivers available to generate the appropriate control language for the printer. The Ghostscript package is included with most Linux distributions, and it provides a wide variety of filters to convert PostScript to proprietary printer-control languages. A list of directly supported printers and third-party-supported printers are available at the Ghostscript Web site.

On my machine KEARNEY, for example, the following services are available. We'll see how to list these services in the next section.

\\KEARNEY\CDROM maps to E:\
\\KEARNEY\ZIPLIB maps to D:Ziplib\
\\KEARNEY\CANON print service for a Canon BJ-200
\\KEARNEY\IPC$ special OS service

Source of information : Addison Wesley - Multitool Linux - Practical Uses for Open Source Software

Sunday, January 4, 2009

Yum

Yum is one of the newer methods of software management on Linux systems. It is basically a wrapper program for RPM, with great enhancements. It has been around for a while, but it has become more widely used and more prominent because major Linux vendors decided to concentrate on their (more profitable) commercial product offerings. Yum has changed and enhanced the traditional approach to package management on RPM-based systems. Popular large sites that serve as repositories for open source software have had to retool slightly to accommodate “Yumified” repositories. According to the Yum project’s web page: “Yum is an automatic updater and package installer/remover for RPM systems.

It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using RPM.”

This summary is an understatement. Yum can do a lot beyond that. There are certain new Linux distributions that rely heavily on the capabilities provided by Yum. Using Yum is simple on supported systems. You mostly need a single configuration file (/etc/yum.conf). Other configuration files may be stored under the /etc/yum.repos.d/directory that points to the Yum-enabled (Yumified) software repository. Fortunately, several Linux distributions now ship with Yum already installed and preconfigured. Fedora is one of these distros. To use Yum on a Fedora system (or any other Red Hat–like distro)—to install a package called gcc, for example—at the command line, you would type

[root@fedora-serverA ~]# yum install gcc

Yum will automatically take care of any dependencies that the package might need and install the package for you. (The first time it is run, it will build up its local cache.) Yum will even do your dishes for you (your mileage may vary). Yum also has extensive search capabilities that will help you find a package, even if you don’t know its correct name. All you need to know is part of the name. For example, if you wanted to search for all packages that have the word “headers” in the name, you can try a Yum option like this:

[root@fedora-serverA ~]# yum search headers

This will return a long list of matches. You can then look through the list and pick the package you want.

By default, Yum tries to access repositories that are located somewhere on the Internet. Therefore, your system needs to be able to access the Internet to use Yum in its default state. You can also create your own local software repository on the local file system or on your local area network (LAN) and Yumify it. Simply copy the entire contents of the distribution media (DVD/CD) somewhere and run the yum-arch command against the directory location

Source of Information : McGraw Hill Osborne Media Linux Administration A Beginners Guide Fifth Edition

Saturday, January 3, 2009

The hdparm Command

The hdparm utility can be used by root to set and tune the settings for IDE hard drives. You would do this to tune the drives for optimal performance. Once a kernel patch and associated support programs, the hdparm program is now included with Ubuntu. You should only experiment with the drives mounted read-only because some settings can damage some file systems when used improperly. The hdparm command also works with CD-ROM drives and some SCSI drives.

The general format of the command is this:
# hdparm command device

This command runs a hard disk test:
hdparm –tT /dev/hda

You will need to replace /dev/hda with the location of your hard disk. hdparm will then run two tests—cached reads and buffered disk reads. A good IDE hard disk should be getting 400-500MB/sec for the first test, and 20-30MB/sec for the second. Note your scores, then try this command:

hdparm –m16 –d1 –u1 –c1 /dev/hda

That enables various performance-enhancing settings. Now try executing the original command again—if you see an increase, then you should run this command:

hdparm –m16 –d1 –u1 –c1 –k1 /dev/hda

The extra parameter tells hdparm to write the settings to disk so they will be used each time you boot up—ensuring optimal disk performance in the future.

The man entry for hdparm is extensive and contains useful detailed information, but since the kernel configuration selected by Ubuntu already attempts to optimize the drives, it might be that little can be gained through tweaking. Because not all hardware combinations can be anticipated by Ubuntu or by Linux and performance gains are always useful, you’re encouraged to try.

You can use the hdparm command to produce a disk transfer speed result with
# hdparm -tT device
Be aware, however, that although the resulting numbers appear quantitative, they are subject to several technical qualifications beyond the scope of what is discussed and explained in this chapter. Simply put, do not accept values generated by hdparm as absolute numbers, but only as a relative measure of performance.

Source of Information : Sams Ubuntu Unleashed 2008 Edition

Friday, January 2, 2009

Using the BIOS and Kernel to Tune the Disk Drives

One method of tuning involves adjusting the settings in your BIOS. Because the BIOS is not Linux and every BIOS seems different, always read your motherboard manual for better possible settings and make certain that all the drives are detected correctly by the BIOS. Change only one setting at a time.

Linux does provide a limited means to interact with BIOS settings during the boot process (mostly overriding them). In this section, you will learn about those commands.

Other options are in the following list, and are more fully outlined in the BOOTPROMPT HOWTO and the kernel documentation. These commands can be used to force the IDE controllers and drives to be optimally configured. Of course, YMMV (Your Mileage May Vary) because these do not work for everyone.

idex=dma—This will force DMA support to be turned on for the primary IDE bus, where x=0, or the secondary bus, where x=1.

idex=autotune—This command will attempt to tune the interface for optimal performance.

hdx=ide-scsi—This command will enable SCSI emulation of an IDE drive. This is required for some CD-RW drives to work properly in write mode and it might provide some performance improvements for regular CD-R drives as well.

idebus=xx—This can be any number from 20 to 66; autodetection is attempted, but this can set it manually if dmesg says that it isn’t autodetected correctly or if you have it set in the BIOS to a different value (overclocked). Most PCI controllers will be happy with 33.

pci=biosirq—Some motherboards might cause Linux to generate an error message saying that you should use this. Look in dmesg for it; if you do not see it, you don’t need to use it.

These options can be entered into /etc/lilo.conf or /boot/grub/grub.conf in the same way as other options are appended.

Source of Information : Sams Ubuntu Unleashed 2008 Edition

Thursday, January 1, 2009

Ubuntu Display Drivers

The GUI for your desktop display is implemented by the X Window System. The version used on Ubuntu is X.org You can use either vendor-supplied drivers or X.org generic drivers for your graphics card. Ubuntu packages the vendor drivers as restricted graphics software packages, which are designed for compatible installation on Ubuntu and are available on the Ubuntu restricted repository. You can find out more about X.org at www.x.org.

When you first install your system, the X.org generic drives are used. Should your graphics card be supported by a vendor (or proprietary) driver, such as ATI or Nvidia drivers, a notification icon for restricted software will appear on the Ubuntu’s top panel with a message. For many recent graphics cards from Nvidia or ATI, the vendor driver is recommended. The vendor driver will often support 3-D effects much better that the corresponding generic X.org drivers. Because vendor driver software is not open source and consists of hidden proprietary code, it is considered restricted. Since the code is private, it cannot be guaranteed to work—though, in most cases, the Nvidia and ATI drives have proven reliable. To install the hardware driver, click the notification icon on the panel to open the Hardware Drivers window, where your hardware drivers will be listed. Click the check box under the Enable column to enable the driver. When you restart your system, the new vendor driver will be used.

Should you be using a recently released graphics card, you may have to rely on restricted driver support, though the generic X.org drivers will usually work. You should always use the Ubuntu-compliant version of a vendor driver that is available in the restricted repository. Though possible, it is not recommended that you download a vendor driver for Linux directly from a graphics card vendor such as ATI or Nvidia.

Source of Information : McGraw Hill Ubuntu The Complete Reference

Setting Your Bash Shell Prompt

Your prompt consists of a set of characters that appear each time the shell is ready to accept a command. The PS1 environment variable sets what the prompt contains and is what you interact with most of the time. If your shell requires additional input, it uses the values of PS2, PS3, and PS4. When your Linux system is installed, often a prompt is set to contain more than just a dollar sign or pound sign. For example, in Fedora or Red Hat Enterprise Linux, your prompt is set to include the following information: your username, your hostname, and the base name of your current working directory. That information is surrounded by brackets and followed by a dollar sign (for regular users) or a pound sign (for the root user). Here is an example of that prompt:

[chris@myhost bin]$

If you change directories, the bin name would change to the name of the new directory. Likewise, if you were to log in as a different user or to a different host, that information would change.

You can use several special characters (indicated by adding a backslash to a variety of letters) to include different information in your prompt. These can include your terminal number, the date, and the time, as well as other pieces of information.

Characters to Add Information to the bash Prompt
\! Shows the current command history number. This includes all previous commands stored for your username.

\# Shows the command number of the current command. This includes only the commands for the active shell.

\$ Shows the user prompt ($) or root prompt (#), depending on which user you are.

\W Shows only the current working directory base name. For example, if the current working directory was /var/spool/mail, this value simply appears as mail.

\[ Precedes a sequence of nonprinting characters. This can be used to add a terminal control sequence into the prompt for such things as changing colors, adding blink effects, or making characters bold. (Your terminal determines the exact sequences available.)

\] Follows a sequence of nonprinting characters.

\\ Shows a backslash.

\d Displays the day name, month, and day number of the current date. For example: Sat Jan 23.

\h Shows the hostname of the computer running the shell.

\n Causes a newline to occur.

\nnn Shows the character that relates to the octal number replacing nnn.

\s Displays the current shell name. For the bash shell, the value would be bash.

\t Prints the current time in hours, minutes, and seconds (for example, 10:14:39).

\u Prints your current username.

\w Displays the full path to the current working directory.

To make a change to your prompt permanent, add the value of PS1 to your .bashrc file in your home directory (assuming that you are using the bash shell). There may already be a PS1 value in that file that you can modify. Refer to the Bash Prompt HOWTO (www.tldp.org/HOWTO/Bash-Prompt-HOWTO) for information on changing colors, commands, and other features of your bash shell prompt.

Source of Information : Linux Bible 2008 Edition