Archive for December, 2007

Changing GNOME s Look and FeelChange (Make my own web site) is inevitable, except

Monday, December 24th, 2007

Changing GNOME s Look and FeelChange is inevitable, except from a vending machine. AnonymousThe GNOME desktop environment has an amazing set of features for you toexplore. Some of these customization features are nice and practical, andothers are just plain fun. I tried to group the types of changes into relatedtopics so that you can peruse them easily. In general (including in Fedora), you can find all the GNOME configuration options by going to the mainmenu s Preferences menu. Because Fedora is the only distribution covered inthis book that uses GNOME by default, I focus on Fedora in this chapter. How do ya like them applets? Appletsare a collection of miniprograms that do anything from display thetime to show system status some can even show the depressing trickle ofyour battery power running out if you re using a laptop. Sure, some of theseminiprograms are more useful than others. Then again, everybody needs abit of entertainment too, right? Adding an applet icon to the panelYou can have fun sifting through to see what kinds of applets are available toyou. To look through your options and perhaps add an applet to the panel(remember that the panel is the bar along the bottom of your screen), followthese steps: 1.Right-click any free space on one of your panels and choose Add ToPanel. The Add To (Bottom or Top, accordingly) Panel dialog box appears, asshown in Figure 15-1. If you don t see an Add To Panel command, you re probably looking atthe context menu for one of the applications on the panel. Try right- clicking elsewhere on the panel or closing some programs so that youcan free up space amongst the minimized programs in the middle ofyour panel. 2.Browse the available applets. 3.After you select the applet you want to add to your panel, click Add. The applet is now on your panel. If you then want to move the applet elsewhere on your panel, right-click itand choose Move from the shortcut menu. Then you can drag the appletaround and click after you have it where you want to put it. 294Part III:Getting Up to Speed with Linux

Chapter 15Gettin Gooey with the GUIsIn This Chapter (My space web page)

Sunday, December 23rd, 2007

Chapter 15Gettin Gooey with the GUIsIn This Chapter Adding applets to the panel Adding programs to the desktop Downloading and setting up themes Configuring the X Window SystemThe X Window System (or X) opens a world of possibilities. X is, in general, a set of applications that work together to provide a graphical interface. Think of these applications as the wireframe beneath your GUI, with GNOMEand KDE (see Chapter 6) offering the pretty paper m che coating. Some ofthese applications draw windows, some manage the look and feel, and othershandle other aspects of the graphical world for you. All of them are config- urable and even replaceable, which is enough to make the average user seyes cross with way too many options! GNOME and KDE are entirely creatures of convenience, offering integratedsets of window dressing so that you don t have to pick and choose your com- ponents. In this chapter, you get a chance to alter both KDE and GNOME sbehavior to suit your own needs. For example, if you have a hard time read- ing text in those small command-prompt windows in the GUI, you can makeboth the windows and their fonts larger. You can change a wealth of otherthings, too, so read on and take a look. If something goes terribly wrong in the GUI and you need to exit in a hurry, press Ctrl+Alt+Backspace. This key combination does one of two things. Ifyou boot into the GUI, it collapses your GUI session and takes you to the GUIlogin prompt. However, if you boot to the command line, this key combina- tion collapses the GUI immediately, taking you to the command line. However, press Ctrl+Alt+Backspace only in an emergency. This key combina- tion doesn t cleanly stop the programs involved. You end up with all kinds ofbits and pieces of programs, files, and more on your system.

292Part III:Getting Up to Speed with Linux (Mac os x web server)

Saturday, December 22nd, 2007

292Part III:Getting Up to Speed with Linux

The syntax for drawing a manpage is man (Web hosting servers)

Saturday, December 22nd, 2007

The syntax for drawing a manpage is man . Don t know the command you re looking for or need basic information aboutusing the manpage system? Just type man manto get started. When you refinished reading the man page, press Q to exit. Clearing the screenThe clearand resetcommands are handy to know about when you reworking in a shell. The clearcommand simply wipes the bashscreen clean. Don t worry; it s not deleting any files or changing any settings it s justtidying up so that you can start dumping new stuff to the screen again. The resetcommand is a little more interesting. Suppose that you try listinga binary file to the screen with the catcommand. After the computer finishespuking the result of executing the catcommand on a binary file, you may getlucky and still be able to read your prompt. More likely, your prompt hasbeen rendered into box characters of no special meaning, and typing on thekeyboard gives you more of the same. To get back to normal, just type resetand press Enter. Note that it doesn t look like you re typing the word reset, but rest assured that the computer understands the series of characters and, after a couple seconds, should restore your shell environment to your nativelanguage. 291Chapter 14: Working without the GUI20_

total 20drwx—— 2 (Sex offenders web site) sue users 4096 Oct 30

Friday, December 21st, 2007

