Friday, April 25, 2008

Introducing Sysinstall

The sysinstall utility is the installation application provided by the FreeBSD Project. It is console based and is divided into a number of menus and screens that you can use to configure and control the installation process.

The sysinstall menu system is controlled by the arrow keys, Enter, Tab, Space, and other keys. A detailed description of these keys and what they do is contained in sysinstall's usage information.

To review this information, ensure that the Usage entry is highlighted and that the [Select] button is selected, as shown in Figure 2-5, then press Enter.

The instructions for using the menu system will be displayed. After reviewing them, press Enter to return to the Main Menu.

Figure 2-5. Selecting Usage from Sysinstall Main Menu

Selecting the Documentation Menu

From the Main Menu, select Doc with the arrow keys and press Enter.

Figure 2-6. Selecting Documentation Menu

This will display the Documentation Menu.

Figure 2-7. Sysinstall Documentation Menu

It is important to read the documents provided.

To view a document, select it with the arrow keys and press Enter. When finished reading a document, pressing Enter will return to the Documentation Menu.

To return to the Main Installation Menu, select Exit with the arrow keys and press Enter.

Selecting the Keymap Menu

To change the keyboard mapping, use the arrow keys to select Keymap from the menu and press Enter. This is only required if you are using a non-standard or non-US keyboard.

Figure 2-8. Sysinstall Main Menu

A different keyboard mapping may be chosen by selecting the menu item using up/down arrow keys and pressing Space. Pressing Space again will unselect the item. When finished, choose the [ OK ] using the arrow keys and press Enter.

Only a partial list is shown in this screen representation. Selecting [ Cancel ] by pressing Tab will use the default keymap and return to the Main Install Menu.

Figure 2-9. Sysinstall Keymap Menu

Installation Options Screen

Select Options and press Enter.

Figure 2-10. Sysinstall Main Menu

Figure 2-11. Sysinstall Options

The default values are usually fine for most users and do not need to be changed. The release name will vary according to the version being installed.

The description of the selected item will appear at the bottom of the screen highlighted in blue. Notice that one of the options is Use Defaults to reset all values to startup defaults.

Press F1 to read the help screen about the various options.

Pressing Q will return to the Main Install menu.

Begin a Standard Installation

The Standard installation is the option recommended for those new to UNIX® or FreeBSD. Use the arrow keys to select Standard and then press Enter to start the installation.

taken from:

http://www.freebsd.org/doc/en/books/handbook/using-sysinstall.html

installasi freebsd

Starting the Installation

Important: By default, the installation will not make any changes to your disk(s) until you see the following message:

Last Chance: Are you SURE you want continue the installation?

If you're running this on a disk with data you wish to save then WE
STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before proceeding!

We can take no responsibility for lost disk contents!

The install can be exited at any time prior to the final warning without changing the contents of the hard drive. If you are concerned that you have configured something incorrectly you can just turn the computer off before this point, and no damage will be done.

Booting

Booting for the i386

  1. Start with your computer turned off.

  2. Turn on the computer. As it starts it should display an option to enter the system set up menu, or BIOS, commonly reached by keys like F2, F10, Del, or Alt+S. Use whichever keystroke is indicated on screen. In some cases your computer may display a graphic while it starts. Typically, pressing Esc will dismiss the graphic and allow you to see the necessary messages.

  3. Find the setting that controls which devices the system boots from. This is usually labeled as the “Boot Order” and commonly shown as a list of devices, such as Floppy, CDROM, First Hard Disk, and so on.

    If you needed to prepare boot floppies, then make sure that the floppy disk is selected. If you are booting from the CDROM then make sure that that is selected instead. In case of doubt, you should consult the manual that came with your computer, and/or its motherboard.

    Make the change, then save and exit. The computer should now restart.

  4. If you needed to prepare boot floppies, as described in Section 2.3.7, then one of them will be the first boot disc, probably the one containing boot.flp. Put this disc in your floppy drive.

    If you are booting from CDROM, then you will need to turn on the computer, and insert the CDROM at the first opportunity.

    If your computer starts up as normal and loads your existing operating system, then either:

    1. The disks were not inserted early enough in the boot process. Leave them in, and try restarting your computer.

    2. The BIOS changes earlier did not work correctly. You should redo that step until you get the right option.

    3. Your particular BIOS does not support booting from the desired media.

  5. FreeBSD will start to boot. If you are booting from CDROM you will see a display similar to this (version information omitted):

    Booting from CD-Rom...
    CD Loader 1.2

    Building the boot loader arguments
    Looking up /BOOT/LOADER... Found
    Relocating the loader and the BTX
    Starting the BTX loader

    BTX loader 1.00 BTX version is 1.01
    Console: internal video/keyboard
    BIOS CD is cd0
    BIOS drive C: is disk0
    BIOS drive D: is disk1
    BIOS 639kB/261120kB available memory

    FreeBSD/i386 bootstrap loader, Revision 1.1

    Loading /boot/defaults/loader.conf
    /boot/kernel/kernel text=0x64daa0 data=0xa4e80+0xa9e40 syms=[0x4+0x6cac0+0x4+0x88e9d]
    \

    If you are booting from floppy disc, you will see a display similar to this (version information omitted):

    Booting from Floppy...
    Uncompressing ... done

    BTX loader 1.00 BTX version is 1.01
    Console: internal video/keyboard
    BIOS drive A: is disk0
    BIOS drive C: is disk1
    BIOS 639kB/261120kB available memory

    FreeBSD/i386 bootstrap loader, Revision 1.1

    Loading /boot/defaults/loader.conf
    /kernel text=0x277391 data=0x3268c+0x332a8 |

    Insert disk labelled "Kernel floppy 1" and press any key...

    Follow these instructions by removing the boot.flp disc, insert the kern1.flpEnter. Boot from first floppy; when prompted, insert the other disks as required. disc, and press

  6. Whether you booted from floppy or CDROM, the boot process will then get to the FreeBSD boot loader menu:

    Figure 2-1. FreeBSD Boot Loader Menu

    Either wait ten seconds, or press Enter.

