About Rave Computer: Media Room
The Rave Review: Bits & Bytes

You can always count on Rave to be your trusted advisor for the latest in technology trends, tips, and tools. Each quarter, we'll give you bits and bytes of useful information including new product notes, drivers/patches, troubleshooting tips, solutions for software issues and more.

Kickstart

What are Kickstart Installations?

Many system administrators would prefer to use an automated installation method to install Red Hat Enterprise Linux on their machines. To answer this need, Red Hat created the kickstart installation method. Using kickstart, a system administrator can create a single file containing the answers to all the questions that would normally be asked during a typical installation.

Kickstart files can be kept on a single server system and read by individual computers during the installation. This installation method can support the use of a single kickstart file to install Red Hat Enterprise Linux on multiple machines, making it ideal for network and system administrators.

Kickstart provides a way for users to automate a Red Hat Enterprise Linux installation.

Free disk space

The more you use your PC, the more it will collect junk files that you no longer need, taking up unnecessary disk space. It is therefore a good idea to regularly clean out your system, getting rid of the files you no longer need to make space for new ones.

You can also run maintenance programs which can 'defrag' your files : in other words clean up and arrange them in a way which makes it easier for your PC to find. By doing this, you can improve the speed at which Windows runs programs.

The Recycle Bin

When you delete a file, usually this just means it has been moved to the Recycle Bin. If you do not regularly empty your Bin, the files inside may take up valuable disk space.

Double click the Recycle Bin icon on your desktop to see which files are currently stored in there. If there are any files in the Bin that you want to keep and put back in the original place you deleted them from, right-click on the files and select Restore. If you are happy you no longer require any of the files in the Recycle Bin, you can remove them from your computer completely by right-clicking the Recycle Bin icon and selecting Empty recycle bin.

You should empty your Recycle Bin regularly, at least once a week..

Remove Temporary Files

Temporary or junk files are left over by programs and are usually no longer needed. They waste space and that may eventually slow your PC down.

Internet Explorer stores many of the files used on the web pages you visit so that next time you go to a site it doesn’t have to download the same files again. However, this can build up over time and take up a lot of disk space.

In Internet Explorer 6 click on Tools then Internet Options. Under the section Temporary Internet Files on the General tab, click Delete Files. Tick Delete all offline content and click OK. When finished, click OK to exit the Internet Options window.

In Internet Explorer 7 click on Tools then Internet Options and look for the section Browsing History and click the Delete button underneath. Next Click the Delete Files button next to Temporary Internet Files.

The System Restore facility is a useful safety feature but it can also use up a lot of space, so occasionally it is worth clearing out the old restore points.

To do this, go to Control Panel, click on System then on the System Restore tab. Tick to turn off System Restore and click Apply, this will clear out all old restore points. Now un-tick to turn System Restore back on and use the slider to specify the amount of disk space you want it to use for future restore points.

Disk Cleanup

The Disk Cleanup system tool allows you to clean out Windows components and programs you no longer need, and remove temporary files.

From the Start menu, click on Programs -> Accessories-> SystemTools-> Disk Cleanup.

The main Disk Cleanup window shows two tabs - Disk Cleanup and More Options. In the Disk Cleanup tab window, put a tick in the following boxes if you wish to clean out these unnecessary files:

  • * - Downloaded program files
  • * - Temporary internet files
  • * - Recycle bin
  • * - Temporary files

Click on the More Options tab and you can choose to get rid of unwanted Windows components, remove installed programs you no longer use, and remove all but the most recent System restore point.

When you have selected everything you want to clean up, click on OK then Yes to confirm you want to begin the Disk Cleanup process.

Defragmenting Your Hard Disk

Disk Defragmenter helps Windows arrange files on your Hard Disk in a way that makes it easier and faster for it to find your programs.

From the Start menu, click on Programs -> Accessories -> SystemTools -> Disk Defragmenter.

It is recommended that you read the Defragmenter Help manual before beginning the defragmentation process. Click on Help from the menu at the top of the Disk Defragmenter window.

Defragmenting can take anything from a few minutes to several hours depending how fragmented the disk is, during which time you should not run any other programs.