total 20drwx—— 2 sue users 4096 Oct 30 07:48 . drwxr-xr-x 5 root root 4096 Oct 30 11:57 .. -rw-r—– 1 sue users 24 Oct 30 06:50 .bash_logout-rw-r—– 1 sue users 230 Oct 30 06:50 .bash_profile-rw-r—– 1 sue users 124 Oct 30 06:50 .bashrc-rw-rw-r– 1 sue users 0 Jan 2 07:48 wishlisttotal 20drwx—— 2 sue users 4096 Oct 30 07:48 . drwxr-xr-x 5 root root 4096 Oct 30 11:57 .. -rw-r—– 1 sue users 24 Oct 30 06:50 .bash_logout-rw-r—– 1 sue users 230 Oct 30 06:50 .bash_profile-rw-r—– 1 sue users 124 Oct 30 06:50 .bashrc-rw-rw-r– 1 sue users 0 Jan 2 07:48 wishlistLaying pipesAnother bashshell feature enables you to connect commands so that theoutput of one becomes the input for the next one. This feature is referred to as a pipe.Suppose that you want to look over the details of all files in the/etcdirectory in long-listing format. If you type ls -la /etcto do so, amassive listing appears, and much of the information scrolls right past you. Although you can back up a bit by pressing Shift+PageUp, you may not beable to see everything. To see all the information, you can do one of two things: Send the data to a file with redirection by typing something like ls -la/etc > ~/etclistingand then review the contents of ~/etclistingwith your favorite editor. Pipe the output to the morecommand(see Chapter 16). To pipe the output to more, type ls -la directory_path| more, wheredirectory_pathis the directory for which you want to list the contents. The |symbol (which on the keyboard looks more like two vertical barsstacked on top of each other rather than just one solid line) tells bashthatyou want to use a pipe. Help! The manpagesystem is the electronic manual for Linux (manis short formanual), designed to provide users with a convenient reference to all thedetailed command information. This information includes command promptoptions, file formats, and program function usage. 290Part III:Getting Up to Speed with Linux

Almost all Linux utilities that require input and (Web site template)

Thursday, December 20th, 2007

Almost all Linux utilities that require input and output have been plumbed withthe following common interfaces: stdin(standard input), stdout(standardoutput), and stderr(standard error). By having a common method to feedinput to a program or read data from the output of a program, you can glueutilities together into sophisticated solutions. Redirecting command outputI discuss redirecting command output here because it s by far the mostcommon form of information detouring. One example of output redirectioninvolves telling a command to send its results to a file rather than to thescreen, as you probably have been used to seeing. Start in some familiar terri- tory by typing ls -la ~and then pressing Enter, to produce something likethe following: total 20drwx—— 2 sue users 4096 Oct 30 07:48 . drwxr-xr-x 5 root root 4096 Oct 30 11:57 .. -rw-r—– 1 sue users 24 Oct 30 06:50 .bash_logout-rw-r—– 1 sue users 230 Oct 30 06:50 .bash_profile-rw-r—– 1 sue users 124 Oct 30 06:50 .bashrc-rw-rw-r– 1 sue users 0 Jan 2 07:48 wishlistWant to send this information to a file instead? You can use the >redirectionoperator to tell bashto send the data into a file instead of onto your screen. Enter the following command to send the information to a file named listing: ls -la ~ > listingNotice that nothing displays on the screen, as you normally would expect. That s because the shell has rerouted the output to a file named listing. To verify that the directory listing is there, enter the following command: cat listingThe cat(and more) is explained Chapter 16. Note that if you type ls -la ~ > listingagain, the data is overwritten, meaning that the file s contents are wiped out and replaced with the newoutput. You can avoid this situation by using >>as your redirection operator, which tells bashto add the command s output to the end of the specified file. If you type ls -la ~ >> listingin the same directory after making nochanges, the contents of listingare as follows: 289Chapter 14: Working without the GUI20_

the shell interprets special characters before processing the (Hosting your own web site)

Thursday, December 20th, 2007

the shell interprets special characters before processing the value. Rather thanuse single quotes, this time you use the same example with double quotes: echo Hello, my name is $USER Notice what the output is this time. Rather than display the exact text youprovided, the shell replaces the variable name, designated with a dollar sign, with the actual value stored in that variable. Why did I use single quotes in the PS1 example? The items with the back- slashes () are interpreted one way or another. However, if you use doublequotes with PS1, they re interpreted only once, so that item that lists whatdirectory you re in changes only the first time. With a single quote, the vari- ables are interpreted every time you do something. The double-quote exam- ple shows something like Hello, my name is bob. However, the singlequote comes up with Hello, my name is $USER. If you re going to play around with environment variables, I recommend thatyou start by using the methods I discuss in this section. After you have decidedthat you re comfortable with any changes you have made, you can make yourchanges permanent by opening the ~/.bash_profilefile and adding thesame text there. The next time you log in, the changes go into effect. You canmake changes for all your users profiles in /etc/profileas well. If you experiment heavily with these files, create a separate user account sothat you can do whatever you want without messing up your own login. Thisadvice especially goes for /etc/profile. You can damage everyone s loginswith this one! To create a separate /etc/profile, you can make a backup by typing cp /etc/profile /etc/profile.original. Then, edit /etc/ profileknowing that you can always delete it with the rmcommand and usethe mvcommand to rename /etc/profile.originalto /etc/profile. Don t be too discouraged if you don t understand all this variable stuff rightnow. As you become more proficient with Linux, you should explore shellscripting.Shell scripting is the art of creating computer programs with justthe shell. Most Linux and Unix administrators speak shell script language like you and I speak our native tongues. Using Redirection and PipesRedirection and pipes facilitate the flow of information. A pipeis exactly whatit sounds like: It directs the output of one program to the input of anotherprogram. A pipeline may consist of several utilities plumbed together bypipes. At either end of this pipeline is, optionally, a redirection. 288Part III:Getting Up to Speed with Linux