2.4.1.2 Booting for the Alpha

  1. Start with your computer turned off.

  2. Turn on the computer and wait for a boot monitor prompt.

  3. If you needed to prepare boot floppies, as described in Section 2.3.7 then one of them will be the first boot disc, probably the one containing boot.flp. Put this disc in your floppy drive and type the following command to boot the disk (substituting the name of your floppy drive if necessary):

    >>>BOOT DVA0 -FLAGS '' -FILE '' 

    If you are booting from CDROM, insert the CDROM into the drive and type the following command to start the installation (substituting the name of the appropriate CDROM drive if necessary):

    >>>BOOT DKA0 -FLAGS '' -FILE '' 
  4. FreeBSD will start to boot. If you are booting from a floppy disc, at some point you will see the message:

    Insert disk labelled "Kernel floppy 1" and press any key...

    Follow these instructions by removing the boot.flp disc, insert the kern1.flpEnter. disc, and press

  5. Whether you booted from floppy or CDROM, the boot process will then get to this point:

    Hit [Enter] to boot immediately, or any other key for command prompt.
    Booting [kernel] in 9 seconds... _

    Either wait ten seconds, or press Enter. This will then launch the kernel configuration menu.

2.4.1.3 Booting for Sparc64®

Most Sparc64® systems are set up to boot automatically from disk. To install FreeBSD, you need to boot over the network or from a CDROM, which requires you to break into the PROM (OpenFirmware).

To do this, reboot the system, and wait until the boot message appears. It depends on the model, but should look about like:

Sun Blade 100 (UltraSPARC-IIe), Keyboard Present
Copyright 1998-2001 Sun Microsystems, Inc. All rights reserved.
OpenBoot 4.2, 128 MB memory installed, Serial #51090132.
Ethernet address 0:3:ba:b:92:d4, Host ID: 830b92d4.