Disk Defragmenter requires 15% of free space on your hard disk to work with. If you do not have enough space you will need to delete some files. To start the defragmentation process, click the volume that you want to defragment, and then click Defragment.

Windows PowerShell

Windows PowerShell is an extensible command-line shell and associated scripting language from Microsoft.

This shell solves traditional management problems by leveraging the .NET Platform and provides significant benefits to developers, testers, power users, and administrators. The shell leverages the Common Runtime to provide a powerful, consistent, intuitive, extensible, and useful set of tools that drive down the costs of administration and make the life of non-programmers a lot easier.

Most shells (such as Windows Cmd.exe and the UNIX shells SH, KSH, CSH, and BASH) operate by executing a command or utility in a new process, and presenting the results (or errors) to the user as text. Text-based processing is the way in which system interaction is done with these shells. Over the years, a large number of text processing utilities -- such as SED, AWK, and PERL -- have evolved to support this interaction. The heritage of this operational process is very rich.

These shells also have another type of command; these commands are built-in to the shell and do not start a new process, but run within the process context of the shell. Examples of built-in commands are the KSH typeset command and the Cmd.exe DIR command. In most shells the number of built-in commands is somewhat small, so over time a large number of utilities have been created.

The Windows PowerShell (PS) is very different from these traditional shells. First, this shell does not use text as the basis for interaction with the system, but uses an object model based on the .NET platform. As we will see, this provides a much different, and a better way to interact with the system. Second, the list of built-in commands is much larger; this is done to ensure that the interaction with the object model is accomplished with the highest regard to integrity with respect to interacting with the system. Third, the shell provides consistency with regard to interacting with built-in commands through the use of a single parser, rather than relying on each command to create its own parser for parameters.

Your first seven steps to learning PowerShell

1. Download PowerShell (Get an OS specific version)
2. Begin with familiar old dos commands: dir, CD or Ipconfig (Just to get comfortable)
3. Make a collection of verb-Noun pairs, e.g. set-Executionpolicy and get-Childitem
4. Call for help with get-Help wmiobject and master get-Member
5. Create lots of scripts or Cmdlets
6. Deploy the Pipe symbol | (Join commands | filter)
7. Master $_. This construction means the current object in the pipeline.

For example: where | {$_.name -contains "Microsoft"}

Getting started with PowerShell

No other scripting language is so easy for the newcomer, yet offers so much sophistication for the experienced script writer. One reason that you can start learning PowerShell NOW is you can still use all your old commands such as: cd, dir, and even Ipconfig. My vision is that little by little, you can progress from commands you already know, e.g. dir, to PowerShell's get-ChildItem.

Now I don't pretend that it's easy to become an expert at PowerShell, I merely want to make the point that it's easy to begin that scripting journey. Just as in golf, most people can get the ball airborne with a sand wedge, but only a professional can hit a ball out of the rough, clear a water hazard, then hold the ball on a down-slope. PowerShell is like golf in that anyone can play, but few will have the effortless control of a professional. To stretch my analogy to the limit, just as we can play along with our favourite golfers from the comfort of our armchairs, so we can emulate PowerShell's experts by copying and pasting their code.

To get you started, here are five examples to type at the PS prompt type:

1. get-command
2. get-command get*
3. get-Eventlog system
4. get-Eventlog system -newest 100
5. get-Eventlog system -newest 100 | where {$_.eventid -eq 20}

- Start your PowerShell journey

My aim is to get you writing your own PowerShell cmdlets. Meanwhile, here is my challenge to you: in ten minutes you will be able to perform all the tasks that you currently achieve at the CMD prompt. Moreover, at the end of half an hour you will be issuing PowerShell commands that are just not possible with cmd.exe.

My assumption is that you have successfully installed PowerShell and .NET Framework 2.0 (or 3.0). Begin by clicking Start, Run, and type powershell in the dialog box; alternatively, create a short cut to powershell in the Quick Launch area of the Taskbar.

Try out a few PowerShell commands

Normally, when people move to another scripting language their old trusty commands don't work in the new shell. Well, you will be pleasantly surprised that when you migrate from cmd.exe, old favorites such as cd and dir are available thanks to PowerShell's Aliases. In a short time you will adapt to the new ways of doing old tasks; for example, set-location is the equivalent of cd, and get-Childitem achieves the same result as dir. In addition, PowerShell allows you to run all the native Windows executables such as Ipconfig, NetSh and NetDiag.