ComponentResulthPrints the name of the machine you re logged (Jetty web server)

Wednesday, December 19th, 2007

ComponentResulthPrints the name of the machine you re logged in to. nMoves down to the next line. sPrints bashfor the bashshell. tPrints the time in 24-hour format. uPrints your username. wPrints the lowest current directory level. WPrints the entire current directory. Okay, on with the example; to change your shell prompt to something moreamusing, enter the following line: PS1= Hello u, what can I do for you? => Note the single quotes. Immediately after pressing the Enter key, you see thatyour prompt has changed into something more inviting. Don t worry if youwould rather have the original prompt: You can either reassign to the originalprompt the value stored in PS1 or simply log out and log in again, and you reback to familiar territory. Are you wondering which other variables your system has in store for you? You can view all environment variables at one time by typing env. Note thatyou may not have any reason to access variables on the command line as acasual use of Linux. However, after you get more proficient, you may want tojourney into the shell programming capabilities of bash, in which case variablestorage is quite handy, just as it is in any computer programming language. What s with those single quotes? You have to be careful of some details when changing environment variables. If you re just assigning something to a number, you could just use, for example, HISTSIZE=250. However, if youwant to use something with spaces in it, you need to use quotes. Which kindof quotes you use depends on what else you want to do. If you want to display exactly what you have specified, use single quotes tocreate a literal text string.For example, type the following line at a commandprompt: echo Hello, my name is $USER Kinda goofy, huh? Take a look at a different kind of string that the shell inter- prets differently: an interpolated string. An interpolatedvalue is one in which287Chapter 14: Working without the GUI20_

Fedora web server - Most environment variables are established for you by

Tuesday, December 18th, 2007

Most environment variables are established for you by the system adminis- trator or perhaps by the shell itself. These variables are mostly read by pro- grams to gather information, and you don t need to change their values. However, you may want to alter the value of some environment variables. Forexample, in Table 14-1, the first entry, HISTSIZE, determines the number oflines of command-line history that are kept on file. You may have read thediscussion, earlier in this chapter, of re-executing a command from yesterday. (If not, refer to the section Accessing your command history. ) By setting ahigher number for HISTSIZE, you can save an even longer list of previouslyexecuted commands. Storing and retrieving variables valuesTo assign a value to a variable, you just use the variable name followed by anequals sign (=) followed by the value to store: MyVariable=MyValueTo retrieve the value represented by that variable, you need to precede thevariable name with a dollar sign ($). Look at a variable, created by the shell, that determines what your prompt looks like. This variable is named PS1. First, you view the value being held by PS1: echo $PS1You likely see something like the following line: [u@h W]$ Each of the characters preceded by a backslash represents a special instruc- tion to the shell to return specific information when the shell prompt is refer- enced. See Table 14-2 for examples of special slash-characters you can use incustomizing your prompt. Table 14-2Pieces of the PS1 PuzzleComponentResult!Prints the position of the command in your history list. #Prints the number of commands you have used during the current shell session. $Prints a $ for user accounts or a # for the superuser. dPrints the date in the following format: day month date. 286Part III:Getting Up to Speed with Linux

Ecommerce web host - You can usually tell at a glance the

Tuesday, December 18th, 2007

You can usually tell at a glance the difference between a variable and an envi- ronment variable in bash. The normal convention is to name local variablesin all lowercase or in mixed-case characters. An environment variable, how- ever, is usually always in all uppercase letters. Checking out commonly used environment variablesThe bash shell has many environment variables. You may be amazed at therange of items these variables store. The handy thing is that, if something isstored in a variable, you can change it to suit your needs! In Table 14-1, I listthe environment variables you re most likely to want to work with. Table 14-1Commonly Used bash Environment VariablesEnvironment VariablePurposeValueHISTSIZEDetermines the number Number of of previously typed com-commandsmands that are stored. HOMESets the location of your The path to your home directory.home directoryMAILCHECKSets how often the bashNumber of seconds shell checks for new mail to wait between in your mailbox. If mail has checksarrived, you see a message similar to You have new mailthe next time you do something at the command prompt. PATHSets the directories that Colon-separated bashlooks in, and the order directoriesto look in them to find a pro- gram name you type at the command prompt. PS1Sets your command prompt.Command and for- matting characters used to form the prompt285Chapter 14: Working without the GUI20_