If your system proceeds to boot from disk at this point, you need to press L1+AStop+A on the keyboard, or send a BREAK over the serial console (using for example ~# in tip(1) or cu(1)) to get to the PROM prompt. It looks like this: or

ok         (1)
ok {0} (2)
(1)
This is the prompt used on systems with just one CPU.
(2)
This is the prompt used on SMP systems, the digit indicates the number of the active CPU.

At this point, place the CDROM into your drive, and from the PROM prompt, type boot cdrom.

Reviewing the Device Probe Results

The last few hundred lines that have been displayed on screen are stored and can be reviewed.

To review the buffer, press Scroll Lock. This turns on scrolling in the display. You can then use the arrow keys, or PageUp and PageDown to view the results. Press Scroll Lock again to stop scrolling.

Do this now, to review the text that scrolled off the screen when the kernel was carrying out the device probes. You will see text similar to Figure 2-2, although the precise text will differ depending on the devices that you have in your computer.

Figure 2-2. Typical Device Probe Results

avail memory = 253050880 (247120K bytes)
Preloaded elf kernel "kernel" at 0xc0817000.
Preloaded mfs_root "/mfsroot" at 0xc0817084.
md0: Preloaded image 4423680 bytes at 0xc03ddcd4

md1: Malloc disk
Using $PIR table, 4 entries at 0xc00fde60
npx0: on motherboard
npx0: INT 16 interface
pcib0: on motherboard
pci0: on pcib0
pcib1: at device 1.0 on pci0
pci1: on pcib1
pci1: at 0.0 irq 11
isab0: at device 7.0 on pci0
isa0: on isab0
atapci0: port 0xe000-0xe00f at device 7.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
uhci0 port 0xe400-0xe41f irq 10 at device 7.2 on pci
0
usb0: on uhci0
usb0: USB revision 1.0
uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr1
uhub0: 2 ports with 2 removable, self powered
pci0: (vendor=0x1106, dev=0x3040) at 7.3
dc0: port 0xe800-0xe8ff mem 0xdb000000-0xeb0003ff ir
q 11 at device 8.0 on pci0
dc0: Ethernet address: 00:04:5a:74:6b:b5
miibus0: on dc0
ukphy0: on miibus0
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ed0: port 0xec00-0xec1f irq 9 at device 10.
0 on pci0
ed0 address 52:54:05:de:73:1b, type NE2000 (16 bit)
isa0: too many dependant configs (8)
isa0: unexpected small tag 14
orm0:

Check the probe results carefully to make sure that FreeBSD found all the devices you expected. If a device was not found, then it will not be listed. A custom kernel allows you to add in support for devices which are not in the GENERIC kernel, such as sound cards.

For FreeBSD 6.2 and later, after the procedure of device probing, you will see Figure 2-3. Use the arrow key to choose a country, region, or group. Then press Enter, it will set your country and keymap easily. It is also easy to exit the sysinstall program and start over again.

Figure 2-3. Selecting Country Menu

Figure 2-4. Select Sysinstall Exit

Use the arrow keys to select Exit Install from the Main Install Screen menu. The following message will display:

                      User Confirmation Requested
Are you sure you wish to exit? The system will reboot
(be sure to remove any floppies/CDs/DVDs from the drives).

[ Yes ] No

The install program will start again if the CDROM is left in the drive and [ Yes ] is selected.

If you are booting from floppies it will be necessary to remove the boot.flp floppy before rebooting

taken from:

http://www.freebsd.org/doc/en/books/handbook/install-start.html

Saturday, April 19, 2008

Testing Link Status from the Command Line

Both the mii-tool and ethtool commands command will provide reports on the link status and duplex settings for supported NICs.

When used without any switches, the mii-tool gives a very brief report. Use it with the -v switch because it provides more information on the supported autonegotiation speeds of the NIC and this can be useful in troubleshooting speed and duplex issues.

The ethtool command provides much more information than mii-tool and should be your command of choice, especially because mii-tool will be soon deprecated in Linux. In both of the following examples the NICs are operating at 100Mbps, full duplex and the link is ok.


Link Status Output from mii-tool

[root@bigboy tmp]# mii-tool -v

eth0: 100 Mbit, full duplex, link ok
product info: Intel 82555 rev 4
basic mode: 100 Mbit, full duplex
basic status: link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 100baseTx-HD

[root@bigboy tmp]#

Link Status Output from ethtool

[root@bigboy tmp]# ethtool eth0

Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x00000007 (7)
Link detected: yes
[root@bigboy tmp]#
taken from :
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch04_:_Simple_Network_Troubleshooting


UNIX Tutorial One

1.1 Listing files and directories
ls (list)

When you first login, your current working directory is your home directory. Your home directory has the same name as your user-name, for example, ee91ab, and it is where your personal files and subdirectories are saved.

To find out what is in your home directory, type

% ls

The ls command lists the contents of your current working directory.

Unix Terminal - running the ls command

There may be no files visible in your home directory, in which case, the UNIX prompt will be returned. Alternatively, there may already be some files inserted by the System Administrator when your account was created.

ls does not, in fact, cause all the files in your home directory to be listed, but only those ones whose name does not begin with a dot (.) Files beginning with a dot (.) are known as hidden files and usually contain important program configuration information. They are hidden because you should not change them unless you are very familiar with UNIX!!!

To list all files in your home directory including those whose names begin with a dot, type

% ls -a

As you can see, ls -a lists files that are normally hidden.

Unix Terminal - running the ls command

ls is an example of a command which can take options: -a is an example of an option. The options change the behaviour of the command. There are online manual pages that tell you which options a particular command can take, and how each option modifies the behaviour of the command. (See later in this tutorial)
1.2 Making Directories
mkdir (make directory)

We will now make a subdirectory in your home directory to hold the files you will be creating and using in the course of this tutorial. To make a subdirectory called unixstuff in your current working directory type

% mkdir unixstuff

To see the directory you have just created, type

% ls
1.3 Changing to a different directory
cd (change directory)

The command cd directory means change the current working directory to 'directory'. The current working directory may be thought of as the directory you are in, i.e. your current position in the file-system tree.

To change to the directory you have just made, type

% cd unixstuff

Type ls to see the contents (which should be empty)
Exercise 1a

Make another directory inside the unixstuff directory called backups
1.4 The directories . and ..

Still in the unixstuff directory, type

% ls -a

As you can see, in the unixstuff directory (and in all other directories), there are two special directories called (.) and (..)
The current directory (.)

In UNIX, (.) means the current directory, so typing

% cd .

NOTE: there is a space between cd and the dot

means stay where you are (the unixstuff directory).

This may not seem very useful at first, but using (.) as the name of the current directory will save a lot of typing, as we shall see later in the tutorial.
The parent directory (..)

(..) means the parent of the current directory, so typing

% cd ..

will take you one directory up the hierarchy (back to your home directory). Try it now.

Note: typing cd with no argument always returns you to your home directory. This is very useful if you are lost in the file system.
1.5 Pathnames
pwd (print working directory)

Pathnames enable you to work out where you are in relation to the whole file-system. For example, to find out the absolute pathname of your home-directory, type cd to get back to your home-directory and then type

% pwd

The full pathname will look something like this -

/home/its/ug1/ee51vn

which means that ee51vn (your home directory) is in the sub-directory ug1 (the group directory),which in turn is located in the its sub-directory, which is in the home sub-directory, which is in the top-level root directory called " / " .

Unix File structure
Exercise 1b

Use the commands cd, ls and pwd to explore the file system.

(Remember, if you get lost, type cd by itself to return to your home-directory)
1.6 More about home directories and pathnames
Understanding pathnames

First type cd to get back to your home-directory, then type

% ls unixstuff

to list the conents of your unixstuff directory.

Now type

% ls backups

You will get a message like this -

backups: No such file or directory

The reason is, backups is not in your current working directory. To use a command on a file (or directory) not in the current working directory (the directory you are currently in), you must either cd to the correct directory, or specify its full pathname. To list the contents of your backups directory, you must type

% ls unixstuff/backups


~ (your home directory)

Home directories can also be referred to by the tilde ~ character. It can be used to specify paths starting at your home directory. So typing

% ls ~/unixstuff

will list the contents of your unixstuff directory, no matter where you currently are in the file system.

What do you think

% ls ~

would list?

What do you think

% ls ~/..

would list?
taken from :
http://www.ee.surrey.ac.uk/Teaching/Unix/

Building a Bluetooth network with Linux

 

About this document

Building a Bluetooth wireless network with Linux is easier than it may seem. This document is about connecting several computers in a TCP/IP network; it does not talk about other devices as phones, PDAs or printers.

Hardware

As a difference from WiFi hardware, where Linux support is a nightmare (blame the hardware companies, that keep their crappy specifications as military secrets), Bluetooth hardware support is pretty complete; you have a plethora of cheap and easy to find hardware in its USB or PCMCIA variants. See the complete list.

In my particular case, I've bought two Conceptronic CBT100U USB dongles (the ones with a little antenna), and a Conceptronic CBT100C PCMCIA card. All of them are on the Class1 family, with a maximum range of 100 meters; more than enough for my home.

I wanted to connect just two machines, a headless server and a laptop; I suppose this document applies to networks having more nodes (didn't try).

Software

The server runs Debian Linux with a 2.4.x kernel, and the laptop, Debian Linux with a 2.6.x. I compiled all Bluetooth options in the kernel as modules, and installed the following packages on both machines:

 bluez-hcidump - Analyses Bluetooth HCI packets
bluez-pcmcia-support - PCMCIA support files for BlueZ 2.0 Bluetooth tools
bluez-pin - Bluetooth PIN helper with D-BUS support
bluez-utils - Bluetooth tools and daemons
libbluetooth1 - Library to use the BlueZ Linux Bluetooth stack
bluez-firmware - Firmware for Bluetooth devices

Configuration

As a first step, I tried with the CBT100C USB dongles. Just by inserting them, hotplug detected them and loaded all the appropriate modules; after that, I could run the hcitool scan command on either system, and in some seconds both found each other.

The PCMCIA was a bit more complicated; this particular model needs the hciattach command to be ran after the serial_cs module from pcmcia tools is loaded, but the bluez-pcmcia-support Debian package didn't have the necessary information for it to work. So, after a bit of investigation, I needed to add the following to the /etc/pcmcia/bluetooth.conf file:

 card "Conceptronic CBT100C Bluetooth"
version "PCMCIA", "Bluetooth Card", "", ""
manfid 0x0279, 0x950b
bind "serial_cs" class "bluetooth"

This way, the pcmcia stack can recognize the card as a Bluetooth one, and run the /etc/pcmcia/bluetooth helper script.

But this was not sufficient; though correctly detected, the command didn't work as expected. Digging in the http://www.bluez.org mailing list archives (a very interesting source of information), I got the exact arguments to add to hciattach, so I patched the /etc/pcmcia/bluetooth script substituting the line

    /usr/sbin/hciattach $DEVICE $MANFID 

with

    sleep 5 ; /usr/sbin/hciattach $DEVICE bcsp

I found the 'sleep 5' also necessary; don't know of a good reason.

Running a TCP/IP stack over this mess

All this work is just to stablish a link layer; over that, we have to create a TCP/IP stack to use our favourite programs.

Bluetooth networks are structured in a similar manner as the WiFi ones; there are ad-hoc (point to point) and access point / clients topologies. See the Personal Area Network HOWTO for all the gory details. I decided to run my server as a NAP (Network Access Point) and my laptop as a PANU (PAN User).

The daemon that builds an interface (that will be managed by good old ifconfig) is called pand. On Debian, you can tweak /etc/defaults/bluez-utils to select running pand on startup; I configured it on my server this way:

 /usr/bin/pand -s -M --role=NAP

And on my laptop:

 /usr/bin/pand --role PANU --search --persist --encrypt

I found the --persist necessary; the connection between pairs is slow (almost one minute) and, without that argument, pand surrenders in a short number of seconds.

When the connection is stablished, pand creates the bnep0 interface. You can use ifconfig to configure that interface the same as eth0 and friends, so you can manually set IPs to each one, and after that, you have a working TCP/IP network.

I found rather tricky to make this network to correctly configure on startup; I filled a 'stanza' in /etc/network/interfaces for each one but, whenever the pand daemons in both machines made the connections, the interfaces didn't automatically go up. Finally, I found somewhere on the Internet the solution; when pand decides the bnep0 is ready, it executes the /etc/bluetooth/pan/dev-up script, that didn't exist on my system. I created it with the following:

 #!/bin/sh
ifup bnep0

And now everything sets up automatically.

Authorization and encryption

Bluetooth allows traffic to be encrypted and connections be established using a rudimentary, PIN based authorization. When asked for authorization and encryption, the whole system (as installed from Debian) didn't work reliably; sometimes, an X11 window was popped up asking me for the PIN; other times, it failed miserably without warning. Though I always have an X11 session opened, I don't like spurious windows popping up asking me for passwords; it seems to me like an invitation to security intrusions. Fortunately, the bluez people added a hook to change the PIN requester program; what I wanted, and probably everyone of you do, is to store the PIN to connect to your server somewhere and feed it to the underlying system whenever needed. So, I modified the /etc/bluetooth/hcid.conf config file this way:

 
# PIN helper
# pin_helper /usr/bin/bluez-pin;
pin_helper /usr/local/sbin/mypin

and created /usr/local/sbin/mypin, containing

 #!/bin/sh
PIN=`cat /etc/bluetooth/pin`
echo "PIN:$PIN"

This is only needed on the client; the server seem to find the PIN in /etc/bluetooth/pin without problems. Also, and though you'll see in examples everywhere 4 number PINs, it seems they can be arbitrarily long, so use longer strings.

Now all that I want is to get rid of the mandatory bluez-pin Debian package, that carries all X11 libraries and crappy GNOME stuff into my headless server for a /usr/bin/bluez-pin program that will never be called.

I don't know if Bluetooth encryption is really secure or is a joke; I don't even know if network packets are really travelling encrypted. But the line of faith must be drawn somewhere.

Hack to serve DHCP to Bluetooth clients

DHCP leases are useful from a sysadmin point of view: you can forget about maintaining boring lists of IPs and make interfaces configure themselves. Bluetooth networks aren't different, so you can set your dhcpd to serve IPs for your bnep clients (if authorization is active, they are served only to PIN-authenticated clients, so you can feel relatively safe). One caveat; bnep0 does not exist until a connection is established, and dhcpd refuses to monitor interfaces that don't exist. Even more, if the interface disappears because of a connection loss, dhcpd surrenders and stop listening to it. So, I had to add this hack to /etc/bluetooth/pan/dev-up in my access point server, that also serves as DHCP server:

 #!/bin/sh
ifup bnep0

# hack to force dhcpd to serve IPs on bnep0
/etc/init.d/dhcp3-server restart 2>&1 > /dev/null

Hope it's obvious; when the interface appears, the dhcp3-server is restarted so it always find a usable network interface to serve DHCP leases on.

taken from :
http://triptico.com/software/bluetooth.html


UNIX Introduction

What is UNIX?

UNIX® License PlateUNIX is an operating system which was first developed in the 1960s, and has been under constant development ever since. By operating system, we mean the suite of programs which make the computer work. It is a stable, multi-user, multi-tasking system for servers, desktops and laptops.

UNIX systems also have a graphical user interface (GUI) similar to Microsoft Windows which provides an easy to use environment. However, knowledge of UNIX is required for operations which aren't covered by a graphical program, or for when there is no windows interface available, for example, in a telnet session.
Types of UNIX

The Linux PenguinThere are many different versions of UNIX, although they share common similarities. The most popular varieties of UNIX are Sun Solaris, GNU/Linux, and MacOS X.

Here in the School, we use Solaris on our servers and workstations, and Fedora Linux on the servers and desktop PCs.
The UNIX operating system

The UNIX operating system is made up of three parts; the kernel, the shell and the programs.
The kernel

The kernel of UNIX is the hub of the operating system: it allocates time and memory to programs and handles the filestore and communications in response to system calls.

As an illustration of the way that the shell and the kernel work together, suppose a user types rm myfile (which has the effect of removing the file myfile). The shell searches the filestore for the file containing the program rm, and then requests the kernel, through system calls, to execute the program rm on myfile. When the process rm myfile has finished running, the shell then returns the UNIX prompt % to the user, indicating that it is waiting for further commands.
The shell

The shell acts as an interface between the user and the kernel. When a user logs in, the login program checks the username and password, and then starts another program called the shell. The shell is a command line interpreter (CLI). It interprets the commands the user types in and arranges for them to be carried out. The commands are themselves programs: when they terminate, the shell gives the user another prompt (% on our systems).

The adept user can customise his/her own shell, and users can use different shells on the same machine. Staff and students in the school have the tcsh shell by default.

The tcsh shell has certain features to help the user inputting commands.

Filename Completion - By typing part of the name of a command, filename or directory and pressing the [Tab] key, the tcsh shell will complete the rest of the name automatically. If the shell finds more than one name beginning with those letters you have typed, it will beep, prompting you to type a few more letters before pressing the tab key again.

History - The shell keeps a list of the commands you have typed in. If you need to repeat a command, use the cursor keys to scroll up and down the list or type history for a list of previous commands.

Files and processes

Everything in UNIX is either a file or a process.

A process is an executing program identified by a unique PID (process identifier).

A file is a collection of data. They are created by users using text editors, running compilers etc.

Examples of files:

* a document (report, essay etc.)
* the text of a program written in some high-level programming language
* instructions comprehensible directly to the machine and incomprehensible to a casual user, for example, a collection of binary digits (an executable or binary file);
* a directory, containing information about its contents, which may be a mixture of other directories (subdirectories) and ordinary files.

taken from :
http://www.ee.surrey.ac.uk/Teaching/Unix/unixintro.html


Linux Terminal Server Project

Linux Terminal Server Project (LTSP) is an add-on package for Linux that allows many people to simultaneously use the same computer. Applications run on the server with a terminal known as a thin client handling input and output. These thin clients are also known as X terminals. Generally, they are low-powered, lack a hard disk and are quieter than desktop computers. This is because they do not have any moving parts. LTSP is distributed under the terms of the GNU General Public License[1] and is thus free software.

This technology is becoming popular in schools as it allows the school to provide pupils access to computers without purchasing or upgrading expensive desktop machines. If the school does not have enough computers, new thin client machines are less costly than standard computers. If the school does have enough computers but they are a few years old, they may be able to extend the useful life of obsolescent computers by converting them into thin clients, since even a relatively slow CPU can deliver excellent performance as a thin client. Some examples of distributions using LTSP are AbulÉdu, the Cutter project, Deworks, Edubuntu, K12LTSP and Skolelinux.

In addition to the possibility of getting more performance for less money by getting one high-end server and turning their existing computers into thin clients, an educational institution may also gain more control over how their students are using computing resources by switching to a thin client configuration.

The founder and project leader of LTSP is Jim McQuillan.

taken from :
http://en.wikipedia.org/wiki/Linux_Terminal_Server_Project


What's New in LTSP-4.1.1?



Enhancements

  • X.org 6.8.2
    The latest release of X.org is now included in LTSP. This brings many updated drivers and enhancements. Take a look at www.x.org/XOrg_Press_Releases/X11R6.8.2.html for more Info.

  • Xorg Composite extension
    The new feature in X.org called Composite can now be enabled in lts.conf by adding the following to your lts.conf file:

    X_COMPOSITE = Y
    This will give you support for things like drop shadows and transparent windows. It's a really cool looking feature, but the performance hit is staggering. You'll need the X Composite Manager (xcompmgr) to enable the features.

  • 2.6.9 Kernel included
    We now have included a 2.6.9 kernel in the LTSP packages. We still don't have a simple way to configure swapping over the network. The NFS-Swap patch hasn't been ported to the 2.6 kernels yet, and while swapping over NBD can be used, we haven't had the chance to package it up for easy use within LTSP.

    This 2.6.9 kernel is provided for those people who need the additional capabilities that the 2.6 series brings, but the 2.4.26 kernel is still the officially supported kernel for LTSP.

  • Hotplug support for USB devices
    LTSP now includes the ability to plug in your USB devices, such as memory sticks, floppy drives, harddrives and cdrom drives. Just add the setting
    HOTPLUG = Y
    to your lts.conf file, and that will activate the hotplug subsystem. Samba is then used to export those devices back to the server. Take a look at the LocalDrives Wiki Article for more information about how to make those drives available to your user session.

  • lts.conf file now supports include directive
    You can now create config files for individual workstations, and then include them into your main lts.conf file. For example:

    [Default]
    SERVER = 192.168.0.254
    XSERVER = auto

    include /etc/lts.conf.ws001
    include /etc/lts.conf.ws002
    include /etc/lts.conf.ws003

    [ws004]
    XSERVER = i810

  • Ability to pass options to the mount command
    Recently, we've seen problems with servers running a 2.6 kernel and gigabit network card talking 10mbit clients. The default NFS blocksize has been increased in the 2.6 kernels to 32kb. The older 10mbit clients can't re-assemble the fragmented packets fast enough, so timeout errors occur. This can be fixed by passing options to the client, to fine-tune the mount command. For example, if you are using Etherboot, you should add the following to your dhcpd.conf file:

    option option-128 e4:45:74:68:00:00;
    option option-129 "MOPTS=nolock,ro,wsize=2048,rsize=2048";

    You might also try throwing ,proto=tcp in there, to use TCP instead of UDP.

  • DPMS Screen blanking options
    The X_DPMS option has been added to turn on/off the DPMS support in X.org 6.8.2. Also added several options to control the standby, suspend and off time. In summary, the new options for DPMS are:

    X_DPMS = Y/N
    X_DPMS_STANDBYTIME =
    X_DPMS_SUSPENDTIME =
    X_DPMS_OFFTIME =

  • USB Printers officially supported
    You could always use a USB printer with LTSP by telling lts.conf that the printer was a Parallel printer, and loading the printer kernel module. New with this release, you can specify PRINTER_x_TYPE = U in the lts.conf file. The printers kernel module will automatically be loaded
taken from
http://ltsp.sourceforge.net/ltsp-4.1.1.html


LTSP Version 4.1.1

An update to LTSP-4.1 is now available. This update fixes several minor bugs, and adds a few new features.

For those sites running LTSP-4.1, updating is a simple matter of running ltspadmin and install/Update LTSP Packages screen. The updated packages will be listed, and you can install from that screen.

For those sites not yet running LTSP, installation is exactly the same as LTSP-4.1 installation. Check the Installation Instructions for details on installing.

taken from :

http://ltsp.sourceforge.net/ltsp-4.1.1.html

Amazon.com Brings MP3 Music to Ubuntu

Amazon.com has quietly released its MP3 downloader program for Linux, with an available download for Ubuntu’s latest version, 7.10. So, what does this mean for Ubuntu users?

For the first time, Ubuntu users will have access to a mainstream music provider, with millions of songs and full albums from the top bands available. The songs are provided without Digital Rights Management, which is a controversial means of protecting media companies’ rights by limiting the times you can move music from one device or computer to another. DRM also effects the sound quality of a song. As a comparison, Apple’s iTunes service offers non-DRM songs for $1.29, while Amazon’s service offers the songs for 89 to 99 cents each.

You might be thinking, “This is great! But… how do I get it?” Here’s how:

Visit Amazon’s MP3 Downloads site, and click on the “Install the MP3 Downloader” link in the MP3 downloads bar near the top of the page. Then, you will be at the download page, which should detect that you are running Linux. You will see several links for different systems. Click on the one for Ubuntu 7.10 Gutsy. Then, a dialog will open asking you what you would like to do with the file. Make sure that the file will open with “GDebi.” After the file downloads, it will open in a dialog box that has a button that says “Install Package.” Then, click the install button.

After the application installs, you will find it under the “Internet” category in the “Applications” menu. After it installs, you can go to the MP3 downloads site, either via amazon.com or the link provided in the application, where you can purchase songs. A save dialog box will open when you download a song. Make sure “Open With” says that the Amazon downloader is selected to handle the download.

When you try to play the songs on Ubuntu, you may find that a MP3 codec is not installed. You can install it by going into Synaptic via the menu System > Administration > Synaptic Package Manager. Click on the “Search” button, and search “Fluendo.” Fluendo provides legal codecs that you can purchase, however the MP3 codec is provided for free. Install the gtreamer-0.10-fluendo-mp3 package by right-clicking the square box next to the name.

After it installs, you will have the full ability to purchase songs online and play them inside Rhythmbox. Amazon has made the right move by including Linux users into their service, while other large music providers have not. This is also a smart move, as with the release of a downloader for Ubuntu, Amazon has increased their user base by another 12 million potential users.

taken from :
http://allaboutubuntu.wordpress.com/2008/03/04/amazoncom-meets-ubuntu/

Dell: No Plans for Ubuntu Linux Servers

Canonical, promoter of Ubuntu Linux, has plenty of momentum on the desktop. But as Canonical gears up for a server push, one key Ubuntu partner plans to sit on the sidelines. Indeed, Dell has no plans to ship Ubuntu on its servers, according to a Dell source who spoke with The VAR Guy today.

First, a little history lesson. Dell in mid-2007 began pre-loading Ubuntu on selected desktops and notebooks. (Yes, The VAR Guy now has one.)

Plenty of folks — The VAR Guy included — assumed Dell would jump on the bandwagon as Canonical makes a stronger Ubuntu server push this year. That assumption was wrong, according to a member of Dell’s Linux team who chatted with The VAR Guy today.

Dell does plan to support Ubuntu 8.04 (code-named Hardy Heron) on selected desktops this spring or summer. (Here’s an early look at Ubuntu 8.04.) But it’s hard to blame Dell for taking a “wait and see” approach to Ubuntu on the server. After all, Red Hat and Novell are both firmly entrenched in the Linux server market.

And for Ubuntu to succeed on the server, it will need a critical mass of integrators, consultants and software developers willing to sell, service and support Ubuntu-centric systems.

To be sure, some companies are testing the Ubuntu server waters. Sun Microsystems continues to get cozier with Ubuntu on the server. And servers will be a big theme at the Ubuntu Live event scheduled for this July in Portland, Oregon.

Also, Canonical has introduced an administration tool — called Landscape — that could make Ubuntu servers and desktops easier to manage.

But this isn’t going to be a sprint. For Ubuntu to succeed on servers, Canonical will need to prepare for a marathon.

Related Coverage:

taken from :
http://www.thevarguy.com/2008/04/10/dell-no-plans-for-ubuntu-linux-servers/


Highlights of Ubuntu 8.04 Beta

After recently installing Ubuntu 8.04 Beta, I have seen numerous improvements that will bring welcome change to users in the near future. Now in beta stage, Ubuntu is stable enough for me or anyone else who is interesting in testing the new version. While I have not seen any problems, it is not recommended for use on production machines. Here are some highlights.

The first major feature is the inclusion of Firefox 3 Beta 4. The +GTKuse in the application blends in well by using the system icons and tabs. Firefox 3 has been declared ready for release by Mozilla, although it the official release of Firefox 3 is said to be in June, nearly two months after Ubuntu’s next release.

For all of those ATI graphics card users who are using the older cards, help is on the way! On Ubuntu 7.10, I could only get graphics acceleration. Now, I was able to get the 3-D desktop working, and it was enabled by default upon installing the driver via the Hardware Manager (Restricted Drivers Manager) and a quick reboot.

I have noticed a speed increase on both startup and shutdown. Another welcome site was the splash screen working on default. With Ubuntu 7.10, I had to edit the usplash.conf file in order to get the splash screen to show. It was pretty easy following guides in the forums, but after a while of reinstalling Ubuntu and other distributions, it got a little tiring. Thankfully, this bug has been fixed in the Hardy Heron release.

There is also a new theme in the beta release, which has been implemented through Alpha 5 and Beta 1 of Ubuntu 8.04. It is a bit more orange theme, with a new background, login screen, and some new icons, although the Human icon set is still the preferred option, coming defalt with the theme.

There are plenty of new features and applications to go around, and there will likely be more updates to come as many of the major applications have new releases. Ubuntu 8.04 Beta 1 is looking strong, and will form the base of a new and stunning release. Ubuntu 8.04 will be a LTS release, with three years of support on the desktop, and 5 years of support on the server.

taken from :
http://allaboutubuntu.wordpress.com/2008/03/26/highlights-of-ubuntu-804-beta/#more-206

Friday, April 18, 2008

GNU Free Documentation License

Version 1.2, November 2002

Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.

A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.

The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.

A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.

A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition.

The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

* A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
* B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
* C. State on the Title page the name of the publisher of the Modified Version, as the publisher.
* D. Preserve all the copyright notices of the Document.
* E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
* F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
* G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
* H. Include an unaltered copy of this License.
* I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
* J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
* K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
* L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
* M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.
* N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.
* O. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.

You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements."

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.

If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.

taken from:
http://linux.about.com/library/bl/open/blgnu_fdl.htm


Automatically re-start script as root

If you use sudo you can automatically re-start scripts that need to be run as root by adding a check at the beginning of the script and executing sudo if the script is not running as root:

if [[ $UID -ne 0 ]]; then
sudo -p 'Restarting as root, password: ' bash $0 "$@"
exit $?
fi

The inclusion of "bash" in the sudo command is to avoid problems if the script does not have its execute bit set. The "exit $?" causes the shell to exit with the status from the script instance that sudo runs.

taken from :
http://www.linuxjournal.com/content/automatically-re-start-script-root-0


Linux / Unix Command: find

NAME
find - search for files in a directory hierarchy
EXAMPLES
SEE ALSO
locate(1L), locatedb(5L), updatedb(1L), xargs(1L)
SYNOPSIS
find [path...] [expression]
DESCRIPTION
This manual page documents the GNU version of find. find searches the directory tree rooted at each given file name by evaluating the given expression from left to right, according to the rules of precedence (see section OPERATORS), until the outcome is known (the left hand side is false for and operations, true for or), at which point find moves on to the next file name.

The first argument that begins with `-', `(', `)', `,', or `!' is taken to be the beginning of the expression; any arguments before it are paths to search, and any arguments after it are the rest of the expression. If no paths are given, the current directory is used. If no expression is given, the expression `-print' is used.

find exits with status 0 if all files are processed successfully, greater than 0 if errors occur.
EXPRESSIONS
The expression is made up of options (which affect overall operation rather than the processing of a specific file, and always return true), tests (which return a true or false value), and actions (which have side effects and return a true or false value), all separated by operators. -and is assumed where the operator is omitted. If the expression contains no actions other than -prune, -print is performed on all files for which the expression is true.
OPTIONS
All options always return true. They always take effect, rather than being processed only when their place in the expression is reached. Therefore, for clarity, it is best to place them at the beginning of the expression.

-daystart
Measure times (for -amin, -atime, -cmin, -ctime, -mmin, and -mtime) from the beginning of today rather than from 24 hours ago.
-depth
Process each directory's contents before the directory itself.
-follow
Dereference symbolic links. Implies -noleaf.
-help, --help
Print a summary of the command-line usage of find and exit.
-maxdepth levels
Descend at most levels (a non-negative integer) levels of directories below the command line arguments. `-maxdepth 0' means only apply the tests and actions to the command line arguments.
-mindepth levels
Do not apply any tests or actions at levels less than levels (a non-negative integer). `-mindepth 1' means process all files except the command line arguments.
-mount
Don't descend directories on other filesystems. An alternate name for -xdev, for compatibility with some other versions of find.
-noleaf
Do not optimize by assuming that directories contain 2 fewer subdirectories than their hard link count. This option is needed when searching filesystems that do not follow the Unix directory-link convention, such as CD-ROM or MS-DOS filesystems or AFS volume mount points. Each directory on a normal Unix filesystem has at least 2 hard links: its name and its `.' entry. Additionally, its subdirectories (if any) each have a `..' entry linked to that directory. When find is examining a directory, after it has statted 2 fewer subdirectories than the directory's link count, it knows that the rest of the entries in the directory are non-directories (`leaf' files in the directory tree). If only the files' names need to be examined, there is no need to stat them; this gives a significant increase in search speed.
-version, --version
Print the find version number and exit.
-xdev
Don't descend directories on other filesystems.

TESTS
Numeric arguments can be specified as

+n
for greater than n,
-n
for less than n,
n
for exactly n.
-amin n
File was last accessed n minutes ago.
-anewer file
File was last accessed more recently than file was modified. -anewer is affected by -follow only if -follow comes before -anewer on the command line.
-atime n
File was last accessed n*24 hours ago.
-cmin n
File's status was last changed n minutes ago.
-cnewer file
File's status was last changed more recently than file was modified. -cnewer is affected by -follow only if -follow comes before -cnewer on the command line.
-ctime n
File's status was last changed n*24 hours ago.
-empty
File is empty and is either a regular file or a directory.
-false
Always false.
-fstype type
File is on a filesystem of type type. The valid filesystem types vary among different versions of Unix; an incomplete list of filesystem types that are accepted on some version of Unix or another is: ufs, 4.2, 4.3, nfs, tmp, mfs, S51K, S52K. You can use -printf with the %F directive to see the types of your filesystems.
-gid n
File's numeric group ID is n.
-group gname
File belongs to group gname (numeric group ID allowed).
-ilname pattern
Like -lname, but the match is case insensitive.
-iname pattern
Like -name, but the match is case insensitive. For example, the patterns `fo*' and `F??' match the file names `Foo', `FOO', `foo', `fOo', etc.
-inum n
File has inode number n.
-ipath pattern
Like -path, but the match is case insensitive.
-iregex pattern
Like -regex, but the match is case insensitive.
-links n
File has n links.
-lname pattern
File is a symbolic link whose contents match shell pattern pattern. The metacharacters do not treat `/' or `.' specially.
-mmin n
File's data was last modified n minutes ago.
-mtime n
File's data was last modified n*24 hours ago.
-name pattern
Base of file name (the path with the leading directories removed) matches shell pattern pattern. The metacharacters (`*', `?', and `[]') do not match a `.' at the start of the base name. To ignore a directory and the files under it, use -prune; see an example in the description of -path.
-newer file
File was modified more recently than file. -newer is affected by -follow only if -follow comes before -newer on the command line.
-nouser
No user corresponds to file's numeric user ID.
-nogroup
No group corresponds to file's numeric group ID.
-path pattern
File name matches shell pattern pattern. The metacharacters do not treat `/' or `.' specially; so, for example,
find . -path './sr*sc'
will print an entry for a directory called './src/misc' (if one exists). To ignore a whole directory tree, use -prune rather than checking every file in the tree. For example, to skip the directory `src/emacs' and all files and directories under it, and print the names of the other files found, do something like this:
find . -path './src/emacs' -prune -o -print
-perm mode
File's permission bits are exactly mode (octal or symbolic). Symbolic modes use mode 0 as a point of departure.
-perm -mode
All of the permission bits mode are set for the file.
-perm +mode
Any of the permission bits mode are set for the file.
-regex pattern
File name matches regular expression pattern. This is a match on the whole path, not a search. For example, to match a file named `./fubar3', you can use the regular expression `.*bar.' or `.*b.*3', but not `b.*r3'.
-size n[bckw]
File uses n units of space. The units are 512-byte blocks by default or if `b' follows n, bytes if `c' follows n, kilobytes if `k' follows n, or 2-byte words if `w' follows n. The size does not count indirect blocks, but it does count blocks in sparse files that are not actually allocated.
-true
Always true.
-type c
File is of type c:

b
block (buffered) special
c
character (unbuffered) special
d
directory
p
named pipe (FIFO)
f
regular file
l
symbolic link
s
socket
D
door (Solaris)

-uid n
File's numeric user ID is n.
-used n
File was last accessed n days after its status was last changed.
-user uname
File is owned by user uname (numeric user ID allowed).
-xtype c
The same as -type unless the file is a symbolic link. For symbolic links: if -follow has not been given, true if the file is a link to a file of type c; if -follow has been given, true if c is `l'. In other words, for symbolic links, -xtype checks the type of the file that -type does not check.

ACTIONS

-exec command ;
Execute command; true if 0 status is returned. All following arguments to find are taken to be arguments to the command until an argument consisting of `;' is encountered. The string `{}' is replaced by the current file name being processed everywhere it occurs in the arguments to the command, not just in arguments where it is alone, as in some versions of find. Both of these constructions might need to be escaped (with a `\') or quoted to protect them from expansion by the shell. The command is executed in the starting directory.
-fls file
True; like -ls but write to file like -fprint.
-fprint file
True; print the full file name into file file. If file does not exist when find is run, it is created; if it does exist, it is truncated. The file names ``/dev/stdout'' and ``/dev/stderr'' are handled specially; they refer to the standard output and standard error output, respectively.
-fprint0 file
True; like -print0 but write to file like -fprint.
-fprintf file format
True; like -printf but write to file like -fprint.
-ok command ;
Like -exec but ask the user first (on the standard input); if the response does not start with `y' or `Y', do not run the command, and return false.
-print
True; print the full file name on the standard output, followed by a newline.
-print0
True; print the full file name on the standard output, followed by a null character. This allows file names that contain newlines to be correctly interpreted by programs that process the find output.
-printf format
True; print format on the standard output, interpreting `\' escapes and `%' directives. Field widths and precisions can be specified as with the `printf' C function. Unlike -print, -printf does not add a newline at the end of the string. The escapes and directives are:

\a
Alarm bell.
\b
Backspace.
\c
Stop printing from this format immediately and flush the output.
\f
Form feed.
\n
Newline.
\r
Carriage return.
\t
Horizontal tab.
\v
Vertical tab.
\\
A literal backslash (`\').
\NNN
The character whose ASCII code is NNN (octal).

A `\' character followed by any other character is treated as an ordinary character, so they both are printed.

%%
A literal percent sign.
%a
File's last access time in the format returned by the C `ctime' function.
%Ak
File's last access time in the format specified by k, which is either `@' or a directive for the C `strftime' function. The possible values for k are listed below; some of them might not be available on all systems, due to differences in `strftime' between systems.

@
seconds since Jan. 1, 1970, 00:00 GMT.

Time fields:

H
hour (00..23)
I
hour (01..12)
k
hour ( 0..23)
l
hour ( 1..12)
M
minute (00..59)
p
locale's AM or PM
r
time, 12-hour (hh:mm:ss [AP]M)
S
second (00..61)
T
time, 24-hour (hh:mm:ss)
X
locale's time representation (H:M:S)
Z
time zone (e.g., EDT), or nothing if no time zone is determinable

Date fields:

a
locale's abbreviated weekday name (Sun..Sat)
A
locale's full weekday name, variable length (Sunday..Saturday)
b
locale's abbreviated month name (Jan..Dec)
B
locale's full month name, variable length (January..December)
c
locale's date and time (Sat Nov 04 12:02:33 EST 1989)
d
day of month (01..31)
D
date (mm/dd/yy)
h
same as b
j
day of year (001..366)
m
month (01..12)
U
week number of year with Sunday as first day of week (00..53)
w
day of week (0..6)
W
week number of year with Monday as first day of week (00..53)
x
locale's date representation (mm/dd/yy)
y
last two digits of year (00..99)
Y
year (1970...)

%b
File's size in 512-byte blocks (rounded up).
%c
File's last status change time in the format returned by the C `ctime' function.
%Ck
File's last status change time in the format specified by k, which is the same as for %A.
%d
File's depth in the directory tree; 0 means the file is a command line argument.
%f
File's name with any leading directories removed (only the last element).
%F
Type of the filesystem the file is on; this value can be used for -fstype.
%g
File's group name, or numeric group ID if the group has no name.
%G
File's numeric group ID.
%h
Leading directories of file's name (all but the last element).
%H
Command line argument under which file was found.
%i
File's inode number (in decimal).
%k
File's size in 1K blocks (rounded up).
%l
Object of symbolic link (empty string if file is not a symbolic link).
%m
File's permission bits (in octal).
%n
Number of hard links to file.
%p
File's name.
%P
File's name with the name of the command line argument under which it was found removed.
%s
File's size in bytes.
%t
File's last modification time in the format returned by the C `ctime' function.
%Tk
File's last modification time in the format specified by k, which is the same as for %A.
%u
File's user name, or numeric user ID if the user has no name.
%U
File's numeric user ID.

A `%' character followed by any other character is discarded (but the other character is printed).

-prune
If -depth is not given, true; do not descend the current directory.
If -depth is given, false; no effect.
-ls
True; list current file in `ls -dils' format on standard output. The block counts are of 1K blocks, unless the environment variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used.

OPERATORS
Listed in order of decreasing precedence:

( expr )
Force precedence.
! expr
True if expr is false.
-not expr
Same as ! expr.
expr1 expr2
And (implied); expr2 is not evaluated if expr1 is false.
expr1 -a expr2
Same as expr1 expr2.
expr1 -and expr2
Same as expr1 expr2.
expr1 -o expr2
Or; expr2 is not evaluated if expr1 is true.
expr1 -or expr2
Same as expr1 -o expr2.
expr1 , expr2
List; both expr1 and expr2 are always evaluated. The value of expr1 is discarded; the value of the list is the value of expr2.

EXAMPLES

find /home -user joe

Find every file under the directory /home owned by the user joe.

find /usr -name *stat

Find every file under the directory /usr ending in ".stat".

find /var/spool -mtime +60

Find every file under the directory /var/spool that was modified more than 60 days ago.

find /tmp -name core -type f -print | xargs /bin/rm -f

Find files named core in or below the directory /tmp and delete them. Note that this will work incorrectly if there are any filenames containing newlines, single or double quotes, or spaces.

find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f

Find files named core in or below the directory /tmp and delete them, processing filenames in such a way that file or directory names containing single or double quotes, spaces or newlines are correctly handled. The -name test comes before the -type test in order to avoid having to call stat(2) on every file.

find . -type f -exec file '{}' \;

Runs `file' on every file in or below the current directory. Notice that the braces are enclosed in single quote marks to protect them from interpretation as shell script punctuation. The semicolon is similarly protected by the use of a backslash, though ';' could have been used in that case also.

find / \( -perm -4000 -fprintf /root/suid.txt '%#m %u %p\n' \) , \
\( -size +100M -fprintf /root/big.txt '%-10s %p\n' \)

Traverse the filesystem just once, listing setuid files and directories into /root/suid.txt and large files into /root/big.txt.

find $HOME -mtime 0

Search for files in your home directory which have been modified in the last twenty-four hours. This command works this way because the time since each file was last modified is divided by 24 hours and any remainder is discarded. That means that to match -mtime

0, a file will have to have a modification in the past which is less than 24 hours ago.

find . -perm 664

Search for files which have read and write permission for their owner, and group, but which other users can read but not write to. Files which meet these criteria but have other permissions bits set (for example if someone can execute the file) will not be matched.

find . -perm -664

Search for files which have read and write permission for their owner and group, and which other users can read, without regard to the presence of any extra permission bits (for example the executable bit). This will match a file which has mode 0777, for example.

find . -perm /222

Search for files which are writable by somebody (their owner, or their group, or anybody else).

find . -perm /220
find . -perm /u+w,g+w
find . -perm /u=w,g=w

All three of these commands do the same thing, but the first one uses the octal representation of the file mode, and the other two use the symbolic form. These commands all search for files which are writable by either their owner or their group. The files don't have to be writable by both the owner and group to be matched; either will do.

find . -perm -220
find . -perm -g+w,u+w

Both these commands do the same thing; search for files which are writable by both their owner and their group.

find . -perm -444 -perm /222 ! -perm /111
find . -perm -a+r -perm /a+w ! -perm /a+x

These two commands both search for files that are readable for everybody (-perm -444 or -perm -a+r), have at least on write bit set (-perm /222 or -perm /a+w) but are not executable for anybody (! -perm /111 and ! -perm /a+x respectively)

taken from
http://linux.about.com/od/commands/l/blcmdl1_find.htm