Thanks to this built-in library of Aliases, those coming from UNIX, perl or .NET can also make an easy transition to PowerShell. I don't want you to underestimate the body of knowledge required to be productive in PowerShell, I just want to emphasise that it's easy to take that first step and build on familiar commands from your existing scripting language.

Start, Run, PowerShell. In the shell type:

get-Process
or
get-Eventlog system

Get-IRQ.PS1
-----------cut here-----------------------

$strComputer = "."
$colItems = get-wmiobject -class "Win32_IRQResource" -namespace "root\CIMV2" `
-computername $strComputer
foreach ($objItem in $colItems) {
## write-host "Availability: " $objItem.Availability
## write-host "Caption: " $objItem.Caption
## write-host "Creation Class Name: " $objItem.CreationClassName
## write-host "CS Creation Class Name: " $objItem.CSCreationClassName
## write-host "CS Name: " $objItem.CSName
## write-host "Description: " $objItem.Description
## write-host "Hardware: " $objItem.Hardware
## write-host "Installation Date: " $objItem.InstallDate
write-host "IRQ Number: " $objItem.IRQNumber
## write-host "Name: " $objItem.Name
## write-host "Shareable: " $objItem.Shareable
## write-host "Status: " $objItem.Status
## write-host "Trigger Level: " $objItem.TriggerLevel
## write-host "Trigger Type: " $objItem.TriggerType
## write-host "Vector: " $objItem.Vector
## write-host
## sort $objItem.IRQNumber
}
--------------------cut here-----------------------
Background

Every released version of Microsoft DOS and Microsoft Windows for personal computers has featured a command-line interface tool. These are COMMAND.COM (in installations relying on MS-DOS, including Windows 9x) and cmd.exe (in Windows NT-family operating systems). These are regular command line interpreters that include only a handful of basic commands. For other purposes, a separate console application needs to be provided, to be invoked from these shells. They also include a scripting language (batch files), which can be used to automate various tasks. However, they cannot be used to automate all facets of GUI functionality, in part because command-line equivalents of operations exposed via the graphical interface are limited, and the scripting language is elementary, preventing the creation of complex scripts by composing available functionality. In Windows Server 2003, the situation was improved,[9] but scripting support was still considered unsatisfactory.

Microsoft attempted to address some of these shortcomings by introducing the Windows Script Host in 1998 with Windows 98, and its command-line based host: cscript.exe . It integrates with the Active Script engine and allows scripts to be written in compatible languages, such as JScript and VBScript, leveraging the APIs exposed by applications via COM. However, it has its own deficiencies, as well. It is not integrated with the shell, its documentation is not very accessible, and it quickly gained a reputation as a system vulnerability vector after several high-profile computer viruses exploited weaknesses in its security provisions. Different versions of Windows provided various special-purpose command line interpreters (such as netsh and WMIC) with their own command sets. None of them were integrated with the command shell; nor were they interoperable.

By 2003, Microsoft had started to develop a new shell called Monad (aka Microsoft Shell or MSH). Monad was to be a new extensible command shell with a fresh design that would be capable of automating a full range of core administrative tasks. Microsoft published the first Monad public beta release on June 17, 2005, Beta 2 on September 11, 2005, and Beta 3 on January 10, 2006. They announced on April 25, 2006 that Monad was renamed to Windows PowerShell, positioning it as a significant part of their management technology offerings.[10] Release Candidate 1 of PowerShell was released at the same time. Release Candidate 2 of PowerShell was released September 26, 2006 and released to web (RTW) on November 14, 2006. PowerShell for Vista was released on January 30, 2007.[11] The last CTP release of Windows PowerShell v2.0 was made available in December 2008.[12]

ref. http://en.wikipedia.org/wiki/Windows_PowerShell

ref. http://www.computerperformance.co.uk/powershell/powershell_intro.htm

chmod

About chmod

Changes the permission of a file.

Syntax

chmod [OPTION]... MODE[,MODE]... FILE...
chmod [OPTION]... OCTAL-MODE FILE...
chmod [OPTION]... --reference=RFILE FILE...
-c, --changes like verbose but report only when a change is made
--no-preserve-root do not treat `/' specially (the default)
--preserve-root fail to operate recursively on `/'
-f, --silent, --quiet suppress most error messages
-v, verbose output a diagnostic for every file processed
--reference=RFILE use RFILE's mode instead of MODE values
-R, --recursive change files and directories recursively
--help display this help and exit
--version output version information and exit

Permissions u - User who owns the file.
g - Group that owns the file.
o - Other.
a - All.
r - Read the file.
w - Write or edit the file.
x - Execute or run the file as a program.

Numeric Permissions:
CHMOD can also to attributed by using Numeric Permissions:
400 read by owner
040 read by group
004 read by anybody (other)
200 write by owner
020 write by group
002 write by anybody
100 execute by owner
010 execute by group
001 execute by anybody

Examples

The above numeric permissions can be added to set a certain permission, for example, a common HTML file on a Unix server to be only viewed over the Internet would be:

chmod 644 file.htm

This gives the file read/write by the owner and only read by everyone else (-rw-r--r--).

Files such as scripts that need to be executed need more permissions. Below is another example of a common permission given to scripts.

chmod 755 file.cgi

This would be the following 400+040+004+200+100+010+001 = 755 where you are giving all the rights except the capability for anyone to write to the file.cgi file(-rwxr-xr-x).

Finally, another common CHMOD permission is 666, as shown below, which is read and write by everyone.

chmod 666 file.txt

Additional information

Below is an example of how a file may be listed when typing ( ls -l ) at the prompt as well as information on how to interpret it.

-rw-rw-r-- 1   hope   123   Feb 03 15:36   file.txt
-       rw         rw-       r--                  1         hope   123     Feb 03 15:36       file.txt
File   owner   group   everyone else   links   owner   size   mod date            file name

Related commands

chown
getfacl
ls

Three types of permission read write and execute, Ever file and folder have three relations owner group and

others

[ Read = r write = w execute = x ] [ owner = u group = g other = o ]

[root@pc1 ~] # ls -ld /disk
1= nature of object [d=dir -=file l=link]
2= first three permission for owner [ rwx ]
3= second three permission for group members [ r-x]
4= third three permission for others [r-x]
5= number of inodes contain by this directory
6= owner of directory
7= group of directory
8= size of directory
9= creating date of object
10= name of object

[root@pc1 ~] # ls -l /disk

Drwxr-xr - x 2 root root 4096 Jan 1 1988 dir1

Drwxr-xr - x 2 root root 4096 Jan 1 1988 dir2

Drwxr-xr - x 2 root root 4096 Jan 1 1988 dir3

Changing permission = give write permission to other on /disk

[root@pc1 ~] # chmod 0+w /disk

Give read write and execute permission for group on /disk

[root@pc1 ~] # chmod g+rwx /disk

Assigning read writ and execute permission to user, group and other with single command

[root@pc1 ~] # chmod u+rwx , g+rwx, o - rwx /disk

Assigning different permission with different commands which separate with semicolon

[root@pc1 ~] # chmod u+rwx /disk ; chmod g+rwx /disk ; chmod 0+rx /disk

Using number system =----- [ Read = 4 ] [ Write = 2 ] [ Execute = 1 ]

rwx=7

r-x=5

---=0

Assigning full permission to owner and no permission for group and others

[root@pc1 ~] # chmod 700 /disk

Assigning full permission for owner and group no permission for other

[root@pc1 ~] # chmod 700 /disk

Assigning full permission to all

[root@pc1 ~] # chmod 777 /disk

Assigning full permission for owner and read, and execute for group and others

[root@pc1 ~] # chmod 755 /disk

Assigning no permission for all

[root@pc1 ~] # chmod 000 /disk

Assigning sticky bit permission for other

[root@pc1 ~] # chmod o+t /disk

Assigning suid permission for owner

[root@pc1 ~] # chmod u+s /disk

Assigning sgid permission for group

[root@pc1 ~] # chmod g+s /disk

* No warranty express or implied is made for any information provided.