==================
Linux Basic
==================
Installation
There are many common ways to install and run Ubuntu. You can run Ubuntu:
- as your sole operating system (single booting).
- in addition to another operating system (dual booting).
- within your existing operating system (virtualization). See VirtualMachines for installation options in a virtual environment.
- from your CD disc drive, using the Live CD.
- from your USB drive (on computers from 2004 and younger, roughly).
- in addition to Windows, using Window's Boot Manager, via the Wubi installation
NOTE: Prior to installing Ubuntu in a dual boot, it is recommended that you back up your computer. If things go wrong there are a number of options to get help listed on http://www.ubuntu.com/support
Acquiring Ubuntu
There are many ways to get an Ubuntu installation disk, these are detailed on the GettingUbuntu page. If you are planning on downloading and burning your own installation disk, please refer to BurningIsoHowto.
To acquire Ubuntu, you can purchase a CD or DVD from a distributer or download and burn the image to a CD or DVD for free. You can download the Ubuntu installer from one of the mirrors around the world. Downloading the installer requires a blank CD or DVD, and a CD or DVD burner that is capable of burning disc images.
To download Ubuntu Desktop Edition:
- Using your web browser, navigate to http://www.ubuntu.com/getubuntu/download
- Select the architecture of your processor (32 or 64 bit).
- Click "Start download". A pop up window opens, prompting you where to run or save the file.
- In Internet Explorer, click Run to automatically open the installation file in a CD burning utility or click Save to save the file to your disk. In Mozilla Firefox, select Open with to open the installation file in a CD burning utility or select Save File to save the file to your disk.
After downloading the Ubuntu installation CD image, you need to burn it to a CD or DVD. See BurningIsoHowto for detailed instructions on burning ISO disk images.
To burn the installation disk to a CD or DVD:
- Place a recordable CD or DVD into your CD/DVD drive.
- Load an application that is capable of burning .ISO image files to CDs or DVDs.
- Using your CD and DVD writing program, copy the disk image to your blank CD or DVD.
To Install Ubuntu
Ubuntu can be installed with the graphical CD. Make sure that your computer is set to boot from a CD before a hard drive.
- Insert the Ubuntu disc into your CD drive.
- Start or restart your computer. The Language screen appears. If you reboot your computer and do not see the language selection screen (seen below without the option to try without installing), please refer to BootFromCD.
- Select your desired language and click Install Ubuntu 10.04 LTS. The Where are you? window appears.
- Select the location closest to your location and click Forward. The Keyboard layout window appears.
- If the Suggested option is not correct, select the correct keyboard layout. Click Forward. The Allocate drive spacewindow appears.
- If you want to install Ubuntu over your entire hard drive, then Select Erase disk and install Ubuntu and select the hard drive that you want to install Ubuntu.Click Forward.
WARNING: Installing Ubuntu on your entire hard disk will erase all data that is currently on the drive.
OR
- If you want to install Ubuntu on a single partition Dual Booting, Select Guided – resize. In the New partition size area, drag the area between the two partitions to create your desired partition sizes. Click Forward.
- The Who are you? window appears.
- Enter the requested information, and click Forward. The Ready to install window appears.
- Verify that the language, layout, location, and personal information are correct and click Install. The installation wizard begins.
- When the installation wizard finishes, the Installation complete window appears.Click Restart now to restart your computer. Ubuntu is now installed.
Troubleshooting
If the install process fails, trying the alternate (text-based) installer is recommended. The screens during installation are in old-school graphics, but the system installed is similar.
What is "the shell"?------------------------the shell is a program that takes your commands from the keyboard and gives them to the operating system to perform. In the old days, it was the only user interface available on a Unix computer. Nowadays, we have graphical user interfaces (GUIs) in addition to command line interfaces (CLIs) such as the shell.On most Linux systems a program called bash (which stands for Bourne Again SHell, an enhanced version of the original Bourne shell program, sh, written by Steve Bourne) acts as the shell program. There are several additional shell programs available on a typical Linux system. These include: ksh, tcsh and zsh.butions supply several, such as: xterm, rxvt, kWhat's an xterm, gnome-terminal, konsole, etc.? -------------------------------------------------------------------- These are called "terminal emulators." They are programs that put a window up and let you interact with the shell. There are a bunch of different terminal emulators you can use. Most Linux distr konsole, kvt, gnome-terminal, nxterm, and eterm. Starting a Terminal --------------------------programs to see if anything looks like a terminal emulator program. In KDE, you can find "konsole" and "terminal" on the Utilities menu. In Gnome, you can find "color xterm," "regular xterm," and "gnome-terminal" on the Utilities menu. You can start up as many of these as you want and play with them. While there are a number of different terminal emulators, they all do the same thing. They give you access to a shell session. You will probably develop a preference for one, based on the different bells and whistles each one provides. Testing the Keyboard ------------------------------ Ok, let's try some typing. Bring up a termiYour window manager probably has a way to launch programs from a menu. Look through the list of p rnal window. You should see a shell prompt that contains your user name and the name of the machine followed by a dollar sign. Something like this: [sam@linuxbox sam]$ Excellent! Now type some nonsense characters and press the enter key. [sam@linuxbox sam]$ kdkjflajfks If all went well, you should have gotten an error message complaining that it cannot understand you: [sam@linuxbox sam]$ kdkjflajfks bash: kdkjflajfks: command not found Wonderful! Now press the up-arrow key. Watch how our previous command "kdkjflajfks" returns. Yes, we have command history. Press the down-arrow and we get the blank line again.3-button mouse; and you should have a 3-button mouse if you want to use Linux. First, you can use the mouse to scroll backwards and forwards through the output of the terminal window. To demonstrate, hold down thRecall the "kdkjflajfks" command using the up-arrow key if needed. Now, try the left and right-arrow keys. You can position the text cursor anywhere in the command line. This allows you to easily correct mistakes. You're not logged in as root, are you? Don't operate the computer as the superuser. You should only become the superuser when absolutely necessary. Doing otherwise is dangerous, stupid, and in poor taste. Create a user account for yourself now! Using the Mouse ----------------------- Even though the shell is a command line interface, you can still use the mouse for several things. That is, if you have a e enter key until it scrolls off the window. Now, with your mouse, you can use the scroll bar at the side of the terminal window to move the window contents up and down. If you are using xterm, you may find this difficult, since the middle button is required for this operation. If you have a 2-button mouse, it may have been configured to emulate a 3-button mouse. This means the middle button can be simulated by pressing down both the left and right buttons at the same time.----- When you installed your Linux system and its window manager (most likely Gnome or KDE), it was configured to behave in some ways like that legacy operating system. In particular, it probably has its focus policy set to "click to focus." This means that in order for a window to gain focus (become active) you have to click in the window. This is contrary to traditional X windows behavior. If you take my adviceNext, you can copy text with the mouse. Drag your mouse over some text (for example, "kdkjflajfks" right here on the browser window) while holding down the left button. The text should highlight. Now move your mouse pointer to the terminal window and press the middle mouse button. The text you highlighted in the browser window should be copied into the command line. Did I mention that you will need a 3-button mouse? A few words about focus... -------------------------------- - and get a 3-button mouse, you will want to set the focus policy to "focus follows mouse". This will make using the text copying feature of X windows much easier to use. You may find it strange at first that windows don't raise to the front when they get focus (you have to click on the title bar to do that), but you will enjoy being able to work on more than one window at once without having the active window obscuring the the other. Try it and give it a fair trial; I think you will like it. You can find this setting in the configuration tools for your window manager. Navigation ---------------------------- In this lesson, I will introduce your first three commands: pwd (print working directory), cd (change directory), and ls (list files and directories).view and manipulate the contents of the file system. Often you will see the file system represented like this: One important difference between the legacy operatiIf you have not worked with a command line interface before, you will need to pay close attention to this lesson, since the concepts will take some getting used to. File System Organization ----------------------------------- Like that legacy operating system, the files on a Linux system are arranged in what is called a hierarchical directory structure. This means that they are organized in a tree-like pattern of directories (called folders in other systems), which may contain files and other directories. The first directory in the file system is called the root directory. The root directory contains files and subdirectories, which contain more files and subdirectories and so on and so on. Most graphical environments today include a file manager program to ng system and Unix/Linux is that Linux does not employ the concept of drive letters. While drive letters split the file system into a series of different trees (one for each drive), Linux always has a single tree. Different storage devices may contain different branches of the tree, but there is always a single tree. pwd Since a command line interface cannot provide graphic pictures of the file system structure, it must have a different way of representing it. Think of the file system tree as a maze, and you are standing in it. At any given moment, you stand in a single directory. Inside that directory, you can see its files and the pathway to its parent directory and the pathways to the subdirectories of the directory in which you are standing. The directory you are standing in is called the working directory. To find the name of the working directory, use the pwd command. [sam@linuxbox sam]$ pwd /home/samified in one of two different ways; absolute pathnames or relative pathnames. Let's deal with absolute pathnames first. An absolute pathname begins with the root directory and follows the tree branch by branch until the path to the desired directory or file is completed. ForWhen you first log on to a Linux system, the working directory is set to your home directory. This is where you put your files. On most systems, your home directory will be called /home/your_user_name, but it can be anything according to the whims of the system administrator. To list the files in the working directory, use the ls command. [sam@linuxbox sam]$ ls Desktop Xrootenv.0 linuxcmd GNUstep bin nedit.rpm GUILG00.GZ hitni123.jpg nsmail I will come back to ls in the next lesson. There are a lot of fun things you can do with it, but I have to talk about pathnames and directories a bit first. cd To change your working directory (where you are standing in the maze) you use the cd command. To do this, type cd followed by the pathname of the desired working directory. A pathname is the route you take along the branches of the tree to get to the directory you want. Pathnames can be spe c example, there is a directory on your system in which programs are installed for the X window system. The pathname of the directory is /usr/X11R6/bin. This means from the root directory (represented by the leading slash in the pathname) there is a directory called "usr" which contains a directory called "X11R6" which contains a directory called "bin". Let's try this out: [sam@linuxbox sam]$ cd /usr/X11R6/bin [sam@linuxbox bin]$ pwd /usr/X11R6/bin [sam@linuxbox bin]$ ls Animate import xfwp AnotherLevel lbxproxy xg3 Audio listres xgal Auto lndir xgammon Banner makedepend xgc Cascade makeg xgetfile Clean mergelib xgopher Form mkdirhier xhexagons Ident mkfontdir xhost Pager mkxauth xieperf Pager_noxpm mogrify xinit RunWM montage xiterm RunWM.AfterStep mtv xjewel RunWM.Fvwm95 mtvp xkbbell@linuxbox bin]$ cd .. [sam@linuxbox X11R6]$ pwd /usRunWM.MWM nxterm xkbcomp and many more... Now we can see that we have changed the current working directory to /usr/X11R6/bin and that it is full of files. Notice how your prompt has changed? As a convenience, it is usually set up to display the name of the working directory. Where an absolute pathname starts from the root directory and leads to its destination, a relative pathname starts from the working directory. To do this, it uses a couple of special symbols to represent relative positions in the file system tree. These special symbols are "." (dot) and ".." (dot dot). The "." symbol refers to the working directory and the ".." symbol refers to the working directory's parent directory. Here is how it works. Let's change the working directory to /usr/X11R6/bin again: [sam@linuxbox sam]$ cd /usr/X11R6/bin [sam@linuxbox bin]$ pwd /usr/X11R6/bin O.K., now let's say that we wanted to change the working directory to the parent of /usr/X11R6/bin which is /usr/X11R6. We could do that two different ways. First, with an absolute pathname: [sam@linuxbox bin]$ cd /usr/X11R6 [sam@linuxbox X11R6]$ pwd /usr/X11R6 Or, with a relative pathname: [sa mr/X11R6 Two different methods with identical results. Which one should you use? The one that requires less typing! Likewise, we can change the working directory from /usr/X11R6 to /usr/X11R6/bin in two different ways. First using an absolute pathname: [sam@linuxbox X11R6]$ cd /usr/X11R6/bin [sam@linuxbox bin]$ pwd /usr/X11R6/bin Or, with a relative pathname: [sam@linuxbox X11R6]$ cd ./bin [sam@linuxbox bin]$ pwd /usr/X11R6/bin Now, there is something important that I must point out here. In almost all cases, you can omit the "./". It is implied. Typing: [sam@linuxbox X11R6]$ cd bin would do the same thing. In general, if you do not specify a pathname to something, the working directory will be assumed. There is one important exception to this, but we won't get to that for a while. A couple of shortcuts If you type cd followed by nothing, cd will change the working directory to your home directory. A related shortcut is to type cd ~user_name. In this case, cd will change the working directory to the home directory of the specified user. Important facts about file names. Looking Around ------------------------------------------- Now that you know how to move from working directory to working directory, we're going to take a tour of your Linux system and, along the way, learn some things about what makes it tick. But before we begin, I have to teach you some tools that will come in handy during our adventure. These are: :: ls (list files and directories) less (view text files) file (classify a file's contents) ls The ls command iFile names that begin with a period character are hidden. This only means that ls will not list them unless you say ls -a. When your account was created, several hidden files were placed in your home directory to configure things for your account. Later on we will take a closer look at some of these files to see how you can customize your environment. In addition, some applications will place their configuration and settings files in your home directory as hidden files. File names in Linux, like Unix, are case sensitive. The file names "File1" and "file1" refer to different files. Linux has no concept of a "file extension" like legacy operating systems. You may name files any way you like. The contents/purpose of a file is determined by other means. While Linux supports long file names which may contain embedded spaces and punctuation characters, limit the punctuation characters to period, dash, and underscore. Most importantly, do not embed spaces in file names. If you want to represent spaces between words in a file name, use underscore characters. You will thank yourself late rs used to list the contents of a directory. It is probably the most commonly used Linux command. It can be used in a number of different ways. Here are some examples: Examples of the ls command Command => Result ls => List the files in the working directory ls /bin => List the files in the /bin directory (or any other directory you care to specify) ls -l => List the files in the working directory in long format ls -l /etc /bin => List the files in the /bin directory and the /etc directory in long format ls -la .. => List all files (even ones with names beginning with a period character, which are normally hidden) in the parent of the working directory in long format These examples also point out an important concept about commands. Most commands operate like this: command -options arguments => where command is the name of the command, -options is one or more adjustments to the command's behavior, and arguments is one or more "things" upon which the command operates. In the case of ls, we see that ls is the name of the command, and that it can have one or more options, such as -a and -l, and it can operate on one or more files or directories. A Closer Look At Long Format If you use the -l option with ls, you will get a file listing that contains a wealth of information about the files being listed. Here's an example: :: -rw------- 1 bshotts bshotts 576 Apr 17 1998 weather.txt drwxr-xr-x 6 bshotts bshotts 1024 Oct 9 1999 web_pageghts of the file's owner. The next three represent the rights of th-rw-rw-r-- 1 bshotts bshotts 276480 Feb 11 20:41 web_site.tar -rw------- 1 bshotts bshotts 5743 Dec 16 1998 xmas_file.txt ---------- ------- ------- -------- ------------ ------------- | | | | | | | | | | | File Name | | | | | | | | | +--- Modification Time | | | | | | | +------------- Size (in bytes) | | | | | +----------------------- Group | | | +-------------------------------- Owner | +---------------------------------------------- File Permissions File Name => The name of the file or directory. Modification Time => The last time the file was modified. If the last modification occurred more than six months in the past, the date and year are displayed. Otherwise, the time of day is shown. Size => The size of the file in bytes. Group => The name of the group that has file permissions in addition to the file's owner. Owner => The name of the user who owns the file. File Permissions => A representation of the file's access permissions. The first character is the type of file. A "-" indicates a regular (ordinary) file. A "d" indicates a directory. The second set of three characters represent the read, write, and execution r ie file's group, and the final three represent the rights granted to everybody else. less => less is a program that lets you view text files. This is very handy since many of the files used to control and configure Linux are human readable (as opposed to the legacy operating systems). What is "text"? There are many ways to represent information on a computer. All methods involve defining a relationship between the information and some numbers that will be used to represent it. Computers, after all, only understand numbers and all data is converted to numeric representation. Some of these representation systems are very complex (such as compressed image files), while others are rather simple. One of the earliest and simplest is called ASCII text. ASCII (pronounced "As-Key") is short for American Standard Code for Information Interchange. This is a simple encoding scheme that was first used on Teletype machines to map keyboard characters to numbers. Text is a simple one-to-one mapping of characters to numbers. It is very compact. Fifty characters of text translates to fifty bytes of data. Throughout a Linux system, many files are stored in text format and there are many Linux tools that work with text files. Even the legacy operating systems recognize the importance of this format. The well-known NOTEPAD.EXE program is an editor for plain ASCII text files. The less program is invoked by simply typing: less text_file This will display the file. Controlling less file -------It's time to take our tour. The table below lists some interesting places to explore. This is by no means a complete list, but it should prove to be an interesting adventure. For each of the directories listed belowAs you wander around your Linux system, it is helpful to determine what a file contains before you try to view it. This is where the file command comes in. file will examine a file and tell you what kind of file it is. To use the file program, just type: file name_of_file The file program can recognize most types of files, such as: Various kinds of files File Type => Description => Viewable as text? ASCII text => The name says it all => yes Bourne-Again shell script text => A bash script => yes ELF 32-bit LSB core file => A core dump file (a program will create this when it crashes) => no ELF 32-bit LSB executable=> An executable binary program => no ELF 32-bit LSB shared object => A shared library => no GNU tar archive=> A tape archive file. A common way of storing groups of files. => no, (use tar tvf to view listing.) gzip compressed data=> An archive compressed with gzip => no HTML document text=> A web page => yes JPEG image data=> A compressed JPEG image => no PostScript document text => A PostScript file => yes RPM => A Red Hat Package Manager archive => no, use rpm -q to examine contents. Zip archive data => An archive compressed with zip => no While it may seem that most files cannot be viewed as text, you will be surprised how many can. This is especially true of the important configuration files. You will also notice during our adventure that many features of the operating system are controlled by shell scripts. In Linux, there are no secrets! , do the following: cd into each directory. Use ls to list the contents of the directory. If you see an interesting file, use the file command to determine its contents. For text files, use less to view them.s are kept here. /usr/src Source codeInteresting directories and their contents ----------------------------------------------------------- Directory Description / The root directory where the file system begins. In most cases the root directory only contains subdirectories. /boot This is where the Linux kernel and boot loader files are kept. The kernel is a file called vmlinuz. /etc The /etc directory contains the configuration files for the system. All of the files in /etc should be text files. Points of interest: /etc/passwd The passwd file contains the essential information for each user. It is here that users are defined. /etc/fstab The fstab file contains a table of devices that get mounted when your system boots. This file defines your disk drives. /etc/hosts This file lists the network host names and IP addresses that are intrinsically known to the system. /etc/init.d This directory contains the scripts that start various system services typically at boot time. /bin, /usr/bin These two directories contain most of the programs for the system. The /bin directory has the essential programs that the system requires to operate, while /usr/bin contains applications for the system's users. /sbin, /usr/sbin The sbin directories contain programs for system administration, mostly for use by the superuser. /usr The /usr directory contains a variety of things that support user applications. Some highlights: /usr/share/X11 Support files for the X Windows system /usr/share/dict Dictionaries for the spelling checker. Bet you didn't know that Linux had a spelling checker. See look and ispell. /usr/share/doc Various documentation files in a variety of formats. /usr/share/man The man pag efiles. If you installed the kernel source code package, you will find the entire Linux kernel source code here. /usr/local /usr/local and its subdirectories are used for the installation of software and other files for use on the local machine. What this really means is that software that is not part of the official distribution (which usually goes in /usr/bin) goes here. When you find interesting programs to install on your system, they should be installed in one of the /usr/local directories. Most often, the directory of choice is /usr/local/bin. /var The /var directory contains files that change as the system is running. This includes: /var/log Directory that contains log files. These are updated as the system runs. You should view the files in this directory from time to time, to monitor the health of your system. /var/spool This directory is used to hold files that are queued for some process, such as mail messages and print jobs. When a user's mail first arrives on the local system (assuming you have local mail), the messages are first stored in /var/spool/mail /lib The shared libraries (similar to DLLs in that other operating system) are kept here. /home /home is where users keep their personal work. In general, this is the only place users are allowed to write files. This keeps things nice and clean :-) /root This is the superuser's home directory. /tmp /tmp is a directory in which programs can write their temporary files.mounted. When your system boots, it reads a list of mounting instructions in the file /etc/fstab, which describes which device is mounted at which mount point in the directory tree. This takes care of the hard drives, but you may also have devices that are considered temporary, such as CD-ROMs and floppy disks. Since these are removable, they do not stay mounted all the time. The /media directory is used by the automatic device mounting mechanisms found in modern desktop orient/dev The /dev directory is a special directory, since it does not really contain files in the usual sense. Rather, it contains devices that are available to the system. In Linux (like Unix), devices are treated like files. You can read and write devices as though they were files. For example /dev/fd0 is the first floppy disk drive, /dev/sda (/dev/hda on older systems) is the first IDE hard drive. All the devices that the kernel understands are represented here. /proc The /proc directory is also special. This directory does not contain files. In fact, this directory does not really exist at all. It is entirely virtual. The /proc directory contains little peep holes into the kernel itself. There are a group of numbered entries in this directory that correspond to all the processes running on the system. In addition, there are a number of named entries that permit access to the current configuration of the system. Many of these entries can be viewed. Try viewing /proc/cpuinfo. This entry will tell you what the kernel thinks of your CPU. /media,/mnt Finally, we come to /media, a normal directory which is used in a special way. The /media directory is used for mount points. As we learned in the second lesson, the different physical storage devices (like hard disk drives) are attached to the file system tree in various places.This process of attaching a device to the tree is called mounting. For a device to be available, it must first be ed Linux distributions. On systems that require manual mounting of removable devices, the /mnt directory provides a convenient place for mounting these temporary devices. You will often see the directories /mnt/floppy and /mnt/cdrom. To see what devices and mount points are used, type mount. A weird kind of file... During your tour, you probably noticed a strange kind of directory entry, particularly in the /boot and /lib directories. When listed with ls -l, you would have seen something like this: lrwxrwxrwx 25 Jul 3 16:42 System.map -> /boot/System.map-2.0.36-3 -rw-r--r-- 105911 Oct 13 1998 System.map-2.0.36-0.7 -rw-r--r-- 105935 Dec 29 1998 System.map-2.0.36-3 -rw-r--r-- 181986 Dec 11 1999 initrd-2.0.36-0.7.img -rw-r--r-- 182001 Dec 11 1999 initrd-2.0.36.img lrwxrwxrwx 26 Jul 3 16:42 module-info -> /boot/module-info-2.0.36-3 -rw-r--r-- 11773 Oct 13 1998 module-info-2.0.36-0.7 -rw-r--r-- 11773 Dec 29 1998 module-info-2.0.36-3 lrwxrwxrwx 16 Dec 11 1999 vmlinuz -> vmlinuz-2.0.36-3 -rw-r--r-- 454325 Oct 13 1998 vmlinuz-2.0.36-0.7 -rw-r--r-- 454434 Dec 29 1998 vmlinuz-2.0.36-3 Notice the files, System.map, module-info and vmlinuz. See the strange notation after the file names? These three files are called symbolic links. Symbolic links are a special type of file that point to another file. With symbolic links, it is possible for a single file to have multiple names. Here's how it works: Whenever the system is given a file name that is a symbolic link, it transparently maps it to the file it is pointing to. Just what is this good for? This is a very handy feature. Let's consider the directory listing above (which is the /boot directory of an old Red Hat 5.2 system). This system has had multiple versions of the Linux kernel installed. We can see this from the files vmlinuz-2.0.36-0.7 and vmlinuz-2.0.36-3. These file names suggest that both version 2.0.36-0.7 and 2.0.36-3 are installed.e called wildcards. Wildcards allow you to select filenames based on patterns of characters. The table below lists the wildcards and what they select: Summary of wildcards and their meanings Wildcard => meaning " * " (A Star) => Matches any characters ? => Matches any single character [characters] => MatBecause the file names contain the version it is easy to see the differences in the directory listing. However, this would be confusing to programs that rely on a fixed name for the kernel file. These programs might expect the kernel to simply be called "vmlinuz". Here is where the beauty of the symbolic link comes in. By creating a symbolic link called vmlinuz that points to vmlinuz-2.0.36-3, we have solved the problem. To create symbolic links, use the ln command. Manipulating Files -------------------------- This lesson will introduce you to the following commands: :: cp - copy files and directories mv - move or rename files and directories rm - remove files and directories mkdir - create directories These four commands are among the most frequently used Linux commands. They are the basic commands for manipulating both files and directories. Now, to be frank, some of the tasks performed by these commands are more easily done with a graphical file manager. With a file manager, you can drag and drop a file from one directory to another, cut and paste files, delete files, etc. So why use these old command line programs? The answer is power and flexibility. While it is easy to perform simple file manipulations with a graphical file manager, complicated tasks can be easier with the command line programs. For example, how would you copy all the HTML files from one directory to another, but only copy files that did not exist in the destination directory or were newer than the versions in the destination directory? Pretty hard with with a file manager. Pretty easy with the command line: [sam@linuxbox sam]$ cp -u *.html destination Wildcards --------------- Before I begin with our commands, I want to talk about a shell feature that makes these commands so powerful. Since the shell uses filenames so much, it provides special characters to help you rapidly specify groups of filenames. These special characters a rches any character that is a member of the set characters. The set of characters may also be expressed as a POSIX character class such as one of the following: Posix Character Classes [:alnum:] Alphanumeric characters [:alpha:] Alphabetic characters [:digit:] Numerals [:upper:] Uppercase alphabetic characters [:lower:] Lowercase alphabetic characters [!characters] => Matches any character that is not a member of the set characters Using wildcards, it is possible to construct very sophisticated selection criteria for filenames. Here are some examples of patterns and what they match: Examples of wildcard matching Pattern => Matches * => All filenames g* => All filenames that begin with the character "g" b*.txt => All filenames that begin with the character "b" and end with the characters ".txt" Data??? => Any filename that begins with the characters "Data" followed by exactly 3 more characters [abc]* => Any filename that begins with "a" or "b" or "c" followed by any other characters [[:upper:]]* => Any filename that begins with an uppercase letter. This is an example of a character class. BACKUP.[[:digit:]][[:digit:]] => Another example of character classes. This pattern matches any filename that begins with the characters "BACKUP." followed by exactly two numerals. *[![:lower:]] => Any filename that does not end with a lowercase letter. You can use wildcards with any command that accepts filename arguments. cp => The cp program copies files and directories. In its simplest form, it copies a single file: --- [sam@linuxbox sam]$ cp file1 file2 It can also be used to copy multiple files to a different directory: [sam@linuxbox sam]$ cp file1 file2 file3 directory Other useful examples of cp and its options include: Examples of the cp command Command Results cp file1 file2 Copies the contents of file1 into file2. If file2 does not exist, it is created; otherwise, file2 is overwritten with the contents of file1. cp -i file1 file2 Like above however, since the "-i" (interactive) option is specified, if file2 exists, the user is prompted before it is overwritten with the contents of file1. cp file1 dir1 Copy the contents of file1 (into a file named file1) inside of directory dir1.ubstitute rm focp -R dir1 dir2 Copy the contents of the directory dir1. If directory dir2 does not exist, it is created. Otherwise, it creates a directory named dir1 within directory dir2. mv = > The mv command performs two different functions depending on how it is used. It will either move one or more files to a different directory, or it will ---- rename a file or directory. To rename a file, it is used like this: [sam@linuxbox sam]$ mv filename1 filename2 To move files to a different directory: [sam@linuxbox sam]$ mv file1 file2 file3 directory Examples of mv and its options include: Examples of the mv command Command Results mv file1 file2 => If file2 does not exist, then file1 is renamed file2. If file2 exists, its contents are replaced with the contents of file1. mv -i file1 file2 Like above however, since the "-i" (interactive) option is specified, if file2 exists, the user is prompted before it is overwritten with the contents of file1. mv file1 file2 file3 dir1 The files file1, file2, file3 are moved to directory dir1. dir1 must exist or mv will exit with an error. mv dir1 dir2 If dir2 does not exist, then dir1 is renamed dir2. If dir2 exists, the directory dir1 is created within directory dir2. rm => The rm command deletes (removes) files and directories. ---- [sam@linuxbox sam]$ rm file It can also be used to delete a directory: [sam@linuxbox sam]$ rm -r directory Examples of rm and its options include: Examples of the rm command Command Results rm file1 file2 Delete file1 and file2. rm -i file1 file2 Like above however, since the "-i" (interactive) option is specified, the user is prompted before each file is deleted. rm -r dir1 dir2 Directories dir1 and dir2 are deleted along with all of their contents. Be careful with rm! Linux does not have an undelete command. Once you delete a file with rm, it's gone. You can inflict terrific damage on your system with rm if you are not careful, particularly with wildcards. Before you use rm with wildcards, try this helpful trick: construct your command using ls instead. By doing this, you can see the effect of your wildcards before you delete files. After you have tested your command with ls, recall the command with the up-arrow key and then sr ls in the command. mkdir => The mkdir command is used to create directories. To use it, you simply type: -------- [sam@linuxbox sam]$ mkdir directory I/O Redirection -------------------- In this lesson, we will explore a powerful feature used by many command line programs called input/output redirection. As we have seen, many commands such as ls print their output on the display. This does not have to be the case, however. By using some special notation we can redirect the output of many commands to files, devices, and even to the input of other commands. => Standard Output Most command line programs that display their results do so by sending their results to a facility called standard output. By default, standard output directs its contents to the display. To redirect standard output to a file, the ">" character is used like this: [sam@linuxbox sam]$ ls > file_list.txt In this example, the ls command is executed and the results are written in a file named file_list.txt. Since the output of ls was redirected to the file, no results appear on the display. Each time the command above is repeated, file_list.txt is overwritten (from the beginning) with the output of the command ls. If you want the new results to be appended to the file instead, use ">>" like this: [sam@linuxbox sam]$ ls >> file_list.txt When the results are appended, the new results are added to the end of the file, thus making the file longer each time the command is repeated. If the file does not exist when you attempt to append the redirected output, the file will be created. => Standard Input Many commands can accept input from a facility called standard input. By default, standard input gets its contents from the keyboard, but like standard output, it can be redirected. To redirect standard input from a file instead of the keyboard, the "<" character is used like this: [sam@linuxbox sam]$ sort < file_list.txt In the above example we used the sort command to process the contents of file_list.txt. The results are output on the display since the standard output is not redirected in this example. We could redirect standard output to another file like this: [sam@linuxbox sam]$ sort < file_list.txt > sorted_file_list.txt. head => Outputs the first few lines of its input. Useful for getting the header of a file. tail => Outputs the last few lines of its input. Useful for things like getting the most recent entries from a log file. tr => Translates characters. Can be used to perform taAs you can see, a command can have both its input and output redirected. Be aware that the order of the redirection does not matter. The only requirement is that the redirection operators (the "<" and ">") must appear after the other options and arguments in the command. => Pipes By far, the most useful and powerful thing you can do with I/O redirection is to connect multiple commands together with what are called pipes. With pipes, the standard output of one command is fed into the standard input of another. Here is my absolute favorite: [sam@linuxbox sam]$ ls -l | less In this example, the output of the ls command is fed into less. By using this "| less" trick, you can make any command have scrolling output. I use this technique all the time. By connecting commands together, you can acomplish amazing feats. Here are some examples you'll want to try: Command => What it does [sam@linuxbox sam]$ ls -lt | head => Displays the 10 newest files in the current directory. [sam@linuxbox sam]$ du | sort -nr => Displays a list of directories and how much space they consume, sorted from the largest to the smallest. [sam@linuxbox sam]$ find . -type f -print | wc -l => Displays the total number of files in the current working directory and all of its subdirectories. Filters --------- One class of programs you can use with pipes is called filters. Filters take standard input and perform an operation upon it and send the results to standard output. In this way, they can be used to process information in powerful ways. Here are some of the common programs that can act as filters: Common filter commands Program What it does sort => Sorts standard input then outputs the sorted result on standard output. uniq => Given a sorted stream of data from standard input, it removes duplicate lines of data (i.e., it makes sure that every line is unique). grep => Examines each line of data it receives from standard input and outputs every line that contains a specified pattern of characters. fmt => Reads text from standard input, then outputs formatted text on standard output. pr => Takes text input from standard input and splits the data into pages with page breaks, headers and footers in preparation for printin gsks such as upper/lowercase conversions or changing line termination characters from one type to another (for example, converting DOS text files into Unix style text files). sed => Stream editor. Can perform more sophisticated text translations than tr. awk => An entire programming language designed for constructing filters. Extremely powerful. => Performing tasks with pipes Printing from the command line. Linux provides a program called lpr that accepts standard input and sends it to the printer. It is often used with pipes and filters. Here are a couple of examples: [sam@linuxbox sam]$ cat poorly_formatted_report.txt | fmt | pr | lpr [sam@linuxbox sam]$ cat unsorted_list_with_dupes.txt | sort | uniq | pr | lpr In the first example, we use cat to read the file and output it to standard output, which is piped into the standard input of fmt. fmt formats the text into neat paragraphs and outputs it to standard output, which is piped into the standard input of pr. pr splits the text neatly into pages and outputs it to standard output, which is piped into the standard input of lpr. lpr takes its standard input and sends it to the printer. The second example starts with an unsorted list of data with duplicate entries. First, cat sends the list into sort which sorts it and feeds it into uniq which removes any duplicates. Next pr and lpr are used to paginate and print the list. Viewing the contents of tar files Often you will see software distributed as a gzipped tar file. This is a traditional Unix style tape archive file (created with tar) that has been compressed with gzip. You can recognize these files by their traditional file extensions, ".tar.gz" or ".tgz". You can use the following command to view the directory of such a file on a Linux system: [sam@linuxbox sam]$ tar tzvf name_of_file.tar.gz | less Manually Mount and Unmount a device ------------------------------------------------------ To manually mount a device: #mount /dev/hda replace /dev/hda with the location of the device. To manually unmount a device: #umount /dev/hda replace /dev/hda with the location of the device. Permissions ----------------- The Unix operating system (and likewise, Linux) differs from other computing environments in that it is not only a multitasking system but it is also a multi-user system as well.can read this file Let's try another example. We will look at the bash program which is located in the /bin directory: [sam@linuxbox sam]$ ls -l /bin/bash -rwxr-xr-x 1 root root 316848 Feb 27 2000 /bin/bash Here we can see: The file "/bin/bash" is owned by user "root" The superuser has the right to read, write, and execute this file The file is owned by the group "root" Members of the group "root" can also read and execute this file Everybody else can read and execute this file In the diagram below, we seWhat exactly does this mean? It means that more than one user can be operating the computer at the same time. While your computer will only have one keyboard and monitor, it can still be used by more than one user. For example, if your computer is attached to a network, or the Internet, remote users can log in via telnet or ssh (secure shell) and operate the computer. In fact, remote users can execute X applications and have the graphical output displayed on a remote computer. The X Windows system supports this. The multi-user capability of Unix is not a recent "innovation," but rather a feature that is deeply ingrained into the design of the operating system. If you remember the environment in which Unix was created, this makes perfect sense. Years ago before computers were "personal," they were large, expensive, and centralized. A typical university computer system consisted of a large mainframe computer located in some building on campus and terminals were located throughout the campus, each connected to the large central computer. The computer would support many users at the same time. In order to make this practical, a method had to be devised to protect the users from each other. After all, you could not allow the actions of one user to crash the computer, nor could you allow one user to interfere with the files belonging to another user. This lesson will cover the following commands: :: chmod - modify file access rights su - temporarily become the superuser chown - change file ownership chgrp - change a file's group ownership File permissions Linux uses the same permissions scheme as Unix. Each file and directory on your system is assigned access rights for the owner of the file, the members of a group of related users, and everybody else. Rights can be assigned to read a file, to write a file, and to execute a file (i.e., run the file as a program). To see the permission settings for a file, we can use the ls command as follows: [sam@linuxbox sam]$ ls -l some_file -rw-rw-r-- 1 sam sam 1097374 Sep 26 18:48 some_file We can determine a lot from examining the results of this command: The file "some_file" is owned by user "sam" User "sam" has the right to read and write this file The file is owned by the group "sam" Members of the group "sam" can also read and write this file Everybody els ee how the first portion of the listing is interpreted. It consists of a character indicating the file type, followed by three sets of three characters that convey the reading, writing and execution permission for the owner, group, and everybody else. chmod => The chmod command is used to change the permissions of a file or directory. To use it, you specify the desired permission settings and the file or files that you wish to modify. There are two ways to specify the permissions, but I am only going to teach one way. It is easy to think of the permission settings as a series of bits (which is how the computer thinks about them). Here's how it works: rwx rwx rwx = 111 111 111 rw- rw- rw- = 110 110 110 rwx --- --- = 111 000 000 and so on... rwx = 111 in binary = 7 rw- = 110 in binary = 6 r-x = 101 in binary = 5 r-- = 100 in binary = 4 Concept of 7 2 1 R W X R=READ => W=WRITE => X=EXECUTE Now, if you represent each of the three sets of permissions (owner, group, and other) as a single digit, you have a pretty convenient way of expressing the possible permissions settings. For example, if we wanted to set some_file to have read and write permission for the owner, but wanted to keep the file private from others, we would: [sam@linuxbox sam]$ chmod 600 some_file Here is a table of numbers that covers all the common settings. The ones beginning with "7" are used with programs (since they enable execution) and the rest are for other kinds of files. => File permissions Value => Meaning 777 => (rwxrwxrwx) No restrictions on permissions. Anybody may do anything. Generally not a desirable setting. 755 => (rwxr-xr-x) The file's owner may read, write, and execute the file. All others may read and execute the file. This setting is common for programs that are used by all users. 700 => (rwx------) The file's owner may read, write, and execute the file. Nobody else has any rights. This setting is useful for programs that only the owner may use and must be kept private from others. 666 => (rw-rw-rw-) All users may read and write the file. 644 => (rw-r--r--) The owner may read and write a file, while all others may only read the file. A common setting for data files that everybody may read, but only the owner may change. 600 => (rw-------) The owner may read and write a file. All others have no rights. A common setting for data files that the owner wants to keep private. => Directory permissions The chmod command can also be used to control the access permissions for directories. In most ways, the permissions scheme for directories works the same way as they do with files. However, the execution permission is used in a different way. It provides control for access to file listing and other things. Here are some useful settings for directories: Value Meaningrol In the previous lesson, we looked at some of the implications of Linux being a multi-user operating system. In this lesson, we will examine the multitasking nature of Linux,777 => (rwxrwxrwx) No restrictions on permissions. Anybody may list files, create new files in the directory and delete files in the directory. Generally not a good setting. 755 =>(rwxr-xr-x) The directory owner has full access. All others may list the directory, but cannot create files nor delete them. This setting is common for directories that you wish to share with other users. 700 => (rwx------) The directory owner has full access. Nobody else has any rights. This setting is useful for directories that only the owner may use and must be kept private from others. Becoming the superuser for a short while It is often useful to become the superuser to perform important system administration tasks, but as you have been warned (and not just by sam!), you should not stay logged on as the superuser. In most distributions, there is a program that can give you temporary access to the superuser's privileges. This program is called su (short for substitute user) and can be used in those cases when you need to be the superuser for a small number of tasks. To become the superuser, simply type the su command. You will be prompted for the superuser's password: [sam@linuxbox sam]$ su Password: [root@linuxbox sam]# After executing the su command, you have a new shell session as the superuser. To exit the superuser session, type exit and you will return to your previous session. In some distributions, most notably Ubuntu, an alternate method is used. Rather than using su, these systems employ the sudo command instead. With sudo, one or more users are granted superuser privileges on an as needed basis. To execute a command as the superuser, the desired command is simply preceeded with the sudo command. After the command is entered, the user is prompted for the user's password rather than the superuser's: [sam@linuxbox sam]$ sudo some_command Password: [sam@linuxbox sam]$ => Changing file ownership You can change the owner of a file by using the chown command. Here's an example: Suppose I wanted to change the owner of some_file from "sam" to "you". I could: [sam@linuxbox sam]$ su Password: [root@linuxbox sam]# chown you some_file [root@linuxbox sam]# exit [sam@linuxbox sam]$ Notice that in order to change the owner of a file, you must be the superuser. To do this, our example employed the su command, then we executed chown, and finally we typed exit to return to our previous session. chown works the same way on directories as it does on files. => Changing group ownership The group ownership of a file or directory may be changed with chgrp. This command is used like this: [sam@linuxbox sam]$ chgrp new_group some_file In the example above, we changed the group ownership of some_file from its previous group to "new_group". You must be the owner of the file or directory to perform a chgrp. ob Con tand how this is manipulated with the command line interface. As with any multitasking operating system, Linux executes multiple, simultaneous processes. Well, they appear simultaneous, anyway. Actually, a single processor computer can only execute one process at time but the Linux kernel manages to give each process its turn at the processor and each appears to be running at the same time. There are several commands that can be used to control processes. They are: ps - list the processes running on the system kill - send a signal to one or more processes (usually to "kill" a process) jobs - an alternate way of listing your own processes bg - put a process in the background fg - put a process in the forground A practical example While it may seem that this subject is rather obscure, it can be very practical for the average user who mostly works with the graphical user interface. You might not know this, but most (if not all) of the graphical programs can be launched from the command line. Here's an example: there is a small program supplied with the X Windows system called xload which displays a graph representing system load. You can excute this program by typing the following: [sam@linuxbox sam]$ xload Notice that the small xload window appears and begins to display the system load graph. Notice also that your prompt did not reappear after the program launched. The shell is waiting for the program to finish before control returns to you. If you close the xload window, the xload program terminates and the prompt returns. Putting a program in the background Now, in order to make life a little easier, we are going to launch the xload program again, but this time we will put it in the background so that the prompt will return. To do this, we execute xload like this: [sam@linuxbox sam]$ xload & [1] 1223 [sam@linuxbox sam]$ In this case, the prompt returned because the process was put in the background. Now imagine that you forgot to use the "&" symbol to put the program into the background. There is still hope. You can type control-z and the process will be suspended. The process still exists, but is idle. To resume the process in the background, type the bg command (short for background). Here is an example: [sam@linuxbox sam]$ xload [2]+ Stopped xload [sam@linuxbox sam]$ bg [2]+ xload & Listing your processes Now that we have a process in the background, it would be helpful to display a list of the processes we have launched. To do this, we can use either the jobs command or the more powerful ps command. [sam@linuxbox sam]$ jobs [1]+ Running xload & [sam@linuxbox sam]$ ps PID TTY TIME CMD 1211 pts/4 00:00:00 bash 1246 pts/4 00:00:00 xload 1247 pts/4 00:00:00 ps [sam@linuxbox sam]$ Killing a processthat PID. If the process refuses to terminate (i.e., it is ignoring the signal), send increasingly harsh signals until it does terminate. :: [sam@linuxbox sam]$ ps x PID TTY STAT TIME COMMAND 2931 pts/5 SN 0:00 netscape [sam@linuxbox sam]$ kill -SIGTERM 2931 [sam@linuxbox sam]$ kill -SIGKILL 2931 In the example above I used the kill command in the formal way. In actual practice, it is more commSuppose that you have a program that becomes unresponsive (hmmm...Netscape comes to mind ;-); how do you get rid of it? You use the kill command, of course. Let's try this out on xload. First, you need to identify the process you want to kill. You can use either jobs or ps, to do this. If you use jobs you will get back a job number. With ps, you are given a process id (PID). We will do it both ways: [sam@linuxbox sam]$ xload & [1] 1292 [sam@linuxbox sam]$ jobs [1]+ Running xload & [sam@linuxbox sam]$ kill %1 [sam@linuxbox sam]$ xload & [2] 1293 [1] Terminated xload [sam@linuxbox sam]$ ps PID TTY TIME CMD 1280 pts/5 00:00:00 bash 1293 pts/5 00:00:00 xload 1294 pts/5 00:00:00 ps [sam@linuxbox sam]$ kill 1293 [2]+ Terminated xload [sam@linuxbox sam]$ A little more about kill While the kill command is used to "kill" processes, its real purpose is to send signals to processes. Most of the time the signal is intended to tell the process to go away, but there is more to it than that. Programs (if they are properly written) listen for signals from the operating system and respond to them, most often to allow some graceful method of terminating. For example, a text editor might listen for any signal that indicates that the user is logging off, or that the computer is shutting down. When it receives this signal, it saves the work in progress before it exits. The kill command can send a variety of signals to processes. Typing: kill -l will give you a list of the signals it supports. Most are rather obscure, but several are useful to know: Signal # => Name => Description 1 => SIGHUP => Hang up signal. Programs can listen for this signal and act (or not act) upon it. 2 => SIGINT => Interrupt signal. This signal is given to processes to interrupt them. Programs can process this signal and act upon it. You can also issue this signal directly by typing control-c in the terminal window where the program is running. 15 => SIGTERM => Termination signal. This signal is given to processes to terminate them. Again, programs can process this signal and act upon it. You can also issue this signal directly by typing control-c in the terminal window where the program is running. This is the default signal sent by the kill command if no signal is specified. 9 => SIGKILL => Kill signal. This signal causes the immediate termination of the process by the Linux kernel. Programs cannot listen for this signal. Now let's suppose that you have a program that is hopelessly hung (Netscape, maybe) and you want to get rid of it. Here's what you do: Use the ps command to get the process id (PID) of the process you want to terminate. Issue a kill command for on to do it in the following way since the default signal sent by kill is SIGTERM and kill can also use the signal number instead of the signal name: [sam@linuxbox sam]$ kill 2931 Then, if the process does not terminate, force it with the SIGKILL signal: [sam@linuxbox sam]$ kill -9 2931 That's it! This concludes the "Learning the shell" series of lessons. In the next series, "Writing shell scripts," we will look at how to automate tasks with the shell. Ref : http://sourceforge.net/projects/linuxcommand/files/TLCL/09.12/TLCL-09.12.pdf/download http://ncu.dl.sourceforge.net/project/linuxcommand/TLCL/09.12/TLCL-09.12.pdf Applications/Databases ------------------------------------- Command => Description => Package mysqlaccess => client for checking access privileges =>mysql mysqladmin =>client for administering a MySQL server => mysql mysqldump =>a database backup program =>mysql mysqlshow => display database, table, and column information => mysql mysql => the MySQL command-line tool => mysql msql2mysql => convert mSQL programs for use with MySQL =>mysql-server myisamchk => MyISAM table-maintenance utility isamchk =>mysql-server myisamlog =>display contents of MyISAM log file isamlog =>mysql-server myisampack =>generate compressed, read-only MyISAM tables pack_isam =>mysql-server mysqlbinlog => utility for processing binary log files => mysql-server mysqlcheck => a table maintenance and repair program => mysql-server mysqld =>the MySQL server =>mysql-server mysqlhotcopy =>a database backup program =>mysql-server mysqlimport =>a data import program =>mysql-server mysqlman =>default man page for mysql =>mysql-server perror =>explain error codes => mysql-server replace =>a string-replacement utility =>mysql-server clusterdb =>cluster a PostgreSQL database =>postgresql createdb =>create a new PostgreSQL database => postgresql createlang => define a new PostgreSQL procedural language =>postgresql createuser =>define a new PostgreSQL user account =>postgresql dropdb =>remove a PostgreSQL database =>postgresql droplang => remove a PostgreSQL procedural language =>postgresql dropuser =>remove a PostgreSQL user account =>postgresql psql =>PostgreSQL interactive terminal =>postgresql initdb =>create a new PostgreSQL database cluster =>postgresql-server ipcclean =>remove shared memory and semaphores from =>postgresql-server a failed PostgreSQL server postgres => run a PostgreSQL server in single-user mode => postgresql-server postmaster => PostgreSQL multiuser database server => postgresql-server vacuumdb =>garbage-collect and analyze a PostgreSQL database => postgresql sqlite3 =>A command line interface for SQLite verson 3 => sqlite MySQL ------/root /boot /opt" # Where to backup to. dest="/mnt/backup" # Create archive filename. day=$(date +%A) hostname=$(hostname -s) archive_file="$hostname-$day.tgz" # Print start status message. echoMySQL is a fast, multi-threaded, multi-user, and robust SQL database server. It is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. Installation Mysql --------------------------------------- To install MySQL, run the following command from a terminal prompt: #sudo apt-get install mysql-server During the installation process you will be prompted to enter a password for the MySQL root user. Once the installation is complete, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running: # sudo netstat -tap | grep mysql When you run this command, you should see the following line or something similar: tcp 0 0 localhost:mysql *:* LISTEN 2556/mysqld If the server is not running correctly, you can type the following command to start it: # sudo /etc/init.d/mysql restart Configuration of mysql --------------------------------------------- You can edit the /etc/mysql/my.cnf file to configure the basic settings -- log file, port number, etc. For example, to configure MySQL to listen for connections from network hosts, change the bind-address directive to the server's IP address: bind-address = 192.168.0.5 Replace 192.168.0.5 with the appropriate address. After making a change to /etc/mysql/my.cnf the mysql daemon will need to be restarted: # sudo /etc/init.d/mysql restart If you would like to change the MySQL root password, in a terminal enter: # sudo dpkg-reconfigure mysql-server-5.1 The mysql daemon will be stopped, and you will be prompted to enter a new password. Resources See the MySQL Home Page for more information. The MySQL Handbook is also available in the mysql-doc-5.0 package. To install the package enter the following in a terminal: # sudo apt-get install mysql-doc-5.0 Shell Scripts for Backup ---------------------------- One of the simplest ways to backup a system is using a shell script. For example, a script can be used to configure which directories to backup, and use those directories as arguments to the tar utility creating an archive file. The archive file can then be moved or copied to another location. The archive can also be created on a remote file system such as an NFS mount. The tar utility creates one archive file out of many files or directories. tar can also filter the files through compression utilities reducing the size of the archive file. Simple Shell Script The following shell script uses tar to create an archive file on a remotely mounted NFS file system. The archive filename is determined using additional command line utilities. # sudo gedit backup.sh ##############START################################ #!/bin/sh #################################### # # Backup to NFS mount script. # #################################### # What to backup. backup_files="/home /var/spool/mail /etc "Backing up $backup_files to $dest/$archive_file" date echo # Backup the files using tar. tar czf $dest/$archive_file $backup_files # Print end status message. echo echo "Backup finished" date # Long listing of files in $dest to check file sizes. ls -lh $dest ##################Finish########################## Where $backup_files: a variable listing which directories you would like to backup. The list should be customized to fit your needs. $day: a variable holding the day of the week (Monday, Tuesday, Wednesday, etc). This is used to create an archive file for each day of the week, giving a backup history of seven days. There are other ways to accomplish this including other ways using the date utility. $hostname: variable containing the short hostname of the system. Using the hostname in the archive filename gives you the option of placing daily archive files from multiple systems in the same directory. $archive_file: the full archive filename. $dest: destination of the archive file. The directory needs to be created and in this case mounted before executing the backup script. See the section called â€Ĺ“Network File System (NFS)†for details using NFS. status messages: optional messages printed to the console using the echo utility. tar czf $dest/$archive_file $backup_files: the tar command used to create the archive file. c: creates an archive. z: filter the archive through the gzip utility compressing the archive. f: use archive file. Otherwise the tar output will be sent to STDOUT. ls -lh $dest: optional statement prints a -l long listing in -h human readable format of the destination directory. This is useful for a quick file size check of the archive file. This check should not replace testing the archive file. This is a simple example of a backup shell script. There are large amount of options that can be included in a backup script. See the section called â€Ĺ“References†for links to resources providing more in depth shell scripting information. Executing the Script Executing from a Terminal The simplest way of executing the above backup script is to copy and paste the contents into a file. backup.sh for example. Then from a terminal prompt: #sudo bash backup.sh This is a great way to test the script to make sure everything works as expected. Executing with cron job ----------------------------------------- The cron utility can be used to automate the script execution. The cron daemon allows the execution of scripts, or commands, at a specified time and date. cron is configured through entries in a crontab file. crontab files are separated into fields: # m h dom mon dow command m: minute the command executes on between 0 and 59. h: hour the command executes on between 0 and 23. dom: day of month the command executes on. mon: the month the command executes on between 1 and 12. dow: the day of the week the command executes on between 0 and 7. Sunday may be specified by using 0 or 7, both values are valid. command: the command to execute.To add or change entries in a crontab file the crontab -e command should be used. Also, the contents of a crontab file can be viewed using the crontab -l command. To execute the backup.sh script listed above using cron. Enter the following from a terminal prompt: # sudo crontab -ehe backup.sh script will now be executed every day at 12:00 am.Tbackup.sh script will need to be copied to the /usr/local/bin/ directory in order for this entry to execute properly. The script can reside anywhere on the file system simply change the script path appropriately. FoThe r more in depth crontab options see the section called â€Ĺ“Referencesâ€. Restoring from the Backup Archive -----------------------------------is to restore a file from the archive. To see a listing of the archive contents. From a terminal prompt: #tar -tzvf /mnt/backup/host-Monday.tgz To restore a file from the archive toOnce an archive has been created it is important to test the archive. The archive can be tested by listing the files it contains, but the best tes ta different directory enter: #tar -xzvf /mnt/backup/host-Monday.tgz -C /tmp etc/hosts The -C option to tar redirects the extracted files to the specified directory. The above example will extract the /etc/hosts file to /tmp/etc/hosts. tar recreates the directory structure that it contains.this guide but not to sell it or any derivative of it. Copyright of theAlso, notice the leading "/" is left off the path of the file to restore. To restore all files in the archive enter the following: #cd / #sudo tar -xzvf /mnt/backup/host-Monday.tgz General Notes FOR UBUNTU ------------------------------------- This is the Ubuntuguide. You are free to cop ynames Ubuntuguide and Ubuntu Guide reside solely with this site. This Ubuntu help guide is neither sold nor distributed in any other medium. Beware of copies that are for sale or are similarly named; they are neither endorsed nor sanctioned by this guide. Ubuntuguide is not associated with Canonical Ltd nor with any commercial enterprise.ne Terminal. Many changes to the operating system can only be done by a User with Administrative privileges. 'sudo' elevates a User's privileges to theUbuntu allows a user to accomplish tasks from either a menu-driven Graphical User Interface (GUI) or from a text-based command-line interface (CLI). In Ubuntu, the command-line-interface terminal is called Terminal, which is started: Menu -> File -> Open Terminal Text inside the grey dotted box like this should be put into the command-l i Administrator level temporarily (i.e. when installing programs or making changes to the system). Example: sudo bash => 'gksudo' can be used instead of 'sudo' when opening a Graphical Application through the "Run Command" dialog box or as a menu item. Example: # gksudo gedit /etc/apt/sources.listample, "man sudo" will display the manual page for the "sudo" command: # man sudo While "apt-get" and "aptitude" are fast ways of installing programs/packages, you can also use the Synaptic PackaMany file management tasks can be accomplished with root Administrative privileges by starting the Nautilus file manager in a similar fashion. (Use 'gksudo' if starting Nautilus from a menu item.) # gksudo nautilus or # sudo nautilus "man" command can be used to find help manual for a command. For e xge Manager, a GUI method for installing programs/packages. Most (but not all) programs/packages available with apt-get install will also be available from the Synaptic Package Manager. In this guide, when you see # sudo apt-get install package you can search for package in Synaptic and install it that way. Many instructions use the text editor "nano" (which is universally available in Linux). However, it is often easier to use the text editor "gedit" in Ubuntu instead.as a six month release cycle, with releases in April and October. Precise Pangolin (12.04 LTS) will be released in April 2012 and will be a Long Term Su"Menu" refers to the menu bar at the top (or bottom) of the desktop, akin to the Start menu in Microsoft Windows or the Menu bar of the Apple Macintosh. If you are using the 64-bit version, replace any "i386" with "amd64" Other versions => How to find out which version of Ubuntu you're using Open the command terminal and type: #lsb_release -a How to find out which kernel you are using # uname -a Newer Versions of Ubuntu ------------------------------------ Ubuntu hpport version Older Versions of Ubuntu ---------------------------------- Natty Narwhal (11.04) (supported until October 2012) Maverick Meerkat (10.10) (supported until April 2012) Lucid Lynx (10.04) (Long Term Support version with desktop support until April 2013 and server support until April 2015) Karmic Koala (9.10) (no longer supported) Jaunty Jackalope (9.04) (no longer supported) Hardy Heron (8.04 LTS) (Long Term Support version with desktop support until April 2011 and server support until April 2013) Dapper Drake (6.06 LTS) (no longer supported) Dual-Booting Windows and Ubuntutu or further manipulating the partitions. This all--------------------------------------------------- A user may experience problems dual-booting Ubuntu and Windows. In general, a Windows OS should be installed first, because its bootloader is very particular. A default Windows installation usually occupies the entire hard drive, so the main Windows partition needs to be shrunk, creating free space for the Ubuntu partitions. (You should clean up unnecessary files and defragment the drive before resizing.) See changing the Windows partition size. After shrinking a Windows partition, you should reboot once into Windows prior to installing Ubu nows the Windows system to automatically rescan the newly-resized partition (using chkdsk in XP or other utilities in more recent versions of Windows) and write changes to its own bootup files. (If you forget to do this, you may later have to repair the Windows partition bootup files manually using the Windows Recovery Console.)extended partition. Some computer retailers use all four partitions on a hard drive. Unless there are two free partitions available (either primary or logical) in which to install Ubuntu, however, it will appear as if there is no available free space. If only one partition on a hard drive can be made available, it must be used as an extended partition (in which multiple logical partitions can then be created). Partition management can be done using the GParted utility. If there are only two existing primary partitions on a hard drive (and plenty of free space on it) then there will be no problem installing Ubuntu as the second operating system and it is done automatically from the Ubuntu LiveCD. Allow the Ubuntu LiveCD to install to "largest available free space." Alternatively, if there is anNewer installations of Windows use two primary partitions (a small Windows boot partition and a large Windows OS partition). An Ubuntu Linux installation also requires two partitions -- a linux-swap partition and the OS partition. The Linux partitions can either be two primary partitions or can be two logical partitions within an extended partition with plenty of free space within it, the Ubuntu LiveCD will install to this "largest available free space" as well. The main Windows partition should be at least 20 Gb (recommended 30 Gb for Vista/Windows 7), and a Ubuntu partition at least 10 Gb (recommended 20 Gb). Obviously, if you have plenty of disk space, make the partition for whichever will be your favoured operating system larger. For a recommended partitioning scheme, see this section.GRUB back to the MBR. (This is necessary because Windows overwrites the MBR and designates its own bootloader as the master bootloader.) Once GRUB is installed you will be able to boot either OS. Alternatives include: Wubi (Windows-based Ubuntu Installer), an officially supported dual-boot installer that allows Ubuntu to be run mounted in a virtual-disk within the Windows ------- environment (which can cause a slight degradation in performance). Because the installation requires an intact functioning Windows system, it is recommended to install Ubuntu in this manner for short-term evaluation purposes only. A permanent Ubuntu installation should be installedConversely you can install a retail version of Windows (but not an OEM or recovery version) after Ubuntu by creating a primary NTFS partition using GParted. (You may have to use GPparted from a Live CD/USB). Once the primary NTFS partition is created you can boot your Windows CD/DVD and choose to install Windows to that NTFS partition. When installation is complete, reboot to insure Windows boots properly. Once that is ascertained, use the Ubuntu Live CD/USB to instal lin its own partition, with its own filesystem, and should not rely on Windows. EasyBCD, a free Windows-based program that allows you to dual-boot Windows 7/Vista and Ubuntu (as well as other operating systems) by configuring the Windows 7/Vista bootloader. Installing multiple OS on a single computer ----------------------------------------------------------- Warning: During installation, there is an advanced option (Ready to install -> Advanced) to install the GRUB2 bootloader into the same partition into which the (K)Ubuntu OS is installed but not to change the MBR (Master Boot Record). Pay careful attention during this step if your system uses a boot partition, uses multiple OS (more than 2), or chainloads bootloaders. For systems with such a boot partition, it is best not to overwrite the MBR. Example, from the Desktop version GUI installer, a point in the installation will be reached: Summary -> Advanced -> Device for boot loader installation: /dev/sda6r, a GUI that is able to manage settings for Grub (Grub Legacy), Grub 2, Usplash, and Splashy. Also see the Ubuntu Community help page for Startup Manager usage instructions. Install: #sudo apt-get install startupmanager menu Run: Menu -> System -> Administration -> Startup Manager Note: You can also edit the Grub settings manually from the command-line interface. Dual-Booting Mac OS X and Ubuntu ------------------------------------------------- Also see these tips for installing multiple OS. Mac OS X has a similar structure to Linux (it is BSD Unix based). Dual-booting Mac OS X and Ubuntu detailed instructions can be fIn this example, this setting will cause the GRUB2 bootloader to be installed into /dev/sda6 only (the partition into which the new (K)Ubuntu OS is being installed). The MBR (Master Boot Record) will not be changed. However, if the default setting of /dev/sda is allowed, then GRUB2 will not only be installed into partition dev/sda6 (into which the (K)Ubuntu OS is installed) but also the MBR (MasterBootRecord) will be changed so that the copy of GRUB2 stored there will be designated as the master bootloader for all Operating Systems on the entire computer. This may be undesirable if you wish to use bootloaders other than GRUB2. If you want to install more than 2 operating systems on a single computer, check out these tips. Also see these tips regarding manipulating partitions. Use Startup Manager to change Grub settings Grub is a bootup utility that controls which OS to load by default and other bootup settings. You can change Grub settings from Startup Manag eound here. Installing Mac OS X after Ubuntu If you decide to dual boot with OS X, choose ext2 as your partition type during the Ubuntu installation. (For this the Super Grub Disk CD is a useful utility. You can download the Super Grub .iso image file at forjamari.linex.org and burn the image to a CD-ROM.) Once you have installed Ubuntu, edit the Grub start-up list: # sudo nano /boot/grub/menu.lst and add the following lines: :: title Mac OS X root (hd0,0) makeactive chainloader +1 Reboot your Mac and go to the terminal in Max OS X (if you have any issues booting, boot from your Mac OS X DVD). Press F8 and enter -s. Enter: fdisk -e /dev/rdisk0 flag 2 <--note that flag 2 is my Mac partition number two quit y reboot If are still unsure whether it is working correctly, use the Super Grub Disk CD and make grub active. Installing Ubuntu after Mac OS X If you get an error message during boot such as HFS+error in the bootloader, you can also use the Super Grub Disk for recovering Linux GRUB and the Windows MBR (Master Boot Record). Once you have installed Ubuntu, edit the Grub start-up list: # sudo nano /boot/grub/menu.lst and add the following lines: title Mac OS X root (hd0,0) makeactive chainloader +1 If you have issues with Mac OSX or Windows in GRUB, try changing the Mac OS X Grub entry change root (hd0,0) to root (hd0,1) This means you will boot into partition number 1. You can try any partition number until you get it right. Upgrading to Oneiric Also see the official Ubuntu desktop upgrade documentation.cies, and compatibilities change between version of Ubuntu, so this method does not always work. Automated updates remains the recommended method. AlternativelyThere are several methods for upgrades from the command-line interface (Terminal) (which can be used for both the desktop and server editions of Ubuntu/Kubuntu). This is the preferred method: sudo apt-get install update-manager-core sudo do-release-upgrade => You can also use the update-manager (all editions): # sudo apt-get install update-manager # sudo update-manager -d You can also use: # sudo apt-get update # sudo apt-get upgrade # sudo apt-get dist-upgrade (Note: the first two lines simply make sure your current distribution is current before upgrading the entire distribution, and are optional. Reinstalling applications after a fresh installation If you upgrade your Ubuntu system with a fresh installation, it is possible to mark the packages and services installed on your old system (prior to the upgrade) and save the settings ("markings") into a file. Then install the new version of Ubuntu and allow the system to reinstall packages and services using the settings saved in the "markings" file. For instructions, see this Ubuntu forum thread. In brief: On the old system: Synaptic Package Manager -> File -> Save Markings Save the markings file to an external medium, such as a USB drive. Complete the backup of your system's other important files (e.g. the /home directory) before the installation of the new system. In the freshly-installed new system: Synaptic Package Manager -> File -> Read markings and load the file on your USB drive (or other external storage) previously saved. Note: Many packages, depende nyou can use this command-line method. => Prior to the clean installation. run: #dpkg --get-selections > ~/my-packages This creates a my-packages file in the ~ (home) directory which will contain a list of the packages installed on the old system. Copy this file to a safe place (as you will need it after the new installation). Proceed with the clean installation. Enable the same repositories that were enabled in the old system. Now copy the my-packages file to the ~ (/home) folder. Run: # sudo dpkg --set-selections < my-packages && sudo apt-get dselect-upgrade Any packages that you had installed (that are in the new repositories) will now be installed. Excluded will be any manually-installed packages (that are not in the new repositories) and any packages that were compiled from source. Here are some of the steps I have sometimes needed to take when performing upgrades. Add Extra Repositories Software packages and programs are freely available for download at multiple online sites with standardized structures, called repositories. There are repositories officially sanctioned and monitored by the Kubuntu/Ubuntu developer community, while other repositories are independently provided, without official sanction or supervision (and should be used with caution). Additional information is available from the Ubuntu Repository Guide. Types of Repositories ------------------------------- There are four major package repository types in Ubuntu: main - Supported by Canonical. This is the major part of the distribution. restricted - Software not licensed under the GPL (or similar software license), but supported by Canonical.add the Medibuntu repository, Add: deb http://packages.medibuntu.org/ oneiric free nonuniverse - Software licensed under the GPL (or similar license) and supported by users. multiverse - Software not licensed under the GPL (or similar license), but supported by users. There are also these additional types of repositories: oneiric-updates - Updates to official packages. oneiric-backports - Current version software from Precise Pangolin (Oneiric+1) that have been backported to Oneiric Ocelot. oneiric-proposed - Proposed updates & changes (bleeding edge stuff). Third party repositories Software developers often maintain their own repositories, from which software packages can be downloaded and installed directly to your computer (if you add the repository to your list). Many of these third party repositories and software packages have never been reviewed by the (K)Ubuntu/Debian community and can present a security risk to your computer. Trojans, backdoors, and other malicious software can be present at any unregulated repository. When using repositories not endorsed by the (K)ubuntu/Debian community, make sure you have utter confidence in that site before enabling the repository and installing a software package from it. Add Repositories using Synaptic Package Manager This is the preferred method. Menu -> System -> Administration -> Synaptic Package Manager -> Settings -> Repositories. Here you can enable the repositories for Ubuntu Software and Third Party Software. For Third Party Software select Add -> enter the repository's address. It will have a format similar to: deb http://archive.ubuntu.com/ubuntu/ oneiric main restricted deb-src http://archive.ubuntu.com/ubuntu/ oneiric main restricted Example: T o-free Download the repository key to a folder. Example: The Medibuntu key can be downloaded from http://packages.medibuntu.org/medibuntu-key.gpg Then add the key from: Menu -> System -> Administration -> Synaptic Manager -> Settings -> Repositories -> Authentication -> Import Key File... (Alternatively, you can manually add the key from the command line Terminal. See Add Repository keys.) Refresh the package list from the new repository: Synaptic -> Reload Manually add repositories Do this at your own risk. Modify the default Ubuntu sources.list only if you understand what you're doing. Mixing repositories can break your system. For more information see the Ubuntu Command-line Repository guide. => Create a backup of your current list of sources. # sudo cp -i /etc/apt/sources.list /etc/apt/sources.list_backup Note: sudo - runs the command with root privileges. cp = copy. -i = prompt to overwrite if a file already exists. => Edit the list of sources: #sudo nano /etc/apt/sources.list or using a graphical editor: # gksudo gedit /etc/apt/sources.list Note: To use your local mirror you can add "xx." before archive.ubuntu.com, where xx = your country code. Example: deb http://gb.archive.ubuntu.com/ubuntu licid main restricted universe multiverse indicates a repository for Great Britain (gb). Here is a sample sources.list. At the end have been added repositories for Medibuntu and Google: #deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release i386]/ oneiric main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://gb.archive.ubuntu.com/ubuntu/ oneiric main restrictedin backports WILL NOT receive any review ## or updates from the Ubundeb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://gb.archive.ubuntu.com/ubuntu/ oneiric universe deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric universe deb http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates universe deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://gb.archive.ubuntu.com/ubuntu/ oneiric multiverse deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric multiverse deb http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse ## Uncomment the following two lines to add software from the 'backports' ## repository. ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software tu security team. deb http://gb.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse deb-src http://gb.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. This software is not part of Ubuntu, but is ## offered by Canonical and the respective vendors as a service to Ubuntu ## users. deb http://archive.canonical.com/ubuntu oneiric partner deb-src http://archive.canonical.com/ubuntu oneiric partner deb http://security.ubuntu.com/ubuntu oneiric-security main restricted deb-src http://security.ubuntu.com/ubuntu oneiric-security main restricted deb http://security.ubuntu.com/ubuntu oneiric-security universe deb-src http://security.ubuntu.com/ubuntu oneiric-security universe deb http://security.ubuntu.com/ubuntu oneiric-security multiverse deb-src http://security.ubuntu.com/ubuntu oneiric-security multiverse ## Medibuntu - Ubuntu 11.10 "Oneiric Ocelot" ## Please report any bug on https://bugs.launchpad.net/medibuntu/ deb http://packages.medibuntu.org/ oneiric free non-free deb-src http://packages.medibuntu.org/ oneiric free non-free # Google software repository deb http://dl.google.com/linux/deb/ stable non-free Download and add the repository keys to your keyring. See Add repository keys. => Refresh the packages list from the new repositories: #sudo apt-get update Add repository keys ---------------------------- Download the gpg keys for the repositories and automatically add them to your repository keyring: Example: To obtain and add the Medibuntu repository key: # wget --quiet http://packages.medibuntu.org/medibuntu-key.gpg -O - | sudo apt-key add -y to Oneiric): #sudo apt-get dist-upgrade InstallingExample: To obtain and add the Google repository key: # wget --quiet http://dl.google.com/linux/linux_signing_key.pub -O - | sudo apt-key add - Note: wget - retrieves a file from a network location. --quiet = no output. -O = Output downloaded item to terminal. The | (pipe symbol) is used to capture the output from the previous command (in our case the screen) and use it as an input for the piped command (i.e. apt-key, which adds it to the keyring). Alternatively (and perhaps more easily), you can use apt-key directly: #sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEY where KEY is the missing key code printed in apt-get output, e.g. EF4186FE247510BE. Note: Key servers often use port 11371. Make sure your firewall allows port 11371 to be open. Package Installation and Updates (APT) ------------------------------------------------------- Apt and Package Basics => Read Add Extra Repositories Most new users will use the Synaptic Package Manager to install packages. These instructions are for installing packages from the command-line Terminal. Terminal can be started: Menu -> Applications -> Accessories -> Terminal => Install packages: #sudo apt-get install packagename Example: #sudo apt-get install mpd sbackup => Remove packages: #sudo apt-get remove packagename => To remove all dependencies #sudo apt-get autoremove Example: #sudo apt-get remove mpd sbackup => Search for packages: # apt-cache search <keywords> Examples: #apt-cache search Music MP3 #apt-cache search "Text Editor" => Update the apt package database after adding/removing repositories: # sudo apt-get update => Upgrade packages: #sudo apt-get upgrade Upgrade the entire distribution (e.g. from Nat t .deb packages Debian (.deb) packages are the packages that are used in Ubuntu. You can install any .deb package in your system. .deb files can generally be installed from your file manager (Nautilus) merely by clicking on them, since file associations with the default installer is already set in Ubuntu. These instructions are for those who wish to install packages from the command-line terminal (Terminal). => Install a downloaded Debian (Ubuntu) package (.deb): # sudo dpkg -i packagename.deb => Remove a Debian (Ubuntu) package (.deb): # sudo dpkg -r packagename => Reconfigure/Repair an installed Debian (Ubuntu) package (.deb): # sudo dpkg-reconfigure packagename *Example: #sudo dpkg-reconfigure mpd Handling (Tar/GZip) and (Tar/Bzip2) archives ------------------------------------------------------------ (Tar/GZip) archives end in ".tar.gz" and (Tar/Bzip2) archives end in ".tar.bz2". Bzip2 is the newer, more efficient compression method. These files can generally be automatically extracted by merely clicking on them from your file manager (Nautilus), since file associations with the appropriate archival utilities are set by default in Ubuntu. These instructions are for those who wish to use the command line Terminal. => To extract: # tar xvf packagename.tar.gz Note: tar is an application which can extract files from an archive, decompressing if necessary. -x means extract. -v means verbose (list what it is extracting(what happens in background process)). -f specifies the file to use. => Decompressing ".gz" files gunzip file.gz => Decompressing ".bz2" files bunzip2 file.bz2 Note: You can also decompress a package first by using the command gunzip (for .gz) or bunzip2 (for .bz2), leaving the .tar file. You would then use tar to extract it.and optional parameters to=> To create a .gz archive: #tar cvfz packagename.tar.gz folder => To create a .bz2 archive: #tar cvfj packagename.tar.bz2 folder => Installing a package from source Make sure you have all the necessary development tools (i.e. libraries, compilers, headers): #sudo apt-get install build-essential linux-headers-$(uname -r) Note: "uname -r" lists the current kernel you are using =>Extract the archive that contains the source files: #tar xvf sourcefilesarchive.tar.gz Build the package using the package's script (in this case the configure script), compile the package (make), and install the compiled package into your system (make install): :: #cd /path/to/extracted/sourcefiles #./configure #sudo make #sudo make install Note: typing ./ before a filename in the current folder allows the Linux shell to try and execute the file as an application even if it is not in the path (the set of folders which it searches when you type a command name). If you get a "permission denied" error, the file is not marked as being executable. To fix this: sudo chmod +x filename Example: In the above instructions, configure is the shell script to build the package from source. To be sure the configure script is executable: sudo chmod +x configure Create a .deb package from source files If your build from source is successful, you can make a Debian (Ubuntu) package (.deb) for future use: Install package tools: sudo apt-get install checkinstall Rebuild package using "checkinstall": cd /path/to/extracted/package ./configure sudo make sudo checkinstall Keep the resulting ".deb" file for future use. It can later be installed using: # sudo dpkg -i packagename.deb Note: These are basic instructions that may not always work. Some packages require additional dependencies be specified in order to build them successfully. Also see these Ubuntu wiki instructions. More info about .deb package structure can be found here. Aptitude => Aptitude is a terminal-based package manager that can be used instead of apt-get. Aptitude marks packages that are automatically installed and removes them when no packages depend on them. This makes it easy to remove applications completely. To use Aptitude, replace apt-get with aptitude in the command line. Example: #sudo aptitude install packagename #sudo aptitude remove packagename #sudo aptitude update #sudo aptitude upgrade For an ncurses-based graphical user interface, type #sudo aptitude For more information, see the aptitude documentation. Synaptic Package Manager ------------------------------------- While "apt-get" and "aptitude" are fast ways of installing programs/packages, you can also use the Synaptic Package Manager (Menu -> System -> Administration -> Synaptic Manager), a GUI method for installing programs/packages. Most (but not all) programs/packages available with apt-get install will also be available from the Synaptic Package Manager. This is the preferred method for most desktop users. In this guide, when you see #sudo apt-get install package you can simply search for package in Synaptic and install it that way. Menu -> System -> Administration -> Synaptic Package Manager Search for the name of the program/package. You can also search for a word in its description. -> Mark for Installation -> Apply The selected program(s) will be automatically installed, along with its dependencies. Ubuntu Software Center (Add/Remove Programs)creens, icons, and themes for windows managers (including Metacity and Compiz) and other applications. Ubuntu Wallpaper Download free Maverick Meerkat wallpapers. Change Plymouth Splash Screen This is the initial splash screNot all packages available from apt-get, aptitude, and Synaptic Package Manager are available in the Ubuntu Software Center. However, it is the easiest interface for new users of Ubuntu and directs them to preferred packages. Menu -> Applications -> Ubuntu Software Center Search for the sort of program you want to add. Example: type MP3 to see a list of mp3 software. -> Mark for Installation -> Apply The selected program(s) will be automatically installed. Manual Updates Read General Notes Read Add Extra Repositories Manually, from Terminal (command line interface): #sudo apt-get update #sudo apt-get upgrade or Use Synaptic Package Manager: --------------------------------------------- Menu -> System -> Administration -> Synaptic Package Manager -> "Reload" then "Mark all upgrades" If there are packages available for updating, you will be prompted whether to install them. Automated Updates Use Synaptic Package Manager: Menu -> System -> Administration -> Synaptic Manager -> Settings -> Preferences -> General -> Reloading Outdated Package Information -> Automatic Repair broken packages If a package installation fails (which can cause a Package Manager to freeze or become locked), or if a package has unsatisfied dependencies causing a similar condition, then run one (or both) of the following commands from the command-line terminal: #sudo apt-get install -f #sudo dpkg --configure -a =============== Desktop Add-ons =============== There are many add-on icons, themes, wallpapers, 3-D effects, and other customizations available for the GNOME desktop. Gnome Eye-Candy Resources Gnome Look has wallpapers, splash sen you see at bootup. Different Plymouth themes can be found by searching for plymouth-theme in a Package Manager. Install a new one and then: #sudo update-alternatives --config default.plymouth #sudo update-initramfs -u and manually select the theme you wish to use. Plymouth does not reliably work with nVidia drivers and during bootup a blank screen may result for several seconds. Metacity => Metacity is the default desktop compositing manager in Gnome. It is lightweight, streamlined and does not have many configurable options, but has multiple themes available at Gnome Look. Compiz Fusion => Compiz Fusion is available as a separate Windows Manager, to allow advanced desktop effects such as the rotating cube desktop. Many Ubuntu users choose to run Compiz, which is quite fast in Ubuntu. Install: sudo apt-get install compiz compizconfig-settings-manager compiz-fusion-plugins-main compiz-fusion-plugins-extra emerald librsvg2-common To change to Compiz as the Window Manager: Select Compiz Configuration: Menu -> System -> Preferences -> CompizConfig Settings Manager Note: You must logout and log back in for the change to take effect. Fusion Icon => Fusion Icon is a tray icon that allows you to easily switch between window managers, window decorators, and gives you quick access to the Compiz Settings Manager. This allows quick toggling of 3-D desktop effects (that may not be compatible with some applications). # sudo apt-get install fusion-icon Menu -> Applications -> System Tools -> Compiz Fusion Icon You can then easily access CompizConfig Settings Manager from the icon. Rotate the Compiz Cubeject before it merged with Compiz to form Compiz Fusion.) The Emerald Theme Manager for Compiz Fusion can be installed: #sudo apt-get install emerald Google Desktop => Google Desktop for Linux was a proprietary suite of Google widgets and applications. It was discontinued in September 2011. gDesklets => gDesklets are similar to Windows widgets and Google gadgets and provide information such as weather, system resources, and news primarily for the Gnome desktop (i.e. Ubuntu MaverickSet the CompizConfig Settings Manager to enable the "Desktop Cube" and "Rotate Cube" and "Viewport Switcher" options. Click on the icon for each to customize settings. For example, to change the appearance of the cube, click on the Desktop Cube icon to access its settings. You can set the hotkey buttons for rotating the cube in the "Viewport Switcher" settings. Otherwise, hold down the Ctrl+Alt+Left mouse button and drag the mouse (or touchpad) the direction you want to rotate the cube. Remember, the cube rotates between desktops. It's not a cube unless you have at least 4 desktops running. You will not get a cube if you are only using 2 desktops (you will get a "plate"). You can still rotate the sides of the plate, of course, but it will not be a cube. (Recent users from the Windows OS may have no experience with the concept of simultaneous desktops, but they are nice once you learn how to use them). When running Compiz fusion as the Windows Manager, you must change the default number of desktops from within CompizConfig Settings Manger. To enable 4 desktops: CompizConfig Settings Manager -> General -> General Options -> Desktop Size -> Horizontal Virtual Size -> 4 When you start an application, you can assign it to any one of the 4 desktops by right-clicking the upper left corner of the application window and choosing the "To Desktop..." option. Rotating the cube shows the different desktops. You can also go to a desktop using the taskbar icon which shows the 4 desktops. Emerald => Emerald is the theme engine for Compiz Fusion. Multiple themes are available. (These themes originated from the Beryl pr o and older). Install: # sudo apt-get install gdesklets Dock applications ------------------------ Avant Window Manager, Cairo Dock, gnome-do and Wbar are dock-like applications for Ubuntu Linux. A dock represents running programs as icons at the bottom of the screen (as is done on the Mac OS X desktop), instead of by toolbar panel segments (as is done in Windows and other Linux window managers). See this brief comparison of dock applications. Avant Window Navigator : Avant Window Navigator requires that a desktop composition manager (such as Metacity, Compiz, Xcompmgr, KDE4 (Kubuntu), or xfwm4 (Xubuntu)) be installed and running. Install and upgrade proprietary nVidia or ATI graphics drivers so that the compositing manager functions properly. Install AWN: sudo apt-get install avant-window-navigator awn-manager (Note: If you are using Gnome (Ubuntu) and do not already have a compositing manager installed (such as Compiz), Metacity will be installed as part of the installation.) Enable automatic startup of AWN at bootup: Menu -> System -> Preferences -> Startup Applications -> Add... avant-window-navigator Select which applets should run from the dock menu by default: Menu -> Applications -> Accessories -> Avant Window Navigator Manager You can drag application icons onto the list, then activate or deactivate the applets from the list. Cairo Dock => Cairo Dock can be used either with a desktop compositing manager (such as Metacity for Gnome, Compiz, or the KDE4 Window Manager) or without one. See the Ubuntu installation instructions for details. It is available from the repositories: sudo apt-get install cairo-dock cairo-dock-plug-ins Gnome Do => Gnome Do is a docking utility for Gnome. Install: # sudo apt-get install gnome-do From the preferences pane of gnome-do select the Docky look and feel to get the dock (rather than the default Quicksilver-like) look and feel.or OS X, to be run from within (K)Ubuntu. This requires extra RAM (because both (K)Ubuntu and the virtualized second OS require separate amounts of RAM) and a license for the second OS. If you wish to run a virtualized instance of Windows XP, for instance, you must have a license for Windows XP. VirtualBox => Viwbar =>wbar is a quick-launch bar (not a dock) that has an appearance similar to Avant Window Manager and Cairo Dock. It is GTK (Gnome) based but can work in all desktop environments. It does not require a compositing manager to be installed and is therefore quicker and more suitable for low-end hardware systems. It is the default in the Google gOS desktop and is available as a .deb package from Google. Download and install (from the command-line Terminal): # wget http://wbar.googlecode.com/files/wbar_1.3.3_i386.deb # sudo dpkg -i wbar_1.3.3_i386.deb Start wbar with custom start options (e.g. by pressing alt+F2). Here is an example: # wbar -isize 48 -j 1 -p bottom -balfa 40 -bpress -nanim 3 -z 2.5 -above-desk Here is another example: wbar -above-desk -pos bottom -isize 60 -nanim 1 -bpress -jumpf 0.0 -zoomf 1.5 For a full list of command-line startup options, see: # wbar --help Tip: If you want the "wave" effect just increase the -nanim value. I like the icons to just pop up so I don't use it, but with 9 icons 5 there is a nice "wave" effect. Obviously, you could create a menu item with the command line options (similar to the examples above), or a batch file that can be automatically started at system startup (as a cron event or startup session). You can also change wbar startup options by editing the configuration file: # sudo gedit /usr/share/wbar/dot.wbar See this example configuration file. However, not all options are able to be set from the configuration file and must be run from the command line. For more info see this wbar guide. wbarconf => A simple wbar configuration utility can be downloaded as a .deb package and installed: # wget http://koti.kapsi.fi/~ighea/wbarconf/wbarconf_0.7.2-1_i386.deb # sudo dpkg -i wbarconf_0.7.2-1_i386.deb ==================== Virtualization ==================== Virtualization allows a second operating system (OS), such as Windows rtualBox is a fast and complete virtualization solution owned and maintained by Sun Microsystems. There is a free and fully open-source edition available under the GNU GPL license. Install the open-source edition: # sudo apt-get install virtualbox-ose virtualbox-ose-source virtualbox-guest-additions You can also add the QT-version (if using KDE/Kubuntu, for example): #sudo apt-get install virtualbox-ose-qt Start VirtualBox: Menu -> VirtualBox OSE PC virtualization solution For usage instructions, see the End-user documentation. For information on installing Virtualbox in Windows so that Ubuntu can then be installed within in a virtual machine running in Windows, see this page. Proprietary versions of VirtualBox A few additional features that are not yet in the OSE version, such as a USB device interface, are available in the proprietary version of VirtualBox. To install a proprietary edition of VirtualBox: Add the security key: wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - Add the repository string to your repository list and update: # echo "deb http://download.virtualbox.org/virtualbox/debian maverick non-free" | sudo tee /etc/apt/sources.list.d/virtualbox.list #sudo apt-get update Install: # sudo apt-get install virtualbox VMWare => VMWare is a commercial virtualization platform that currently offers two free products: VMWare Player and VMWare Server (the latter with a free renewable yearly license). VMWare Player can play virtual appliances that have already been created, whereas VMWare Server (which has a broader range of features) allows the creation of virtual machines. In general, VMWare Server is recommended unless you only need to play an appliance. (Appliances will also run in VMWare Server). Users that wish to run servers (or processes) that need to be available to a network from within the virtual machine should use VMServer. If you wish to install a new OS within a virtual machine (other than in an appliance), you will need VMWare Server. VMWare Player Install -------------------------------M => KVM is the free open source virtualization solution implemented as a Linux kernel module (in the recent kernels) for cInstallation instructions are on the website, or at the Ubuntu community wiki. In brief, to install the free VMWare Player: Install pre-requisites: # sudo apt-get install build-essential linux-headers-$(uname -r) Get the binary package/installation script, give it executable privileges, then run the installation script: #wget http://download3.vmware.com/software/vmplayer/VMware-Player-2.5.3-185404.i386.bundle #chmod +x VMware-Player-2.5.3-185404.i386.bundle #sudo ./VMware-Player-2.5.3-185404.i386.bundle Run: Menu -> Applications -> System Tools -> VMWare Player Create an Ubuntu Appliance While any edition of Ubuntu can be installed in a virtual machine, the minimal installation option (F4) of the Ubuntu Server creates a highly-efficient edition (previously known as JeOS) optimised for use within a virtual appliance (which can then be played using VMWare Player or other virtual machine client). See this walkthrough. A virtual appliance for VMWare Player (using this JeOS minimal server) can also be built using vmbuilder. => VMWare Server Install pre-requisites: #sudo apt-get install build-essential linux-headers-$(uname -r) Download the server source files for your architecture (32-bit or 64-bit) from the VMWare Server website and retrieve your license key by email. Extract the files, give execution privileges to the install script, and run the install script: #tar xvf VMware-server-2.0.1-156745.i386.tar.gz #cd vmware-server-distrib #chmod +x vmware-install.pl #sudo ./vmware-install.pl VMWare Package ------------------------- VMWare Appliances (that include an Ubuntu/Debian OS) can be created using VMWare Server and the VMWare Package utility. These appliances can then be deployed to users who can play them using VMWare Player. Install: # sudo apt-get install vmware-package Keyboard errors in VMware guest After installing VMWare 6.5, and installing a guest OS, the Function, arrow and Del/End/etc keys do not function. This is a bug with VMWareĂ‚´s code. Add this line to ~/.vmware/config (create file if necessary) to fix this issue: xkeymap.nokeycodeMap = true K Vomputers whose processors contain virtualization extensions (Intel VT or AMD-V). See the Ubuntu installation instructions. Install: #sudo apt-get install kvm Qemu (without KVM) If your computer does not have the virtualization extensions, you can still run the QEMU virtualization platform. See this Ubuntu community documentation. It can be installed from source code. Xen => Xen is an efficient open-source virtualization ("hypervisor") platform (which includes a merge with QEMU). It is the basis for the Amazon EC2 Cloud and is generally intended for use on a server (or on "baremetal" systems, i.e. no OS yet installed). It is free open source under a GPL license. The latest desktop (and installation instructions) is available from the website. (A commercial version is also offered by Citrix.) Implementation in Ubuntu requires some modification, currently. For more info, see the Ubuntu community documentation. Install: #sudo apt-get install xen-hypervisor xen-docs convirt A Xen virtual machine host can also be installed automatically with certain 64-bit CPUs, using the 64-bit Ubuntu Server LiveCD. (A (K)Ubuntu desktop can then later be added -- see Ubuntu server). Virtual Machine Manager ---------------------------------- Virtual Machine Manager is an application to allow viewing of all instances of virtual machines on your system. It includes a secure implementation of VNC. This and other virtual management tools are available as an integrated package in (K)Ubuntu. Install: #sudo apt-get install ubuntu-virt-mgmt Crossover for Linux Codeweavers' Crossover Office for Linux is a subscription-based commercial package that allows many Windows programs to be run on Ubuntu without the need for a Microsoft OS license or a complete virtualization system. See the website for more info. Codeweavers releases older versions of this product into the free package Wine. Wine => Wine is a free open-source package that is similar to (and implements many elements of) CrossOver for Linux. Like CrossOver for Linux, no Microsoft license or virtualization platform is required to run Windows programs. See these instructions for installing the latest version of Wine. #sudo apt-get install wineical name: eth0 version: 02 serial: 00Also consider installing Microsoft's TrueType fonts: #sudo apt-get install msttcorefonts PlayOnLinux => PlayOnLinux is a Wine frontend which simplifies the installation and launch of many Windows programs, particularly games. Install: #sudo apt-get install playonlinux Internet Explorer 7 Internet Explorer 7 can be installed with PlayOnLinux. Select "Internet Explorer 7" from the "Internet" section of PlayonLinux. Internet Explorer 6 & 7 Internet Explorer 6 & 7 can function under Wine, albeit imperfectly. For most purposes, Firefox can be used (with the User Agent Switcher plugin) to mimic Internet Explorer. Make sure you have Wine and cabextract packages: #sudo apt-get install wine cabextract Download the Winetricks installation script: #wget http://winetricks.org/winetricks #sudo chmod +x winetricks Install with winetricks: #sh winetricks ie6 #sh winetricks ie7 Note: Winetricks is automatically installed with the current version of Wine. ===================== Network Configuration ===================== Ubuntu ships with a number of graphical utilities to configure your network devices. This document is geared toward server administrators and will focus on managing your network on the command line. Ethernet Interfaces Ethernet interfaces are identified by the system using the naming convention of ethX, where X represents a numeric value. The first Ethernet interface is typically identified as eth0, the second as eth1, and all others should move up in numerical order. Identify Ethernet Interfaces To quickly identify all available Ethernet interfaces, you can use the ifconfig command as shown below. # ifconfig -a | grep eth eth0 Link encap:Ethernet HWaddr 00:15:c5:4a:16:5a Another application that can help identify all network interfaces available to your system is the lshw command. In the example below, lshw shows a single Ethernet interface with the logical name of eth0 along with bus information, driver details and all supported capabilities. #sudo lshw -class network *-network description: Ethernet interface product: BCM4401-B0 100Base-TX vendor: Broadcom Corporation physical id: 0 bus info: pci@0000:03:00.0 lo g:15:c5:4a:16:5a size: 10MB/s capacity: 100MB/s width: 32 bits clock: 33MHz capabilities: (snipped for brevity) configuration: (snipped for brevity) resources: irq:17 memory:ef9fe000-ef9fffff Ethernet Interface Logical Names Interface logical names are configured in the file /etc/udev/rules.d/70-persistent-net.rules. If you would like control which interface receives a particular logical name, find the line matching the interfaces physical MAC address and modify the value of NAME=ethX to the desired logical name. Reboot the system to commit your changes. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:c5:4a:16:5a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:c5:4a:16:5b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" Ethernet Interface Settings ethtool is a program that displays and changes Ethernet card settings such as auto-negotiation, port speed, duplex mode, and Wake-on-LAN. It is not installed by default, but is available for installation in the repositories. #sudo apt-get install ethtool The following is an example of how to view supported features and configured settings of an Ethernet interface. #sudo ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on Supports Wake-on: g Wake-on: d Current message level: 0x000000ff (255) Link detected: yescollisions:0 txqueuelen:1000 RX bytes:2574778386 (2.5 GB) TX bytes:1618367329 (1.6 GB) Interrupt:16 To configure a default gateway, you can use the route command in the following manner. Modify the default gatewayChanges made with the ethtool command are temporary and will be lost after a reboot. If you would like to retain settings, simply add the desired ethtool command to a pre-up statement in the interface configuration file /etc/network/interfaces. The following is an example of how the interface identified as eth0 could be permanently configured with a port speed of 1000Mb/s running in full duplex mode. auto eth0 iface eth0 inet static pre-up /usr/sbin/ethtool -s eth0 speed 1000 duplex full Although the example above shows the interface configured to use the static method, it actually works with other methods as well, such as DHCP. The example is meant to demonstrate only proper placement of the pre-up statement in relation to the rest of the interface configuration. IP Addressing ------------- The following section describes the process of configuring your systems IP address and default gateway needed for communicating on a local area network and the Internet. Temporary IP Address Assignment ------------------------------- For temporary network configurations, you can use standard commands such as ip, ifconfig and route, which are also found on most other GNU/Linux operating systems. These commands allow you to configure settings which take effect immediately, however they are not persistent and will be lost after a reboot. To temporarily configure an IP address, you can use the ifconfig command in the following manner. Just modify the IP address and subnet mask to match your network requirements. #sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0 To verify the IP address configuration of eth0, you can use the ifconfig command in the following manner. ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:15:c5:4a:16:5a inet addr:10.0.0.100 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::215:c5ff:fe4a:165a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:466475604 errors:0 dropped:0 overruns:0 frame:0 TX packets:403172654 errors:0 dropped:0 overruns:0 carrier:0 address to match your network requirements. # sudo route add default gw 10.0.0.1 eth0 To verify your default gateway configuration, you can use the route command in the following manner. ---------------------------------- # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.0.0.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0 0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0 If you require DNS for your temporary network configuration, you can add DNS server IP addresses in the file /etc/resolv.conf. The example below shows how to enter two DNS servers to /etc/resolv.conf, which should be changed to servers appropriate for your network. A more lengthy description of DNS client configuration is in a following section. nameserver 8.8.8.8 nameserver 8.8.4.4 If you no longer need this configuration and wish to purge all IP configuration from an interface, you can use the ip command with the flush option as shown below. # ip addr flush eth0 Flushing the IP configuration using the ip command does not clear the contents of /etc/resolv.conf. You must remove or modify those entries manually. ----------------------------- # ip addr flush eth0 Dynamic IP Address Assignment (DHCP Client) ------------------------------------------- To configure your server to use DHCP for dynamic address assignment, add the dhcp method to the inet address family statement for the appropriate interface in the file /etc/network/interfaces. The example below assumes you are configuring your first Ethernet interface identified as eth0. auto eth0 iface eth0 inet dhcp By adding an interface configuration as shown above, you can manually enable the interface through the ifup command which initiates the DHCP process via dhclient. sudo ifup eth0 To manually disable the interface, you can use the ifdown command, which in turn will initiate the DHCP release process and shut down the interface. sudo ifdown eth0 OR #sudo dhclient (apt-get install dhclient) Static IP Address Assignment ------------------------------conf. You can also add an optional DNS suffix search-lists to match your network domain names. Below is an example of a typical configuration of /etc/resolv.conf for a server on the domain "example.com" and using two public DNS servers. search example.com nameserver 8.8.8.8 nameserver 8.8.4.4 The search option can also be used with multiple domain names so that DNS queriTo configure your system to use a static IP address assignment, add the static method to the inet address family statement for the appropriate interface in the file /etc/network/interfaces. The example below assumes you are configuring your first Ethernet interface identified as eth0. Change the address, netmask, and gateway values to meet the requirements of your network. #nano /etc/network/interfaces auto eth0 iface eth0 inet static address 10.0.0.100 netmask 255.255.255.0 gateway 10.0.0.1 By adding an interface configuration as shown above, you can manually enable the interface through the ifup command. #sudo ifup eth0 To manually disable the interface, you can use the ifdown command. #sudo ifdown eth0 Loopback Interface The loopback interface is identified by the system as lo and has a default IP address of 127.0.0.1. It can be viewed using the ifconfig command. ifconfig lo lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:2718 errors:0 dropped:0 overruns:0 frame:0 TX packets:2718 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:183308 (183.3 KB) TX bytes:183308 (183.3 KB) By default, there should be two lines in /etc/network/interfaces responsible for automatically configuring your loopback interface. It is recommended that you keep the default settings unless you have a specific purpose for changing them. An example of the two default lines are shown below. auto lo iface lo inet loopback Name Resolution Name resolution as it relates to IP networking is the process of mapping IP addresses to hostnames, making it easier to identify resources on a network. The following section will explain how to properly configure your system for name resolution using DNS and static hostname records. DNS Client Configuration ------------------------- To configure your system to use DNS for name resolution, add the IP addresses of the DNS servers that are appropriate for your network in the file /etc/resolv .es will be appended in the order in which they are entered. For example, your network may have multiple sub-domains to search; a parent domain of example.com, and two sub-domains, sales.example.com and dev.example.com. If you have multiple domains you wish to search, your configuration might look like the following. search example.com sales.example.com dev.example.com nameserver 8.8.8.8 nameserver 8.8.4.4 If you try to ping a host with the name of server1, your system will automatically query DNS for its Fully Qualified Domain Name (FQDN) in the following order: server1.example.com server1.sales.example.com server1.dev.example.com If no matches are found, the DNS server will provide a result of notfound and the DNS query will fail. Static Hostnames Static hostnames are locally defined hostname-to-IP mappings located in the file /etc/hosts. Entries in the hosts file will have precedence over DNS by default. This means that if your system tries to resolve a hostname and it matches an entry in /etc/hosts, it will not attempt to look up the record in DNS. In some configurations, especially when Internet access is not required, servers that communicate with a limited number of resources can be conveniently set to use static hostnames instead of DNS. The following is an example of a hosts file where a number of local servers have been identified by simple hostnames, aliases and their equivalent Fully Qualified Domain Names (FQDN's). 127.0.0.1 localhost 127.0.1.1 ubuntu-server 10.0.0.11 server1 vpn server1.example.com 10.0.0.12 server2 mail server2.example.com 10.0.0.13 server3 www server3.example.com 10.0.0.14 server4 file server4.example.com In the above example, notice that each of the servers have been given aliases in addition to their proper names and FQDN's. Server1 has been mapped to the name vpn, server2 is referred to as mail, server3 as www, and server4 as file. Name Service Switch Configuration ---------------------------------- The order in which your system selects a method of resolving hostnames to IP addresses is controlled by the Name Service Switch (NSS) configuration file /etc/nsswitch.conf. As mentioned in the previous section, typically static hostnames defined in the systems /etc/hosts file have precedence over names resolved from DNS. The following is an example of the line responsible for this order of hostname lookups in the file /etc/nsswitch.conf. hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4ion, and related support files, use this command at a terminal prompfiles first tries to resolve static hostnames located in /etc/hosts. mdns4_minimal attempts to resolve the name using Multicast DNS. [NOTFOUND=return] means that any response of notfound by the preceding mdns4_minimal process should be treated as authoritative and that the system should not try to continue hunting for an answer. dns represents a legacy unicast DNS query. mdns4 represents a Multicast DNS query. To modify the order of the above mentioned name resolution methods, you can simply change the hosts: string to the value of your choosing. For example, if you prefer to use legacy Unicast DNS versus Multicast DNS, you can change the string in /etc/nsswitch.conf as shown below. hosts: files dns [NOTFOUND=return] mdns4_minimal mdns4 Bridging Bridging multiple interfaces is a more advanced configuration, but is very useful in multiple scenarios. One scenario is setting up a bridge with multiple network interfaces, then using a firewall to filter traffic between two network segments. Another scenario is using bridge on a system with one interface to allow virtual machines direct access to the outside network. The following example covers the latter scenario. Before configuring a bridge you will need to install the bridge-utils package. To install the package, in a terminal enter: #sudo apt-get install bridge-utils Next, configure the bridge by editing /etc/network/interfaces: #nano /etc/network/interfaces auto lo iface lo inet loopback auto br0 iface br0 inet static address 192.168.0.10 network 192.168.0.0 netmask 255.255.255.0 broadcast 192.168.0.255 gateway 192.168.0.1 bridge_ports eth0 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off Enter the appropriate values for your physical interface and network. Now restart networking to enable the bridge interface: #sudo /etc/init.d/networking restart The new bridge interface should now be up and running. The brctl provides useful information about the state of the bridge, controls which interfaces are part of the bridge, etc. See man brctl for more information. ===================== Installation Open-SSH ===================== => Installation of the OpenSSH client and server applications is simple. To install the OpenSSH client applications on your Ubuntu system, use this command at a terminal prompt: # sudo apt-get install openssh-client => To install the OpenSSH server applica tt: #sudo apt-get install openssh-server The openssh-server package can also be selected to install during the Server Edition installation process. Configuration ------------- You may configure the default behavior of the OpenSSH server application, sshd, by editing the file /etc/ssh/sshd_config. For information about the configuration directives used in this file, you may view the appropriate manual page with the following command, issued at a terminal prompt: #man sshd_config There are many directives in the sshd configuration file controlling such things as communication settings and authentication modes. The following are examples of configuration directives that can be changed by editing the /etc/ssh/sshd_config file. Prior to editing the configuration file, you should make a copy of the original file and protect it from writing so you will have the original settings as a reference and to reuse as necessary. Copy the /etc/ssh/sshd_config file and protect it from writing with the following commands, issued at a terminal prompt: # sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original # sudo chmod a-w /etc/ssh/sshd_config.original The following are examples of configuration directives you may change: To set your OpenSSH to listen on TCP port 2222 instead of the default TCP port 22, change the Port directive as such: Port 2222 To have sshd allow public key-based login credentials, simply add or modify the line: PubkeyAuthentication yes In the /etc/ssh/sshd_config file, or if already present, ensure the line is not commented out. To make your OpenSSH server display the contents of the /etc/issue.net file as a pre-login banner, simply add or modify the line: Banner /etc/issue.net In the /etc/ssh/sshd_config file. After making changes to the /etc/ssh/sshd_config file, save the file, and restart the sshd server application to effect the changes using the following command at a terminal prompt: #sudo /etc/init.d/ssh restart Many other configuration directives for sshd are available for changing the server application's behavior to fit your needs. Be advised, however, if your only method of access to a server is ssh, and you make a mistake in configuring sshd via the /etc/ssh/sshd_config file, you may find you are locked out of the server upon restarting it, or that the sshd server refuses to start due to an incorrect configuration directive, so be extra careful when editing this file on a remote server. SSH Keys ---------SSH keys allow authentication between two hosts without the need of a password. SSH key authentication uses two keys a private key and a public key. To generate the ssh-keys, from a terminal prompt enter: ----------------- #ssh-keygen -t dsa This will generate the keys using a DSA authentication identity of the user. During the process you will be prompted for a password. Simply hit Enter when prompted to create the key.y default the public key is saved in the file ~/.ssh/id_dsa.pub, while ~/.ssh/id_dsa is the private key. Now copy the id_dsa.pub file to the remote host and appendB it to ~/.ssh/authorized_keys by entering: #ssh-copy-id username@remotehost:~/.ssh/authorized_keys if : its user'home dir to whom you are doing SSHns are not correct change them by: #chmod 600 .ssh/authorized_keys Basic SSH USAGE ---------------- # ssh root@192.168.1.200 whereas : ssh is command root is user @192.168.1.200 isFinally, double check the permissions on the authorized_keys file, only the authenticated user should have read and write permissions. If the permissi oip add of host in network You should now be able to SSH to the host without being prompted for a password. Mounting a remote directory through SSH ---------------------------------------account on a computer called alpha-centauri, you could create a folder alpha-centauri in your home folder, then do the following: #sshfs -o idmap=user alpha-centuari: ~/alpha-centauri/ Now when you look in your alpha-centuari folder, you will see your home folder on alpha-centauri. You can safely remove this device bThe SSH protocol includes SFTP (the Secure File Transfer Protocol). Ubuntu can use SFTP to treat your SSH server rather like a removable drive. For example, if your Ubuntu computer has an SSH y doing: #fusermount -u ~/alpha-centauri/ Although this SSH filesystem is extremely useful, it's not what the SFTP protocol was designed for. As such, some ordinary operations might not behave the way you'd expect - for example, you can't unmount an SSHFS directory from the file browser. SSHOpenSSHPortForwarding --------------------------- Introductionan smuggle various types of Internet traffic into or out of a network. This can be used to avoid network monitoring or sniffers, or bypass badly configured routers on the Internet. Note: You might also need to change the settings in other programs (like your web browser) in order to circumvent these filPort forwarding via SSH (SSH tunneling) creates a secure connection between a local computer and a remote machine through which services can be relayed. Because the connection is encrypted, SSH tunneling is useful for transmitting information that uses an unencrypted protocol, such as IMAP, VNC, or IRC. Types of Port Forwarding SSH's port forwarding feature cters. Warning: Filtering and monitoring is usually implemented for a reason. Even if you don't agree with that reason, your IT department might not take kindly to you flouting their rules. There are three types of port forwarding with SSH: Local port forwarding: connections from the SSH client are forwarded via the SSH server, then to a destination server Remote port forwarding: connections from the SSH server are forwarded via the SSH client, then to a destination server Dynamic port forwarding: connections from various programs are forwarded via the SSH client, then via the SSH server, and finally to several destination serverssupported technique and a feature found in all major SSH clients and servers, although not all clients do it the same way. For help on using=> Local port forwarding is the most common type. For example, local port forwarding lets you bypass a company firewall that blocks Wikipedia. => Remote port forwarding is less common. For example, remote port forwarding lets you connect from your SSH server to a computer on your company's intranet. => Dynamic port forwarding is rarely used. For example, dynamic port forwarding lets you bypass a company firewall that blocks web access altogether. Although this is very powerful, it takes a lot of work to set up, and it's usually easier to use local port forwarding for the specific sites you want to access. Port-forwarding is a widel ya specific client, consult the client's documentation. For example, the PuTTY manual has a section on port forwarding in PuTTY. To use port forwarding, you need to make sure port forwarding is enabled it in your server. You also need to tell your client the source and destination port numbers to use. If you're using local or remote forwarding, you need to tell your client the destination server. If you're using dynamic port forwarding, you need to configure your programs to use a SOCKS proxy server. Again, exactly how to do this depends on which SSH client you use, so you may need to consult your documentation. Local Port Forwarding -----------------------ould be replaced by the name of your laptop. The -L option specifies local port forwarding. For the duration of the SSH session, pointing your browser at http://localhost:8080/ would send you to http://www.ubuntuforums.org/. In the above example, we used port 8080 for the source port. Ports numbers less than 1024 or greater than 49151 are reservedLocal port forwarding lets you connect from your local computer to another server. To use local port forwarding, you need to know your destination server, and two port numbers. You should already know your destination server, and for basic uses of port forwarding, you can usually use the port numbers in Wikipedia's list of TCP and UDP port numbers. For example, say you wanted to connect from your laptop to http://www.ubuntuforums.org using an SSH tunnel. You would use source port number 8080 (the alternate http port), destination port 80 (the http port), and destination server www.ubuntuforums.org. : # ssh -L 8080:www.ubuntuforums.org:80 <host> Where <host> s h for the system, and some programs will only work with specific source ports, but otherwise you can use any source port number. For example, you could do: # ssh -L 8080:www.ubuntuforums.org:80 -L 12345:ubuntu.com:80 <host> This would forward two connections, one to www.ubuntuforums.org, the other to www.ubuntu.com. Pointing your browser at http://localhost:8080/ would download pages from www.ubuntuforums.org, and pointing your browser to http://localhost:12345/ would download pages from www.ubuntu.com. The destination server can even be the same as the SSH server. For example, you could do: # ssh -L 5900:localhost:5900 <host> This would forward connections to the shared desktop on your SSH server (if one had been set up). Connecting an SSH client to localhost port 5900 would show the desktop for that computer. The word "localhost" is the computer equivalent of the word "yourself", so the SSH server on your laptop will understand what you mean, whatever the computer's actual name.tle-known but widely-iRemote Port Forwarding ----------------------- Remote port forwarding lets you connect from the remote SSH server to another server. To use remote port forwarding, you need to know your destination server, and two port numbers. You should already know your destination server, and for basic uses of port forwarding, you can usually use the port numbers in Wikipedia's list of TCP and UDP port numbers. For example, say you wanted to let a friend access your remote desktop, using the command-line SSH client. You would use port number 5900 (the first VNC port), and destination server localhost: # ssh -R 5900:localhost:5900 guest@joes-pc The -R option specifies remote port forwarding. For the duration of the SSH session, Joe would be able to access your desktop by connecting a VNC client to port 5900 on his computer (if you had set up a shared desktop). Dynamic Port Forwarding ------------------------ Dynamic port forwarding turns your SSH client into a SOCKS proxy server. SOCKS is a li tmplemented protocol for programs to request any Internet connection through a proxy server. Each program that uses the proxy server needs to be configured specifically, and reconfigured when you stop using the proxy server. For example, say you wanted Firefox to connect to every web page through your SSH server. First you would use dynamic port forwarding with the default SOCKS port: # ssh -C -D 1080 laptop The -D option specifies dynamic port forwarding. 1080 is the standard SOCKS port. Although you can use any port number, some programs will only work if you use 1080. -C enables compression, which speeds the tunnel up when proxying mainly text-based information (like web browsing), but can slow it down when proxying binary information (like downloading files). Next you would tell Firefox to use your proxy: go to Edit -> Preferences -> Advanced -> Network -> Connection -> Settings... check "Manual proxy configuration" make sure "Use this proxy server for all protocols" is clearede systems share a common graphics layer called X11. This even works undclear "HTTP Proxy", "SSL Proxy", "FTP Proxy", and "Gopher Proxy" fields enter "127.0.0.1" for "SOCKS Host" enter "1080" (or whatever port you chose) for Port. You can also set Firefox to use the DNS through that proxy, so even your DNS lookups are secure: Type in about:config in the Firefox address bar Find the key called "network.proxy.socks_remote_dns" and set it to true The SOCKS proxy will stop working when you close your SSH session. You will need to change these settings back to normal in order for Firefox to work again. To make other programs use your SSH proxy server, you will need to configure each program in a similar way. Forwarding GUI Programs ------------------------- SSH can also forward graphical applications over a network, although it can take some work and extra software to forward programs to Windows or Mac OS. Single Applications If you are logging in from a Unix-like operating system, you can forward single applications over SSH very easily, because all Unix-li ker Mac OS X, although you will need to install and start the X11 server before using SSH. To forward single applications, connect to your system using the command-line, but add the -X option to forward X11 connections: # ssh -X laptop Once the connection is made, type the name of your GUI program on the SSH command-line: #firefox & Your program will start as normal, although you might find it's a little slower than it would be if it were running locally. The trailing & means that the program should run in "background mode", so you can start typing new commands in straight away, rather than waiting for your program to finish. If you only want to run a single command, you can log in like this: # ssh -f -T -X laptop firefox That will run Firefox, then exit when it finishes. See the SSH manual page for information about -f and -T.arding, it's helpful to know a bit about how the Internet works. The Internet assigns computers virtual "ports", a bit like the USB ports on the back of your computer: To let a digital camera share pictures with your PC, you connect the USB port on thIf you start an application and it complains that it cannot find the display, try installing the xauth package from the Main repository (click here to install xauth). Xauth is installed by default with desktop installations but not server installations. If you suspect that programs are running slowly because of a lack of bandwith, you can turn SSH compression on with the -C option: # ssh -fTXC joe@laptop firefox Using -fTXC here is identical to -f -T -X -C. Nested Windows Xephyr is a program that gives you an X server within your current server. It's available in the xserver-xephyr package in the Main repository (click here to install xserver-xephyr). Two ssh forwarded desktops on dual monitors, click to enlarge Setting up Xephyr was explained briefly in the Ubuntu forums. Port Forwarding Explained To get the most out of port for we camera to any USB port on the PC. The computer then talks to the camera about your photos, and shows you the result. To let a web server share pages with your PC, you connect the web server port on the server to any Internet port on the PC. The computer then talks to the server about your page, and shows you the result. Unlike a USB port, there is no physical component to an Internet port. There's no actual wire, or actual hole on the back of your computer. It's all just messages being sent over the Internet. Like other "virtual" computer concepts, Internet ports are just an analogy that help to explain what your computer is doing. Sometimes, that analogy breaks down: There are two types of Internet port: normal "TCP" ports and strange "UDP" ports (which won't be covered here). Unlike USB ports, every computer has exactly 65,535 numbered TCP ports, some of which have a special purpose. For example, port number 80 is your web server port, so your web browser knows it should connect to port number 80 in order to download a web page..ubuntu.com/community/SSH OpenSSH Website http://www.openssh.org/ Advanced OpenSSH Wiki Page ==================== Web Browsers ==================== Mozilla Firefox -------------------- Mozilla Firefox isConnections between Internet ports can be patched together, so a connection from computer A to computer B on port 12,345 could be patched through to port number 80 on computer C. This is known as port forwarding. Troubleshooting ssh port forwarding -------------------------------------- If you get a message like this when you try to forward a port: bind: Address already in use channel_setup_fwd_listener: cannot listen to port: <port number> Could not request local forwarding. then someone is already listening on that port number. You won't be able to listen on that port until the other person has finished with it. If forwarding doesn't seem to work, even though you didn't get a warning message, then your SSH server might have disabled forwarding. To check, do the following: grep Forwarding /etc/ssh/sshd_config If you see something like this: X11Forwarding no AllowTcpForwarding no then forwarding is disabled on your server. See the SSH configuration page for more information. References ---------- Ubuntu Wiki SSH page https://hel p the ubiquitous web browser. Based on open source components, it is trademarked and cannot be altered or re-distributed with any change that involves the name or trademarks. Install the current version: # sudo apt-get install firefox :: Firefox Plug-ins Adblock Plus plug-in (block ads in a web page) Adblock Plus blocks ads that appear in web pages. You can subscribe to a free filter service, and can add ads to block with a single click. #sudo apt-get install xul-ext-adblock-plus You can also add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> AdBlock Plus. (This method will also ensure that automatic updates are installed by Firefox.) => Noscript plug-in (controls scripts) The Noscript plugin is considered one of the most important security measures for browsing the Internet. Most viruses and trojans gain access to computers from the Internet through scripts. This plugin allows you to choose which scripts to allow and blocks the rest. Add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> Noscript. (This method will also ensure that automatic updates are installed by Firefox.) => RefreshBlocker plug-in (prevents redirects)oad of videos (including Flash videos) from sites like YouTube. You can add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> Video DownloadHelper. (This method will also ensure that automatic updates are installed by Firefox.) => Unplug Download Management The UnPlug add-on lets you save video andRefreshBlocker allows the user to decide which websites (and pages) will be allowed to redirect (based on META tags within the webpage). Although Firefox (as of version 3.5) blocks all directs by default, the behavior is not customizable; it is therefore preferable to turn off the Firefox redirect control and use RefreshBlocker instead. Add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> RefreshBlocker. (This method will also ensure that automatic updates are installed by Firefox.) =>Turn off the Firefox automatic redirect blocker: Firefox -> Enter about:config in the browser location bar -> right-click on "accessibility:blockautorefresh" -> Toggle to change the value from true to false => User Agent Switcher plug-in for Firefox The User Agent Switcher plugin allows a browser to masquerade as another browser, allowing (most of the time) browser-specific content to be displayed. You can add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Search All Add-ons -> User Agent Switcher. (This method will also ensure that automatic updates are installed by Firefox.) => Video DownloadHelper plug-in for Firefox The Video DownloadHelper plugin allows the down l audio which is embedded on a webpage. You can add this extension from Firefox -> Tools -> Add-ons -> Get Add-ons -> Browse All Add-ons. (This method will also ensure that automatic updates are installed by Firefox.) => Lucifox (eBook reader extension) Lucifox (Lucidor for Firefox) enables e-books to be read and e-book catalogs to be browsed in a Firefox window. To install, go to the website and click "Download Now." Java Runtime Environment (JRE) for Firefox plug-in This package also installs the Java Runtime Environment. (JRE is also installed when OpenOffice or ubuntu-restricted-extras is installed.) # sudo apt-get install sun-java6-jre sun-java6-plugin Note: You must accept the license to use this product. => Adobe Acrobat Reader for Firefox Plug-in This plugin is allows you to view Adobe Acrobat (PDF) files within the Firefox browser. Read Add Extra Kubuntu Repositories and enable the Oneiric partner repository: deb http://archive.canonical.com/ubuntu oneiric partner then install Adobe Reader: #sudo apt-get install acroread Alternatively, this plugin is also available from the Medibuntu repository. Add the Medibuntu repository to your repository list: deb http://packages.medibuntu.org/ oneiric free non-free then install: #sudo apt-get install acroread mozilla-acroread acroread-plugins acroread-fonts => Adobe Flash Player for Firefox Plug-in To install the official Adobe Flash plugin (Flash 10) for Firefox: #sudo apt-get install adobe-flashplugin =>Gnash Plug-in (Open source Flash Player replacement)th most Silverlight 3/4 content) is here. Netflix under Moonlight Netflix streaming requires both the capabilities of SilvGnash is available in a 64-bit version as well as a 32-bit version. It is the open source replacement for Adobe Flashplayer. # sudo apt-get install gnash After installing, change your web browser's Preferences -> Applications so that SWF and SPL files use Gnash. => VLC plug-in for Firefox This package allows the popular VLC player to play media within the Firefox browser. #sudo apt-get install mozilla-plugin-vlc => Gecko MediaPlayer Plug-in for Firefox Gecko MediaPlayer is a browser plugin for all Gecko-based browsers (Firefox, SeaMonkey, IceApe, Opera) that allows Mplayer to play multimedia within the browser. Install: #sudo apt-get install gecko-mediaplayer An alternative is to use the mplayer plugin for Firefox. Install: # sudo apt-get install mozilla-mplayer => Helix player plug-in for Firefox This package installs the Helix player (the open source player that plays Real Player content in Linux) as well as the plugin that plays RealMedia within the Firefox browser. #sudo apt-get install mozilla-helix-player Moonlight plugin for Firefox Moonlight is part of the Novell Mono project that is an open source implementation of Silverlight (the Microsoft multimedia presentation platform). It is based on FFMpeg. It is made to work best with the Firefox 3 web browser, as a plugin (but also works with other mozilla browsers). Version 2.3 is available as a plugin for mozilla-based browsers: #sudo apt-get install moonlight-plugin-mozilla The stable version 2.4 is available here. The Moonlight 3.99 plugin (compatible w ierlight 2.0 and Digital Rights Management modules. Although the current version of Moonlight 2.0 will run most Silverlight content (including Netflix content), Netflix has not yet released Digital Rights Management modules for Linux. Please contact Netflix directly for further information or sign a petition. An HTML5 Netflix plugin (currently being developed by Google for the Chrome browser) may soon be available. Another alternative is the Netflix Android app which can be used in a virtual Android environment. FireFTP for Firefox FireFTP is a Firefox extension for FTP transfers. Firefox Widgets Turn off browser bar drop-down list in Firefox This is the most frequently asked problem regarding Firefox. To turn off the location browser bar drop-down list (and therefore not show your browsing history): Firefox -> about:config (in the location browser bar) -> browser.urlbar.maxRichResults -> right-click -> Modify -> set value to 0 =>IceCat IceCat is Firefox distributed without the Mozilla trademark restrictions. It is endorsed by the Debian project (on which Ubuntu is based). It is formerly known as IceWeasel and is also known as IceApe Browser. Install the current version: #sudo apt-get install iceape-browser => SeaMonkey SeaMonkey is an open-source integrated internet application suite (including web browser, IM (IRC) client, Email client, RSS/News reader, and web development tools). It is based on the same components as the Mozilla products and shares the trademark and branding restrictions. There are many plugins, similar to those for Thunderbird and Firefox. Install: # sudo apt-get install seamonkey => IceApe-------- Evolution is the default Gnome-based email client in Ubuntu. If not installed: sudo apt-get install evolution Evolution and PGP ----------------------------- Email messages can be encrypted in PGP and sent by email using Evolution. See this tutorial for an example how to configure it. Key Generation, Command Line Interface (CLI) First, you'll need to make s# IceApe is an open-source integrated internet application suite (including web browser, IM (IRC) client, Email client, RSS/News reader, and web development tools). It is based on the same components as the Mozilla product SeaMonkey, but has no restrictive trademark licensing, and is endorsed by the Debian project (on which Ubuntu is based). Install the current version: # sudo apt-get install iceape INSTALL Opera ---------------------- Opera is a proprietary browser and internet suite (currently free on PCs) also used in some mobile devices and gaming consoles. It includes email, an address book, IRC chat, integrated BitTorrent, and webfeeds. A limited number of plugins are also available. Download from the website and follow the instructions or install from the Opera repository: echo "deb http://deb.opera.com/opera/ stable non-free" | sudo tee /etc/apt/sources.list.d/opera.list wget -O - http://deb.opera.com/archive.key | sudo apt-key add - sudo apt-get install opera INSTALL Chromium -------------------------- Chromium is the open-source browser on which the Google Chrome browser is based. Install: sudo apt-get install chromium-browser Start Chromium: Menu -> Applications -> Internet -> Chromium Web Browser Google Chrome Google Chrome is Google's web browser. Based on the Chromium browser, Google adds the Google name and logo, an auto-updater system called GoogleUpdate, RLZ, and other Google add-ons. Download and install it here. Download Managers MultiGet ------------ MultiGet is a GTK-based free-standing download manager utility. # sudo apt-get install multiget Email Clients ------------------ Evolution ---- -ure you have (or install) the following packages: gnupg gnupg-agent Then proceed with the following: Launch a terminal window by hitting Alt & F2 then type xterm Enter the following xterm window: gpg --gen-key Then enter 1 (this selects the option, "1- to create a standard DSA/ElGamal key" - this is selected by default) and press Enter Type in 1024 and then press Enter Type in 0 and then press Enter Enter a y and then press Enter Type in your Real Name, as in your first and last name and press Enter Type in your email address (this is the email address you will be using your GPG Key with) and press Enter In the Comment field, you can leave this blank or add other important information, then press Enter Type 0 (as in Okay) to confirm settings so far and then press Enter You will now have to type in your Pass Phrase - it's recommended to use a sentence with a mix of random numbers and mixed capitalization; do not make this easy to guess! IMPORTANT: The Pass Phrase is not long enough you will be warned and prompted to enter a new one again You will have to re-enter your Pass Phrase again to confirm it Wait for your computer to generate the random bytes needed for they key, this could take a while One they Key generation process has finished, proceed with the following: While in the same xterm, type in the following command: gpg --export -a "User Name" > public.key Be sure to replace "User Name" with your actual username Open a nautilus window by hitting Alt & F2 and typing nautilis Find the file public.key in your home directory Right click on the file, then left click on Open with "Text Editor" Press CTRL+A, then CTRL+C Or, Edit -> Select All and then Edit -> Copy Launch a web browser and visit this page, http://pgp.mit.edu In the box under labeled "Submit a key" - right click in the box and then left click on Paste Click on the button labeled, Submit this key to the keyserver! Go back to http://pgp.mit.edu=> Ekiga Formerly known as Gnomemeeting, Ekiga is a SIP cType in your First and Last name in the Search String: box On the results page you are looking for keyID column Highlight and copy your keyID - you will need to refer to this in the next step Thunderbird ----------------- Mozilla Thunderbird is a licensed and trademarked free open-source email client that is compatible with Firefox. Install: #sudo apt-get install thunderbird => Lightning calendar extension Lightning is the calendar extension for Thunderbird (with functionality similar to the stand-alone application Sunbird). It is currently available in a 32-bit version only. (If using a 64-bit OS, install the Sunbird calendar client instead.) Install by clicking on the Linux download at the website. =>Enigmail Enigmail is an add-on to Thunderbird that allows you to easily encrypt your email using OpenPGP, which is included in the kernel by default. It also allows you to create and manage the encryption keys. Go the website and click "Download Now". (64-bit versions are found here.) Install: Thunderbird -> Tools -> Add-ons -> Install -> select downloaded file or #sudo apt-get install enigmail Also see these tips for instructions on setting up e-mail with PGP encryption. New Mail Icon for Thunderbird "New Mail Icon" is an experimental tray add-on which notifes you of new mail. Download from the website. Install: Thunderbird -> Tools -> Add-ons -> Install -> select downloaded file => KMail KMail (Kontact Mail) is the default email client included with Kontact in KDE (Kubuntu). Kontact includes email, an address book, a calendar, reminders, pop-up notes, a link to the Akregator News/RSS reader, time-tracking, and more. Install: #sudo apt-get install kontact Videoconferencing and VOIP --------------------------------------- Videoconferencing and voice over Internet (VOIP) applications are merging into integrated applications. Most of these applications now allow placing calls to non-Internet based telephones for a small fee.t is possible to install Skype by adding the repository and installing from there. Tompliant fully functional open source integrated VOIP and videoconferencing program. # sudo apt-get install ekiga => Skype Skype is a proprietary integrated VOIP and video conferencing program similar to Ekiga. Also see instructions on how to record Skype conversations. Install pre-requisites: #sudo apt-get install libqt4-dbus libqt4-network libqt4-xml To get the most recent version, download and install the 32-bit version: #wget -O skype-ubuntu-current_i386.deb http://www.skype.com/go/getskype-linux-beta-ubuntu-32 #sudo dpkg -i skype-ubuntu-current_i386.deb #sudo rm skype-ubuntu-current_i386.deb In the past. some users have noted that they cannot get their microphone inputs to work with any version later than 2.1.0.47. They installed: #wget -O skype-ubuntu-current_i386.deb http://download.skype.com/linux/skype-debian_2.1.0.47-1_i386.deb #sudo dpkg -i skype-ubuntu-current_i386.deb #sudo rm skype-ubuntu-current_i386.deb or #wget -O skype-ubuntu-current_amd64.deb http://download.skype.com/linux/skype-ubuntu-intrepid_2.1.0.47-1_amd64.deb #sudo dpkg -i skype-ubuntu-current_amd64.deb #sudo rm skype-ubuntu-current_amd64.deb How to install Skype on a 64-bit system The current version of Skype for 64-bit systems is a masqueraded 32-bit module. To use on a 64-bit system you might still need to install the needed packages: #sudo apt-get install ia32-libs lib32asound2 libqt4-core libqt4-gui Then download and install the current Skype .deb package from the Skype website: #wget -O skype_ubuntu-current_amd64.deb http://www.skype.com/go/getskype-linux-beta-ubuntu-64 #sudo dpkg -i skype-ubuntu-current_amd64.deb #sudo rm skype-ubuntu-current_amd64.deb If the 64-bit version doesn't work for you, use the 32-bit version: #wget -O skype-ubuntu-current_i386.deb http://www.skype.com/go/getskype-linux-beta-ubuntu-32 #sudo dpkg -i --force-architecture skype-ubuntu-current_i386.deb #sudo rm skype-ubuntu-current_i386.deb Installing Skype repository Ihis has an advantage of maintaining updates automatically. Install the respository security key. (This requires an open port 11371 in your firewall for the keyserver.) #sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 0xd66b746e Add the Skype repository, update, and install Skype: #echo "deb http://download.skype.com/linux/repos/debian/ stable non-free" | sudo tee -a /etc/apt/sources.list > /dev/null #sudo apt-get update #sudo apt-get install skype => Wengophone Wengophone is an integrated VOIP and videoconferencing client available on many platforms. Wengophone was initially an open-source GPL-licensed package ('Wengophone Classic'). Both the Classic version (available as a .deb file) and the current proprietary binary version are available from the website. Wengophone Classic has now been rebranded as QuteCom, however. To install the current version as an Ubuntu/Kubuntu package, see these instructions. Download and install the older Wengophone Classic version (.deb package): #wget http://download.wengo.com/wengophone/rc/wengophone-0.958m-1.i386.deb #dpkg -i --force-architecture wengophone-0.958m-1.i386.deb => Gizmo5 Gizmo5 is an Internet soft-phone application, similar to Skype, that uses the SIP protocol. Install (.deb package): #wget http://download.gizmo5.com/GizmoDownload/gizmo-project_3.1.0.79_libstdc++6_i386.deb #dpkg -i --force-architecture gizmo-project_3.1.0.79_libstdc++6_i386.deb => Asterisk VOIP PBX system Asterisk is an enterprise-grade, free open source PBX and telephony system for VOIP. #sudo apt-get install asterisk => Kiax Kiax is an LGPL-licensed open source IAX (Inter-Asterisk eXchange) application. It is used for making VoIP calls from an Asterisk PBX. The current version must be installed from source files. See the website for download and installation instructions, or see this Ubuntu Launchpad site. https://launchpad.net/ubuntu/jaunty/+package/kiax => OpenSIPS / OpenSER (SIP server)S Application Server, and xvfb. # sudo apt-get sun-java6-jre jbossas4 xvfb For more details on setting this up in (K)Ubuntu, see this. => TeamViewer TeamViewer is a proprietary cross-platform package that enables up to 25 participants to share a desktop for online meetings and provides a mechanism for users to control a PC's desktop remotely. Presentations can be viewed through most Internet web browsers, as well. A free .deb package can be downloaded here. http://www.teamviewer.com/en/download/index.aspx#downOpenSIPS is an open-source SIP server that allows connections to be made through the Internet for VoIP, IM, and other communications protocols. While there are many public SIP servers, these are subject to spoofing and other "impersonation" problems. A company may wish to host its own SIP server to avoid the problems inherent in public services whose trustworthiness can not be determined. OpenSIPS is the successor to OpenSER (which is the version in the repositories). Install OpenSER 1.3.2 from the repositories: # sudo apt-get install openser Alternately, the newest version of OpenSIPS can be downloaded as a .deb package from the website and installed. Installation and usage instructions are on the website. # Telepathy Telepathy is a flexible, modular communications framework that enables real-time VOIP/chat communication via pluggable protocol backends (for protocols such as Jabber/XMPP/Google Talk/Jingle, link-local XMPP, SIP, MSN, Yahoo/AIM and IRC). Telepathy is a communications service that can be simultaneously accessed by many client applications (primarily Empathy), using QT4, Glib, and GtK libraries. Currently a version for the Gnome desktop (telepathy-gnome) is available. Install: # sudo apt-get install telepathy-gnome Web meetings -------------------- Web meeting software allows video conferencing among many clients, with one server as host. => BigBlueButton BigBlueButton is a free open source chat/video/audio and desktop sharing platform similar to GoToMeeting, WebEx, DimDim and similar products. Developed by GoogleCode, it utilises all open-source modules. A Moodle plugin is also available. See these installation instructions and these additional detailed instructions. http://code.google.com/p/bigbluebutton/wiki/InstallationUbuntu => WebHuddle WebHuddle is a free, open source Java-based browser client (and server) for web meetings. To install the server, first install pre-requisites, including Java, JBO SloadAreaLinux ========= Privacy ========= An interesting perspective on Internet privacy techniques can be found here. =>PGP (Message Encryption) =>PGP (OpenPGP and GnuPG) is a tool to encrypt your messages (such as email) to be unlocked only by someone who has a key to unlock it. Enigmail with Thunderbird By far the easiest method for encrypting email is using the Enigmail add-on for the Thunderbird email client. It creates PGP key pairs, stores and retrieves keys from keyrings, and encrypts and decrypts messages automatically. Seahorse -------------- Seahorse is the GUI for Gnome to manage the key pairs and other options of GnuPG. It can also manage your SSH keys. For more info see this tutorial. Run: Menu -> Applications -> Accessories --> Passwords and Encryption Keys Tor (Network Privacy) -------------------------------- Tor is a project to allow privacy while using the Internet and to limit usage tracking. It routes your traffic through several anonymous nodes, so that your usage appears to come from an IP other than your own. (There are always risks when using the Internet that even Tor can not help with, though. Read this.) Using Tor can slow down your Internet usage significantly, depending on how much traffic is being passed through the Tor network (routine file-sharing or large downloads will also significantly reduce performance of the Tor network.) Install the Privoxy http proxy: ---------------------------------------- # sudo apt-get install privoxy Install Tor by following the instructions here. Note that the instructions require port 11371 on your firewall to be open to use the gpg keyserver (and download the key for the debian package). Then see the Tor installation guide for details. For more installation tips, see this page. Vidalia (Tor interface) Vidalia is the recommended Qt4-based GUI frontend for Tor. If not installed with Tor, install: #sudo apt-get install vidalia Torbutton (Firefox plug-in) Once Tor is installed and running properly, Torbutton allows you to choose whether to use Firefox through the Tor anonymizing network or not. Install the .xpi extension directly from the website. =============================== DNS Servers and Search engines ===============================: 16:9 Widescreen to 4:3 Letterbox Preset command: -target ntsc-dvd -s 648x364 -padleft 36 -padright 36 -padtop 58 -padbottom 58 Ouput file extension: mpg -> Category: DVD -> Add/Update -> Save => To convert to MPEG-4 (mp4) files, use #ffmpeg -i samplevideo.flv outputvideo.mp4 =>FFMpegThe DNS server setting can be changed in the router's settings (recommended) or individually for each computer. If changing on an individual computer, use the Network Manager or Wicd settings, or edit /etc/resolv.conf manually and change the nameservers to the addresses you desire to use: #sudo gedit /etc/resolv.conf #sudo gedit/etc/host ============================================ Audio / Video conversion for meeting ============================================ Here is a nice review of some of the applications that enables conversion and handling of these types of files. Some specific examples and suggestions are here. FFMPEG video / audio conversion FFMPEG is the swiss-army knife of video and audio format conversion. It succeeds when no other program can. It is free and open source. If it not yet installed on your system as part of another package (it is used by many video/audio editors), then install it: #sudo apt-get install ffmpeg To convert many different formats, read the FFMPEG documentation. Also see this tutorial. Example: To convert a saved Flash video (.flv) to an MPEG-2 format playable on a DVD, convert: #ffmpeg -i samplevideo.flv -target ntsc-dvd samplevideo.mpg Then use K3b (or Gnomebaker) to write the mpg file to a New DVD Data Project. For PAL use -target pal-dvd. For widescreen, use -target film -dvd. -target parameter For other conversion tips, see this forum. (Note: Most Flash video has very low resolution, with a screen size of 360x270, for example. You may see a slight diminishment in resolution if you wish to convert it to 720x480 (which is the NTSC standard size) or other screen size. You can keep the original screen size and resolution by omitting the -target parameter.) If your original file is 16:9 widescreen and you desire a 4:3 letterbox output for playing on an overscanned TV, you may need to pad the file so that the widescreen is not compressed (see this forum): #ffmpeg -i samplevideo.flv -target ntsc-dvd -s 648x364 -padleft 36 -padright 36 -padtop 58 -padbottom 58 samplevideo.mpg You can also use the WinFF GUI and add the command (as above) as a "Preset," for subsequent use. For example: Video converter (WinFF) -> Edit -> Presets -> Preset Name: Letterbox -> Preset Labe l requires that multiple restricted extra codecs be installed. This can be done in a single easy step from the command-line Terminal: #sudo apt-get install ubuntu-restricted-extras FFMPEG GUI ------------------- WinFF is a free, GPL-licensed open source GUI frontend for FFMPEG. Install: #sudo apt-get install winff xterm Run: Menu -> Applications -> Sound & Video -> WinFF Join video segments Individual video segments (MPEG-2, for example) can easily be joined: # cat samplevideo1.mpg samplevideo2.mpg samplevideo3.mpg > samplevideo123.mpg You can then write the resulting MPEG-2 file to a DVD and play it in most DVD players. =>Split a file into segments Any file can be split into segments using the Linux command: # split -b 1440k my_big_file which will split my_big_file into equal segments of size 1440 kb. => Mencoder Mencoder is part of the MPlayer set of libraries (that also uses several of the FFMPEG libraries) for audio/visual conversion. Some examples of usage are here. Save any streaming Flash video An easy way is to install the Video Download Helper plug-in for Firefox. Otherwise, most Flash videos download to the /tmp directory while you watch the video, creating a randomly-named video file there (such as Flashuh4G6s). When you close the webpage, this file in the /tmp directory will be erased. After the entire video has downloaded, but before you close the webpage, copy that file (such as Flashuh4G6s) to your home directory (where it will not be erased). Of course, for this to work, you must change your Flash (or Gnash) settings to allow an unlimited buffer. While watching your Flash video, right click to bring up the Flash -> Settings window. Set the Buffer to "Unlimited." Once you have copied the file, rename it appropriately with the .flv added to the filename. You can then watch it using VLC or Mplayer. Here is another method that involves making a symbolic link. Save rtmp / flv streams flvstreamer is a command-line application to dump rtmp streams. Install: #sudo apt-get install flvstreamer Example of usage: #flvstreamer -r "rtmp://host/dir/file.flv" -o filename.flv If you see the following the "WARNING: Download may be incomplete, try --resume!" message, try to use the --resume option: #flvstreamer -r "rtmp://host/dir/file.flv" -o filename.flv --resume => Convert Flash video audio to mp3krooge (Personal Finance Management) Skrooge is a free, GPL-licensed personal finances manager written for the KDE desktop that is able to import/export data to/from many other finance managers. #sudo apt-get install skrooge => Moneydance (Personal Finance Management) Moneydance is a commerciOnce you have downloaded flash video content (.flv) from the Internet (using the Video Download Helper plug-in for Firefox, for example), the audio component can be converted to an mp3 using this command (from the command line Terminal). (This will work for any type of video file, not just Flash.) # ffmpeg -i nameofvideoclip.flv -ab 160k -ac 2 -ar 44100 -vn nameoffile.mp3 where -i indicates the input, -ab indicates the bit rate (in this example 160kb/sec), -vn means no video ouput, -ac 2 means 2 channels, -ar 44100 indicates the sampling frequency. See FFMPEG docs for more info. => DVD Author ========== DVD author allows you to create menus and format your MPEG-2 videos onto a DVD disc so that you can play it in a commercial DVD player. DVD Author is a command line tool, but several GUI's exist. Install: #sudo apt-get install dvdauthor Android SDK emulator The 32-bit Linux Android Android emulator and SDK requires the Android SDK for Linux, ia32-libs, and sun-java6-jdk. http://developer.android.com/sdk/index.html Once the Android emulator SDK is installed, install an app using these ADB instructions. http://developer.android.com/guide/developing/tools/adb.html ============== Office Suites ============== =>LibreOffice LibreOffice is a free and open source (GPL-licensed) office suite similar to OpenOffice. Install: #sudo add-apt-repository ppa:libreoffice/ppa #sudo apt-get update #sudo apt-get install libreoffice libreoffice-gnome ==================== Financial Software ==================== For a brief introduction, see this list of 10 Linux financial tools. => KMyMoney (Personal Finance Management) KMyMoney is a personal finance manager that uses double entry accounting, the method professional accountants use. It is similar to MS-MyMoney and Intuit Quicken, with automatic setup of categories for businesses. It is designed for the KDE/Kubuntu desktop (but will work in Gnome/Ubuntu). Install: #sudo apt-get install kmymoney2 =>GnuCash (Personal Finance Management) GnuCash is a free, open source GPL-licensed personal finance manager that uses double entry accounting like professional accountants. It is GTK-based (Gnome 2). The current version can be installed from source files (see the website for installation instructions), or the package version can be installed: #sudo apt-get install gnucash => Sal cross-platform Java-based personal finance manager similar to KMyMoney that sells for $50 per license. http://moneydance.com/ => SQL-Ledger (Enterprise Finance Management) SQL-Ledger ERP is a free, open-source, platform independent double-accounting-method system and enterprise resource planner (inventory, work and purchase orders, taxes, etc.) that uses the SQL database server (PostgreSQL/Oracle/Mysql databases). It uses a web browser for an interface and be accessed remotely. It is extremely comprehensive and is available in many languages. Install: #sudo apt-get install sql-ledger => LedgerSMB (Enterprise Finance Management) LedgerSMB is a fork of the SQL-Ledger project that offers fairly solid AR, AP, and GL tracking as well as inventory control. It is in rapid development and encourages community support. A Debian (.deb) package is available here. => WebERP (Enterprise Finance Management) WebERP is a free, open-source enterprise resource planner and accounting suite similar to SQL-Ledger that uses a web browser as an interface. It runs on the LAMP server. It is somewhat difficult to implement and use, but conforms to strict accounting guidelines. Set up your LAMP server first, then install using the web site instructions. http://www.weberp.org/HomePage http://ubuntuguide.dyndns.info/index.php/Ubuntu:Oneiric#LAMP_server_installation => Phreebooks (Enterprise Finance Management) Phreebooks is a free open-source enterprise resource planner and accounting suite similar to WebERP. It also runs on a LAMP server. It is in active development in 2008. A demo is available at the website. http://www.phreesoft.com/index.php http://ubuntuguide.dyndns.info/index.php/Ubuntu:Oneiric#LAMP_server_installation =>Quasar (Enterprise Finance Management) Quasar is a proprietary Linux-based accounting suite similar to Quickbooks. For a single user without point-of-sale or networking needs, it is free. For other users it costs CA$500 per seat. An installer for KDE-based systems is here. http://www.linuxcanada.com/ ================================= Stock Market monitoring software ================================= =>BeanCounter - A stock portfolio performance monitoring tool. Install: #sudo apt-get install beancounter http://dirk.eddelbuettel.com/code/beancounter.html => Smtm - Show Me The Money is a configurable Perl/Tk stock ticker program. Written by the creator of BeanCounter. #sudo apt-get install smtm http://dirk.eddelbuettel.com/code/smtm.html =>Qtstalker - commodity and stock market charting and technical analysis #sudo apt-get install qtstalker http://qtstalker.sourceforge.net/l is the leading open-source website creation and content collaboration tools. A modular approach to website buil=>JStock -- a Java based portfolio manager and stock market monitoring tool. See these installation instructions. http://jstock.sourceforge.net/help_install_upgrade.html#install-linux =============== Wiki software =============== Wiki software allows an organization to have a manual that can be edited by a number of collaborators. Wikipedia is the best known example. => MediaWiki MediaWiki is the free, open source server software that Wikipedia uses. It is scalable to very large uses. It runs on the LAMP server stack (which uses the MySQL database and is available as an installation option with the (K)ubuntu server), or it can be used with a postgreSQL database. See these detailed instructions. (Other instructions are also available here.) Install from the repositories: #sudo apt-get install mediawiki Edit the config file so it recognizes MediaWiki: #sudo nano /etc/mediawiki/apache.conf Uncomment (remove the #) the line: Alias /mediawiki /var/lib/mediawiki Restart apache2: #sudo /etc/init.d/apache2 restart Run/install MediaWiki by logging into: http://localhost/mediawiki You will be prompted for configuration variables to be set. The trickiest is the MySQL user/password. Hopefully you remember your MySQL superuser that you set at the time of LAMP (or MySQL) installation. Copy your local settings configuration file to /etc/mediawiki (and make a backup of the original): :: #sudo cp /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki #sudo mv /var/lib/mediawiki/config/LocalSettings.php /var/lib/mediawiki/config/LocalSettings_at_install.php Edit your configuration variables there: #sudo kate /etc/mediawiki/LocalSettings.php If you are using a virtual host server, make a symbolic link (named in this example mywiki) from your /usr/share/mediawiki installation folder to your /var/www folder: #sudo ln -s /usr/share/mediawiki /var/www/mywiki then make sure you have an apache2 virtual hosts configuration file (in /etc/apache2/sites-available) that points to /var/www/mywiki as the DocumentRoot. Make a symbolic link from your virtual host configuration file in /etc/apache2/sites-available to /etc/apache2/sites-enabled to enable it. Restart apache2 after enabling the sites. (Warning: MediaWiki is not secure at installation and can be easily hacked by new users. Do not publish your wiki to the Internet before reading all the instructions and changing the configuration file (LocalSettings.php) so that it is more secure.) You would then access the database at: http://my.virtualwikihost.org Web Publishing =============== => Drupal (Web content publishing) ------ Drup ading, from simple out-of-the-box websites to complex sites is possible with a short learning curve. Get more info on how to get started. Drupal requires an installation of a LAMP server stack; if you have not already installed LAMP, it will be installed along with Drupal. I have found it easier to use the MySQL database (the "M" in LAMP), but Drupal can also integrate with PostgreSQL if you have it installed. Drupal7 Drupal7 is available as a Debian package here. The package for your system (32-bit or 64-bit) can be downloaded and directly installed on a newer (K)Ubuntu OS, or the Debian repository can be added (as mentioned in the instructions on the download page) and then the package installed using a package manager such as Synaptic or KPackageKit. See these instructions for upgrading from Drupal6 to Drupal7. http://drupal.org/ http://drupal.org/documentation/understand http://packages.debian.org/sid/all/drupal7/download => Drupal6 (Web content publishing) Drupal6 is available as a package, or from the command-line terminal: #sudo apt-get install drupal6 After everything is installed (and the problems below sorted out), restart the apache2 server: #sudo /etc/init.d/apache2 restart Finish installation through your browser: http://localhost/drupal6/install.php You can then also see these installation tips for installing through the browser, then see these Drupal site building tips. A Drupal/Ubuntu users group is found at Drubuntu. Installation quirks => Exim vs. Postfix Exim and Postfix are mail handlers. I had installed Postfix at the time I installed my Ubuntu server (but was not using it). But Drupal6 uses Exim and therefore removes Postfix at installation and installs Exim instead. Therefore, it is better not to use Drupal6 on a mail server that uses Postfix. => WordPress WordPress is a popular free open source web content manager that started as a blog tool and now incorporates many publishing elements. For bloggers and small to medium-sized websites, WordPress provides the fastest installation and customization process with many modules. WordPress requires an installation of a LAMP server stack first. Then install: #sudo apt-get install wordpress Make a symbolic link from your Apache2 www folder to your installation folder and install a new MySQL database named localhost to use with WordPress: #sudo ln -s /usr/share/wordpress /var/www/wordpress #sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost Note: If you already know the name of your (virtual) host URL for WordPress, then use it as the name of your database instead of localhost. For example, my URL is mysite_x.homeserve.org so my command is:bin (currently version 5 ) package from Google Earth downloads. (You may alternatively downl#sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress mysite_x.homeserve.org If you will access your WordPress server through a virtual host, then create your virtual host configuration file in the /etc/apache2/sites-available folder. Once you have edited the file, make a symbolic link from it to the /etc/apache2/sites-enabled folder. Restart apache2: #sudo /etc/init.d/apache2 restart Install WordPress through a browser: http://localhost/wordpress or, if you are using a virtual host: http:/mysite_x.homeserve.org/wordpress Note: The Jaunty repositories contain version 2.7.1, which is subject to a security worm. If you install this version, please update immediately to the current version from the Tools -> Upgrade menu. (Alternatively, install the current source version from the website.) For the automatic updater to work, all the WordPress files, folders, and subfolders must be owned by www-data (which is also the owner of the apache2 process) prior to updating. #sudo chown -R www-data /usr/share/wordpress =>Joomla (Web content publishing) ------- Joomla is a powerful open source website creation and content management tool that allows website creation for use in every arena from the simple to complex corporate environments. Info for beginners is a good place to start. =>Scribus (Desktop publishing) Scribus is an open-source package that provides professional-appearing desktop publishing. #sudo apt-get install scribus =>Plone (Content Management System) Plone is a free, open source (GPL-licensed) multi-platform content management system used by many large organizations around the world. It is available with an integrated installer here. Some users have had some difficulties in Jaunty, due to changes in Python. =>Gallery (Photo album website) Gallery is a PHP-based method of presenting a photo album on a website. A Drupal interface is also available for Gallery2. Install: sudo apt-get install gallery2 => phpBB (Forums) -------------- phpBB is the leading open source platform for Forums. A LAMP server stack (or PostgreSQL database instead of MySQL) will be required and should be installed first. Then make sure the universe repositories are enabled and install: #sudo apt-get install phpbb3 ============== Maps and GPS ============== Google Earth ------------- Google Earth gives you an annotated eagle's eye view of our planet. This is a free proprietary package (you must accept the license to use this package). #sudo apt-get install googleearth-package #make-googleearth-package --force #Doubleclick on the resulting .deb file. -- or -- To install the latest Linux binary, download and save the GoogleEarthLinux .oad the previous version (4.3), named googleearth-linux-plus-4.3.7284.3916.bin or something similar.) wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin Then install: #chmod +x GoogleEarthLinux.bin #./GoogleEarthLinux.bin Run: K menu -> Internet -> Google Earth 3D planet viewer You should turn off the Google Earth -> View -> Atmosphere setting, or you might see clouds everywhere and the ground won't show up. Troubleshooting If Google Earth opens, shows the splash screen, and then crashes, you’re probably experiencing a common issue. Running ~/google-earth/googleearth in a terminal will show this error: ./googleearth-bin: relocation error: /usr/lib/i686/cmov/libssl.so.0.9.8: symbol BIO_test_flags, version OPENSSL_0.9.8 not defined in file libcrypto.so.0.9.8 with link time reference To fix this, browse to the folder you installed Google Earth into. (If you installed manually, this will be google-earth in your home folder.) Find the file libcrypto.so.0.9.8 and rename it to something else, like libcrypto.so.0.9.8.bak. Google Earth should now start correctly. #cd ~/google-earth #sudo mv libcrypto.so.0.9.8 libcrypto.so.0.9.8.bak #sudo ln -s /usr/lib/libcrypto.so.0.9.8 ~/google-earth/libcrypto.so.0.9.8 (Note: You can also specify /home/user/google-earth instead of ~/google-earth ). On my display, I had to disable desktop effects (K menu -> System -> System Settings -> Desktop -> Desktop Effects) to get the display to work. For other issues, see the Ubuntu help pages on Google Earth. Be careful of some of the suggestions there. For example, if you turned on OpenGL desktop effects (using K Menu -> System Settings -> Desktop -> Desktop Effects -> General -> Advanced Options) and your display goes blank and you can't restore it, you will have to edit the settings file manually from the command-line to reset your mistake. #nano ~/.kde/share/config/kwinrc In the section title [Compositing], under the line Backend=OpenGL (or whichever backend you had selected) change the line below it to read: Enabled=false The will reset your display and you can then reboot successfully into your default display (to try different settings from the menu again, if you wish). Uninstall Google Earth To uninstall run the uninstall shell script located in the /home/user/google-earth folder (or whichever folder you installed google-earth into). === GPS === Tux Mobil has a list of Linux applications for use with GPS devices, and compatible hardware. Two GPS packages are available from the Ubuntu/Kubuntu respositories: => Viking is a free open source package to view GPS data in maps, and to plot co-ordinates. This has been reviewed as the best Linux GPS mapping program. #sudo apt-get install vikingplatform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, and hobbyists interested in creating interactive objects or environments. See this tutorial. ============== Misc Software ============== JBidwatcher JBidwatcher is a Java-based application allowing you to monitor auctions, submit bids, snipe (bid at the=> GPS Drive is a free navigation software package that displays your position on a zoomable map using your GPS device. It is GTK-based but can be used in Kubuntu. It uses the gpsd daemon that interfaces with a variety of GPS hardware. A .deb package of the current version is also available from the website. Install: http://www.gpsdrive.de/download.shtml #sudo apt-get install gpsdrive => tangoGPS is a beautiful, lightweight GPS mapping program that uses map data from the Openstreetmap project. Is is a GPL-licensed open source project. A .deb package can be found here. http://www.tangogps.org/gps/cat/Download ===================== Software Development ===================== => Netbeans IDE ------------ Netbeans is a free open-source integrated development environment used to create applications using Ajax, Ruby, pHp, Groovy, Java, Javascript, C++, and other scripting tools. #sudo apt-get install netbeans => Eclipse IDE ----------- Eclipse is a free open-source cross-platform integrated development environment with plugin support for a large set of programming languages, e.g. Java, C/C++, Python, PHP. #sudo apt-get install eclipse ========================== Version control software ========================== Copies of software being developed at many different locations require a method to ensure that the multiple distributed copies remain synchronized. This can be done using a central repository or using a distributed synchronization technique. For further information, see the official Ubuntu documentation. Several version control platforms exist: Bazaar is sponsored by Canonical and also allows distributed synchronization. Also see the official Ubuntu documentation. Subversion. Now part of Apache, this is one of the most widely used systems and uses a central repository for synchronization. Also see the official Ubuntu documentation. CVS was previously the most widely used system. Also see the official Ubuntu documentation. --- Git => Git allows distributed synchronization and is currently one of the most widely used systems. Also see the Ubuntu community documentation. The --- git client can be installed: #sudo apt-get install git and the ======================== gitosis server software: ======================== #sudo apt-get install gitosis === CAD === => QCAD is a commercial CAD alternative to AutoCAD with a community open source edition. Install: #sudo apt-get install qcad => VariCAD is a commercial 3D CAD package for multiple platforms (including Linux). There is no open source or community version. http://www.varicad.com/ ==================== Amateur Electronics ==================== => Arduino --------- Arduino is an open-source electronics prototyping last moment), and otherwise track your auction-site experience. See the website for more details. http://www.jbidwatcher.com/ ============================= Partimage (Partition backup) ============================= Partimage is a free open-source utility to back up an entire partition into an .iso image. It can be used across a network, as well. Install and run: #sudo apt-get install partimage #sudo partimage Partimage cannot be used from within the partition you wish to backup. You will either have to run it from a different partition or from a LiveCD that contains it. (A serious limitation of Partimage is its inability to backup/restore split image files to/from multiple media (e.g. spanned DVDs/CDs), limiting its usefulness as an inexpensive cloning and distribution solution. Partition image backup/restoration must be to/from a single hard drive, large capacity USB stick, or networked storage space.)
Basic commands for Linux
scp filename user@ipaddor domain: ---> this colon define dest home folder
scp vr folder user@ipaddor domain: ---> this colon define dest home folder
ssh user@ip or domain
ssh root@www.xyz.com
ssh root@192.168.1.200
ssh -i ~.ssh/demo.pem root@192.168.1.20
ssh -i ~.ssh/demo.pem root@ec2.xxx.xxx.xxx.xxx.com
-i identity file crytocraphic key .pem
==============================================================Fedora 10 Enable GUI Root Login valid for all Redhat Distro== Q. How do I enable root login under Fedora 10 Gnome GUI l=========================================================== =ogin screen / manager?ule called pam_succeed_if.so. This module is designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated. One use is to select whether to load other modules based on this test. This module blocks root login using GUI. Login as root Log in aA. Fedora 10 uses pam mo ds normal user Then open GUI terminal (bash prompt) and type the following command to become root user: $ su - WARNING! These examples may crash your computer if not executed properly. It is recommended that you always login as normal user to avoid any damage to your system and then use su - to get root level access as required./pam.d/gdm' Find line that read as follows: aFedora 10 update GDM config to allow root login Type your root password. Next, make a backup of /etc/pam.d/gdm, enter: # cp /etc/pam.d/gdm /root Now open /etc/pam.d/gdm using gedit or vi text editor, enter: gedit /etc/pam.d/gdm OR # vi /etc/pam.d/gdm Alternatively, you can do everything in a one command: # su -c 'gedit /et cuth required pam_succeed_if.so user != root quiet Remove or comment out line by prefixing #. # auth required pam_succeed_if.so user != root quietSave and close the file. Logout from terminal and from GUI itself. Now you should be able login as root user using GDM GUI login manager.
No comments:
Post a Comment