BlogCatalog

Software Blogs - BlogCatalog Blog Directory

Search

Linux Commands for Beginning Server Administrators

Monday, May 4, 2009

arp


Command mostly used for checking existing Ethernet connectivity and IP address

Most common use: arp

This command should be used in conjunction with the ifconfig and route commands. It is mostly useful for me to check a network card and get the IP address quick. Obviously there are many more parameters, but I am trying to share the basics of server administration, not the whole book of commands.

df


Display filesystem information

Most common use: df -h

Great way to keep tabs on how much hard disk space you have on each mounted file system. You should also review our other commands like file permissions here.

du


Display usage

Most common use, under a specific directory: du -a

Easily and quickly identify the size of files/programs in certain directories. A word of caution is that you should not run this command from the / directory. It will actually display size for every file on the entire Linux harddisk.

find


Find locations of files/directories quickly across entire filesystem

Most common use: find / -name appname -type d -xdev

(replace the word appname with the name of a file or application like gimp)

This is a very powerful command and is best used when running as root or superuser. The danger is that you will potentially look across every single file on every filesystem, so the syntax is very important. The example shown allows you to search against all directories below / for the appname found in directories but only on the existing filesystem. It may sound complex but the example shown allows you to find a program you may need within seconds!

Other uses and more complex but beneficial functions include using the -exec or execute a command.
You may also try the commands: locate or try slocate

ifconfig


Command line tool to configure or check all network cards/interfaces

Most common uses: ifconfig and also ifconfig eth0 10.1.1.1

Using the plain ifconfig command will show you the details of all the already configured network cards or interfaces. This is a great way to get a check that your network hardware is working properly. You may also benefit from this review of server configuration. Using the many other options of ifconfig such as the one listed allows you to assign a particular interface a static IP address. I only show an example and not a real world command above. Also review some commands for file permissions here.. Your best bet, if you want to configure your network card using this command is to first read the manual pages. You access them by typing: man ifconfig

init


Allows you to change the server bootup on a specific runlevel

Most common use: init 5

This is a useful command, when for instance a servers fails to identify video type, and ends up dropping to the non-graphical boot-up mode (also called runlevel 3).

The server runlevels rely on scripts to basically start up a server with specific processes and tools upon bootup. Runlevel 5 is the default graphical runlevel for Linux servers. But sometimes you get stuck in a different mode and need to force a level. For those rare cases, the init command is a simple way to force the mode without having to edit the inittab file.

Of course, this command does not fix the underlying problem, it just provides a fast way to change levels as needed. For a more permanent correction to the runlevel, edit your /etc/inittab file to state: id:5:initdefault:

joe or nano


Easy to use command line editors that are often included with the major Linux flavors

Most common uses:
joe filename
nano filename

A real world example for you to get a better sense on how this works:
nano /etc/dhcp3/dhcpd.conf
This allows you to edit using nano the dhcpd.conf configuration file from the command line.

Maybe you are not up to speed on vi, or never learned how to use emacs? On most Linux flavors the text editor named joe or one named nano are available. These basic but easy to use editors are useful for those who need a text editor on the command line but don't know vi or emacs. Although, I do highly recommend that you learn and use Vi and Emacs editors as well. Regardless, you will need to use a command line editor from time to time. You can also use cat and more commands to list contents of files, but this is basic stuff found under the basic linux commands listing. Try: more filename to list contents of the filename.

netstat


Summary of network connections and status of sockets

Most common uses: netstat and also netstat |head and also netstat -r

Netstat command simply displays all sockets and server connections. The top few lines are usually most helpful regarding webserver administration. Therefore if you are doing basic webserver work, you can quickly read the top lines of the netstat output by including the |head (pipe and head commands). Using the -r option gives you a very good look at the network routing addresses. This is directly linked to the route command.

nslookup


Checks the domain name and IP information of a server

Most common use: nslookup www.hostname.com

You are bound to need this command for one reason or another. When performing server installation and configuration this command gives you the existing root server IP and DNS information and can also provide details from other remote servers. Therefore, it is also a very useful security command where you can lookup DNS information regarding a particular host IP that you may see showing up on your server access logs. Note there are some other commands like file permissions that may also help. There is a lot more to this command and using the man pages will get you the details by typing: man nslookup

ping


Sends test packets to a specified server to check if it is responding properly

Most common use: ping 10.0.0.0 (replace the 10.0.0.0 with a true IP address)

This is an extremely useful command that is necessary to test network connectivity and response of servers. It creates a series of test packets of data that are then bounced to the server and back giving an indication whether the server is operating properly.

It is the first line of testing if a network failure occurs. If ping works but for instance FTP does not, then chances are that the server is configured correctly, but the FTP daemon or service is not. However, if even ping does not work there is a more significant server connectivity issue… like maybe the wires are not connected or the server is turned off! The outcome of this command is pretty much one of two things. Either it works, or you get the message destination host unreachable. It is a very fast way to check even remote servers.

ps


Lists all existing processes on the server

Most common uses: ps and also ps -A |more

The simple command will list every process associated with the specific user running on the server. This is helpful in case you run into problems and need to for instance kill a particular process that is stuck in memory. On the other hand, as a system administrator, I tend to use the -A with the |more option. This will list every process running on the server one screen at a time. Read more of our commands on our reallylinux.com help page. I use ps to quickly check what others are goofing with on my servers and often find that I'm the one doing the dangerous goofing!

rm


Removes/deletes directories and files

Most common use: rm -r name (replace name with your file or directory name)

The -r option forces the command to also apply to each subdirectory within the directory. For instance if you are trying to delete the entire contents of the directory x which includes directories y and z this command will do it in one quick process. That is much more useful than trying to use the rmdir command after deleting files! Instead use the rm -r command and you will save time and effort. You may already have known this but since server administrators end up spending a lot of time making and deleting I included this tip!

route


Lists the routing tables for your server

Most common use: route -v

This is pretty much the exact same output as the command netstat -r. You can suit yourself which you prefer to run. I tend to type netstat commands a lot more than just route and so it applies less to my situation, but who knows, maybe you are going to love and use route the most!

shred


Deletes a file securely by overwriting its contents

Most common use: shred -v filename (replace filename with your specific file)

The -v option is useful since it provides extra view of what exactly the shred tool is doing while you wait. On especially BIG files this could take a bit of time. The result is that your file is so thoroughly deleted it is very unlikely to ever be retrieved again. This is especially useful when trying to zap important server related files that may include confidential information like user names or hidden processes. It is also useful for deleting those hundreds of love notes you get from some of the users on your server, another bonus of being a server administrator. :)

sudo


The super-user do command that allows you to run specific commands that require root access.

Most common use: sudo command (replace command with your specific one)

This command is useful when you are logged into a server and attempt a command that requires super-user or root privileges. In most cases, you can simply run the command through sudo, without having to log in as root. In fact, this is a very beneficial way to administer your server without daily use of the root login, which is potentially dangerous.

Note there are other commands for file permissions here. Below is a simple example of the sudo capabilities:
sudo cd /root
This command allows you to change directories to the /root without having to login as root. Note that you must enter the root password once, when running a sudo command.

top


Displays many system statistics and details regarding active processes

Most common use: top

This is a very useful system administrator tool that basically gives you a summary view of the system including number of users, memory usage, CPU usage, and active processes. Often during the course of a day when running multiple servers, one of my Xwindows workstations just displays the top command from each of the servers as a very quick check of their status and stability.

touch


Allows you to change the timestamp on a file.

Most common use: touch filename

Using the basic touch command, as above, will simply force the current date and time upon the specified file. This is helpful, but not often used.

However, another option that I've used in the past when administering servers, is to force a specific timestamp on a set of files in a directory. Read more of our commands on our reallylinux.com help page.

For instance, to force a specific date and time upon all files in a directory, type:
touch *

You can also force a specific date/time stamp using the -t option like this: touch -t200103041200.00 *
The command above will change all files in the current directory to take on the new date of March 4th, 2001 at noon. The syntax follows this pattern: YYYYMMDDhhmm.ss

YYYY represents the four digit year, then the two digit month, day, hour and minutes. You can even specify seconds as noted above. In any case, this is a useful way to control timestamps on any files on your server.

traceroute


Traces the existing network routing for a remote or local server

Most common use: traceroute hostname

(replace hostname with the name of your server such as reallylinux.com)

This is a very powerful network command that basically gives the exact route between your machine and a server. In some cases you can actually watch the network hops from country to country across an ocean, through data centers, etc. Read more of our commands on our reallylinux.com help page.

This comes in handy when trying to fix a network problem, such as when someone on the network can not get access to your server while others can. This can help identify the break or error along the network line. One strong note to you is not to misuse this command! When you run the traceroute everyone of those systems you see listed also sees YOU doing the traceroute and therefore as a matter of etiquette and respect this command should be used when necessary not for entertainment purposes. A key characteristic of gainfully employed server administrators: knowing when to use commands and when not to use them!

w


An extension of the who command that displays details of all users currently on the server

Most common uses: w

This is a very important system admin tool I use commonly to track who is on the server and what processes they are running. It is obviously most useful when run as a superuser.

The default setting for the w command is to show the long list of process details. You can also run the command w -s to review a shorter process listing, which is helpful when you have a lot of users on the server doing a lot of things! Remember that this is different than the who command that can only display users not their processes.

who


Tool used to monitor who is on the system and many other server related characteristics

Most common uses: who and also who -q and also who -b

The plain command just lists the names of users currently on the server. Using the -q option allows you to quickly view just the total number of users on the system. Using the -b option reminds you how long it has been since you rebooted that stable Linux server!

Read more...

Linux Graphics-related commands

kghostview my_file.ps
(in X terminal) Display a postscript (or pdf) file on screen. I can also use the older-looking ghostview or gv for the same end effect. I can print the postscript file from the viewer too.

xpdf my_file.pdf
(in X terminal) View a pdf file. For viewing pdf files, I prefer the Adobe Acrobat Reader for Linux (it is faster):
acroread my_file.pdf
It can be downloaded from: http://www.adobe.com/products/acrobat/readstep2.html

enscript my_file.txt -U 2
Convert a text file to postscript and print it to the default printer. I could also send the output to a postscript file:
enscript my_file.txt -U 2 -o my_file.ps
The option -U 2 makes enscript print 2 logical pages on one physical page which saves me paper, and creates more convenient, compact printouts. You may also select four pages per page, more makes the printout kind of difficult to read. enscript is really flexible, see man enscript to select from among the many formatting options.

ps2pdf my_file.ps my_file.pdf
Make a pdf (Adobe portable document format) file from a postscript file.

mpage -2 my_file.ps > new_file.ps
Print the postscript file my_file.ps, outputting two logical pages on one physical page. Save the output to the file new_file.ps.

ps2ps file.ps new_file.ps
psnup -nup 2 -pletter new_file.ps new_file2.ps
Another way of making a postscript file containing 2 logical pages on one physical page. First, I used the "postscript distiller" ps2ps to make the postscript file simpler (at the cost of it becoming much larger). Then, I used the psnup utility to make new_file2.ps which contains 2 logical pages per one physical page. I could have also put 4 or 8 logical pages per one physical page.

gimp
(in X terminal) A humble looking but very powerful image processor. Takes some learning to use, but it is great for artists, there is almost nothing you can't do with gimp. Use your mouse right button to get local menus, and learn how to use layers. Save your file in the native gimp file format *.xcf (to preserve layers for future editing) and only then flatten it and save as png (or whatever) for use. "Learning how to make proper selection is the key."

gphoto
(in X terminal) Powerful photo editor and camera image acquisition program.

kpaint
(in X terminal) Simple bitmap paint program ("paintbrush"-type).

xfig
(in X terminal) A simple drawing program. Useful for making elementary sketches or diagrams.

dia
(in X terminal) A tool for drawing diagrams from pre-built components.

display my_picture
(in X terminal) Display a picture for viewing only. You can also type display & and select file from the menu to view the image, rotate it , change its colour, apply certain effects, etc. display is part of ImageMagick package, together with several other utilities described below.

identify -verbose my_picture
Give me a description of an image file my_picture: format, type, class, size in pixels, number of colours, size in bytes, etc.

convert -geometry 60x80 my_picture.gif out_small_picture.gif
Scale a picture to a size 60x80 pixels. See a few line down for an example how to use convert to convert between different graphical file formats.

animate -delay 6x5 pic1 pic2 pic3
Keep showing two or more pictures in sequence. In the example above, the picture files are named pic1, pic2 and pic3, the delay between pictures is 0.06 second, and the whole presentation sequence is repeated in 5 seconds.

combine pic1 pic2 combined_pic.miff
Combine two or more images to another image. You can for example put a logo on every image.

montage -geometry 800x600+0+0 my_picture montage.miff
Create a tiled image from my_picture so that the total size is 800x600 pixels, with 0x0 border. The output goes to the file montage.miff.

zgv my_picture
Display a picture for viewing on a vga screen (no X necessary).

giftopnm my_file.giff > my_file.pnm
pnmtopng my_file.pnm > my_file.png
Convert the proprietary giff graphics into a raw, portable pnm file. Then convert the pnm into a png file, which is a newer and better standard for Internet pictures (better technically plus there is no danger of being sued by the owner of giff patents).

xwd -out my_cupture_screen_file.xwd
(in X terminal) Capture the contents of X-windows screen into a graphics X-windows "dump" file (*.xwd). You can later convert the xwd file into your favourite format using the convert utility. Unde KDE, you can also use the keyboard shortcuts or to copy the current window or the entire desktop into the clipboard.

convert my_capture_screen_file.xwd my_capture_screen.jpg
Convert the X-windows screen dump file (*.xwd) into the *.jpg file format. The convert utility can convert graphics from/to many different file formats.

import -display 192.5.100.10:0 -window root my_file.jpeg
Capture the contents of the root screen from X-windows runnning on server 192.5.100.10 display 0. The output file is my_file.jpeg (change the file format by giving it an appropriate filename extension). You need to have the permission to write to the screen in order to be able to capture its content (the permission to everybody can be given by running xhost + in the X-terminal). See man import for options.

ksnapshot
(in X terminal) GUI-based utility to capture screen contents.

xine frankenstein.avi &
(in X terminal). Watch the movie from the file "frankenstein.avi". Looks better than on a TV :))

Read more...

Linux Music-related commands

cdplay play 1
Play the first track from a audio CD. Use cdplay to play the whole CD. Use cdplay stop when had enough.

eject
Get a free coffee cup holder :))). (Eject the CD ROM tray). This command defaults to the cdrom, but could be used to eject other removable media by specifying the mount point or device. E.g., I can eject the zipdisk from a parallel-port (external) zipdrive (as root) using: eject /dev/sda4

play my_file.wav
Play a wave file.

rec my_file.wav
Record a wave file from my microphone.

mpg123 my_file.mp3
Play an mp3 file.

mpg123 -w my_file.wav my_file.mp3
Create a wave audio file from an mp3 audio file. Useful if you wanted to write a regular audio CD from mp3s--you have to convert the mp3s to the *.wav format first. Don't be surprised the conversion is slow--decompressing mp3s is very processor intensive.

xmms &
(in X terminal) Nice GUI mp3 player.

freeamp &
(in X terminal) Another GUI mp3 player.

lame input_file output_file
MP3 encoder. You may need to download and install it yourself (standard Linux distributions avoid supplying it because of disagreement about patents on the mp3 compression technique).

knapster
(in X terminal) Start the program to downoload mp3 files that other users of napster have displayed for downloading. You may share your mp3s too. Really cool, while it lasts. Gnutella and FreeNet will soon replace them->it gets even cooler.

cdparanoia -B "1-"
(CD ripper) Read the contents of an audio CD and save it into wavefiles in the current directories, one track per wavefile. The "1-" means "from track 1 to the last". -B forces putting each track into a separate file.

grip&
(in X terminal) A GUI to ripping (see the previous command).

playmidi my_file.mid
Play a midi file. playmidi -r my_file.mid will display text mode effects on the screen.

sox audio_file another_format_audio_file
(="SOund eXchange") Convert from almost any audio file format to another (but not mp3s). See man sox for the list of supported audio file formats (many). sox also lets you add special effects to your sound file.

kscd
(in X terminal) CD player.

kmidi
(in X terminal) MIDI player.

kmid
(in X terminal) MIDI/caraoke player.

kmix
(in X terminal) Sound mixer.

studio&
(in Xterminal) Sound Studio--edit sound files, add effects, etc. Available on the on the PowerTools CD, RH7.x.

extace&
(in Xterminal) Sound visualization utility.

festival --tts my_file.txt
Say the content of the my_file.txt file (ascii text). "festival" is a speach synthesizer that comes on the RedHat 7.0 "Linux PowerTools" CD. To say something from the command line, you need to start up "festival" and then, at the "festival>" prompt, type the appropriate command ("scheme" language interpreter), as in this example (bold represents the prompt):
festival
festival>(SayText "good dog, really good dog")
festival> (quit)

Read more...

Linux Shortcuts and Commands

netconf
(as root) A very good menu-driven setup for your network.

ping machine_name
Check if you can contact another machine (give the machine's name or IP), press C when done (without c, the command keeps going). As all Linux commands, ping has options, including the "ping of death" attack, when it seems you can ping some servers so they die--try the the opitons -f and -s.

route -n
Show the kernel routing table.

host host_to_find
nslookup host_to_find
dig ip_to_find
(Three commands, use any.) Query your default domain name server (DNS) for an Internet name (or IP number) host_to_find. This way you can check if your DNS works. You can also find out the name of the host of which you only know the IP number.

traceroute host_to_trace
Have a look how your messages trace to host_to_trace (which is either a host name or IP number).

mtr host_to_trace
(as root) A powerful and nice tool that combines the functionality of the older ping and traceroute (RH7.0)

nmblookup -A ip_address
Status of a networked MS Windows machine (with an NetBIOS name). This command is an equivalent of Windows nbtstat command.

ipfwadm -F -p m
(for RH5.2, see the next command for RH6.0) Set up the firewall IP forwarding policy to masquerading. (Not very secure but simple.) Purpose: all computers from your home network will appear to the outside world as one very busy machine and, for example, you will be allowed to browse the Internet from all computers at once.

echo 1 > /proc/sys/net/ipv4/ip_forward
ipfwadm-wrapper -F -p deny
ipfwadm-wrapper -F -a m -S xxx.xxx.xxx.0/24 -D 0.0.0.0/0
(three commands, RH6.0). Does the same as the previous command. Substitute the "x"s with digits of your class "C" IP address that you assigned to your home network. See here for more details.

ipchains -P forward DENY
ipchains -A forward -s xxx.xxx.xxx.0/24 -d 0.0.0.0/0 -j MASQ
(two commands, RH7.0). Same as previous commands, but works under RH7.0.

ipchains -L
List all firewall rules. Use to check if your firewalling setup works.

iptables -L
Linux kernel 2.4.x uses new firewalling "iptables". The above example lists the firewall rules.

firewall-config
(as root, in Xterm). A GUI for building your custom firewall.

ifconfig
(as root) Display info on the network interfaces currently active (ethernet, ppp, etc). Your first ethernet should show up as eth0, second as eth1, etc, first ppp over modem as ppp0, second as ppp1, etc. The "lo" is the "loopback only" interface which should be always active. Use the options (see ifconfig --help) to configure the interfaces.

ifup interface_name
(/sbin/ifup to run as a user) Startup a network interface. E.g.:
ifup eth0
ifup ppp0
ifup ppp1
Users can start up or shutdown the ppp interface only when the permission is given in the ppp setup (using netconf ). To start a ppp interface (dial-up connection), I normally use kppp available under the KDE "K" menu (or by typing kppp in an X-terminal).

/etc/rc.d/init.d/network restart
Restart the network using its normal initialization script (the same which is used during bootup). Useful if you just have manually made changes to your network configuration. Any other service listed in init.d can be stopped, started, or restarted in a similar way (call the script with an options stop, start or restart).

ifdown interface_name
(/sbin/ifdown to run it as a user). Shut down the network interface. E.g.: ifdown ppp0 Also, see the previous command.

netstat | more
Displays a lot (too much?) information on the status of your network.

/usr/sbin/mtr --gtk
(as root, in X windows if you wish the nice gtk-based interface). Network diagnostic tool combining the capabilities of traceroute and ping. Comes with RH7.0.

nmap ip_number
Map the ports on the machine with ip_number. REALLY useful to establish the security of your network configuration as you can see the opened ports. nmap is included on the RH7.0 "Linux PowerTools" CD, as is a convenient GUI front end, "nmapfe". nmap can also do operating system "fingerprinting". Normally, people (and their ISPs) don't like their computer ports being scanned (they view it as possbily probing before an attack) so they may complain if they find out--learn how to use nmap on your own computers else you will soon hear from your ISP (the complaints will go to them). How do I know this?

ethereal
(as root, in Xterminal) Network analyzer--view the network trafic going through your computer. Included on the RH7.0 "Linux PowerTools" CD. Using ethereal may be unethical in some situations, and unauthorized use in the workplace could be a fireable offence.

tcpdump -i ppp0 -a -x
(as root) Print all the network traffic going through the first over-the-phone interface (ppp0) as ascii and hexadecimal. Probably too much printout. tcpdump is a rather raw tool and it can be useful for building more "customized" tools for listening to/log what you need.

Read more...

UNIX / Linux Command Summary

access()
Used to check the accessibility of files

int
Access(pathname, access_mode)
Char* pathname;
int access-mode;
The access modes are.
04 read
02 write
01 execute (search)
00 checks existence of a file

& operator
execute a command as a background process.

banner
prints the specified string in large letters. Each argument may be upto 10 characters long.

break
is used to break out of a loop. It does not exit from the program.

Cal
Produces a calender of the current month as standard output. The month (1-12) and year (1-9999) must be specified in full numeric format.

Cal [[ month] year]

Calendar
Displays contents of the calendar file

case operator
The case operator is used to validate multiple conditions.
Case $string in

Pattern 1)
Command list;;
Command list;;

Pattern 3)
Command list;;
easc

cat
(for concatenate) command is used to display the contents of a file. Used without arguments it takes input from standard input is used to terminate input.

cat [filename(s)]
cat > [filename]
Data can be appended to a file using >>
Some of the available options are :
Cat [-options] filename(S)
-s silent about files that
cannot be accessed
-v enables display of non printinging characters (except tabs, new lines, form-

feeds)
-t when used with –v, it causes tabs to be printed as ^I’s
-e when used with –v, it causes $ to be printed at the end of each line
The –t and –e options are ignored if the –v options is not specified.

cd
Used to change directories

chgrp
Changes the group that owns a file.
Chgrp [grou –id] [filename]

chmod
Allows file permissions to be changed for each user. File permissions can be changed only by the owner (s).
Chmod [+/-][rwx] [ugo] [filename]

chown
Used to change the owner of a file.
The command takes a file(s) as source files and the login id of another user as the target.
Chown [user-id] [filename]
cmp
The cmp command compares two files (text or binary) byte-by-byte and displays the first occurrence where the files differ.
Cmp [filename1] [filename2] -1 gives a long listing

comm.
The comm command compares two sorted files and displays the instances that are common. The display is separated into 3 columns.
Comm. filename1 filename2
first displays what occurs in first files but not in the second
second displays what occurs in second file but not in first
third displays what is common in both files

continue statement
The rest of the commands in the loop are ignored. It moves out of the loop and moves on the next cycle.

cp
The cp (copy) command is used to copy a file.
Cp [filename1] [filename2]

cpio(copy input/output)
Utility program used to take backups.
Cpio operates in three modes:
-o output
-i input
-p pass

creat()
the system call creates a new file or prepares to rewrite an existing file. The file pointer is set to the beginning of file.
#include
#include
int creat(path, mode)

char *path;
int mode;
cut
used to cut out parts of a file. It takes filenames as command line arguments or input from standard input. The command can cut columns as well as fields in a file. It however does not delete the selected parts of the file.
Cut [-ef] [column/fie,d] filename
Cut-d “:” –f1,2,3 filename
Where –d indicates a delimiter specified within “:”

df
used to find the number of free blocks available for all the mounted file systems.
#/etc/df [filesystem]

diff
the diff command compares text files. It gives an index of all the lines that differ in the two files along with the line numbers. It also displays what needs to be changed.
Diff filename1 filename2

echo
The echo command echoes arguments on the command line.
echo [arguments]

env
Displays the permanent environment variables associated with a user’s login id

exit command
Used to stop the execution of a shell script.

expr command
Expr (command) command is used for numeric computation.
The operators + (add), -(subtract), *(multiplu), /(divide), (remainder) are allowed. Calculation are performed in order of normal numeric precedence.

find
The find command searches through directories for files that match the specified criteria. It can take full pathnames and relative pathnames on the command line.
To display the output on screen the –print option must be specified
for operator
The for operator may be used in looping constructs where there is repetitive execution of a section of the shell program.
For var in vall val2 val3 val4;

Do commnds; done

fsck
Used to check the file system and repair damaged files. The command takes a device name as an argument
# /etc/fsck /dev/file-system-to-be-checked.

grave operator
Used to store the standard the output of a command in an enviroment variable. (‘)

grep
The grep (global regular expression and print) command can be used as a filter to search for strings in files. The pattern may be either a fixed character string or a regular expression.
Grep “string” filename(s)

HOME
User’s home directory

if operator
The if operator allows conditional operator

If expression; then commands; fi
if … then…else… fi
$ if; then

commands
efile; then

commands
fi
kill
used to stop background processes

In
used to link files. A duplicate of a file is created with another name
LOGNAME
displays user’s login name

ls
Lists the files in the current directory

Some of the available options are:
-l gives a long listing
-a displays all file{including hidden files

lp
used to print data on the line printer.
Lp [options] filename(s)

mesg
The mesg command controls messages received on a terminal.
-n does not allow messages to be displayed on screen
-y allows messages to be displayed on screen

mkdir
used to create directories

more
The more command is used to dispay data one screenful at a time.
More [filename]

mv
Mv (move) moves a file from one directory to another or simply changes filenames. The command takes filename and pathnames as source names and a filename or exiting directory as target names.
mv [source-file] [target-file]

news
The news command allows a user to read news items published by the system administrator.

ni
Displays the contents of a file with line numbers

passwd
Changes the password
paste
The paste command joins lines from two files and displays the output. It can take a number of filenames as command line arguments.
paste file1 file2

PATH
The directories that the system searches to find commands

pg
Used to display data one page (screenful) at a time. The command can take a number of filenames as arguments.
Pg [option] [filename] [filename2]…..

pipe
Operator (1) takes the output of one commands as input of another command.

ps
Gives information about all the active processes.

PS1
The system prompt

pwd
(print working directory) displays the current directory.

rm
The rm (remove) command is used to delete files from a directory. A number of files may be deleted simultaneously. A file(s) once deleted cannot be retrieved.
rm [filename 1] [filename 2]…

sift command
Using shift $1becomes the source string and other arguments are shifted. $2 is shifted to $1,$3to $2 and so on.

Sleep
The sleep command is used to suspend the execution of a shell script for the specified time. This is usually in seconds.

sort
Sort is a utility program that can be used to sort text files in numeric or alphabetical order
Sort [filename]

split
Used to split large file into smaller files
Split-n filename
Split can take a second filename on the command line.

su
Used to switch to superuser or any other user.

sync
Used to copy data in buffers to files

system0
Used to run a UNIX command from within a C program

tail
The tail command may be used to view the end of a file.
Tail [filename]

tar
Used to save and restore files to tapes or other removable media.
Tar [function[modifier]] [filename(s)]

tee
output that is being redirected to a file can also be viewed on standard output.

test command
It compares strings and numeric values.
The test command has two forms : test command itself If test ${variable} = value then
Do commands else do commands

File
The test commands also uses special operators [ ]. These are operators following the of are interpreted by the shell as different from wildcard characters.
Of [ -f ${variable} ]
Then
Do commands
Elif
[ -d ${variable} ]

then
do commands

else
do commands

fi
many different tests are possible for files. Comparing numbers, character strings, values of environment variables.

time
Used to display the execution time of a program or a command. Time is reported in seconds.
Time filename values

tr
The tr command is used to translate characters.
tr [-option] [string1 [string2]]

tty
Displays the terminal pathname

umask
Used to specify default permissions while creating files.

uniq
The uniq command is used to display the uniq(ue) lines in a sorted file.
Sort filename uniq

until
The operator executes the commands within a loop as long as the test condition is false.

wall
Used to send a message to all users logged in.
# /etc/wall message

wait
the command halts the execution of a script until all child processes, executed as background processes, are completed.

wc
The wc command can be used to count the number of lines, words and characters in a fine.
wc [filename(s)]
The available options are:
wc –[options] [filename]
-1
-w
-c
while operator
the while operator repeatedly performs an operation until the test condition proves false.

$ while
Ø do

commands
Ø done

who
displays information about all the users currently logged onto the system. The user name, terminal number and the date and time that each user logged onto the system.
The syntax of the who command is who [options]

write
The write command allows inter-user communication. A user can send messages by addressing the other user’s terminal or login id.
write user-name [terminal number]

Read more...

30+ Basic Linux Commands

xkill Kills a running program
exit Exits the terminal
reboot Reboots the system
halt Shutsdown the computer
startx Starts xwindows from terminal
man man(command)shows help files
info info(command) shows help files
--help (command)--help shows help files
su Allow you to login as Super User

ls "Lists" the contents of the directory
pwd Displays "present working directory"
cd cd (name) change directory TO:(name)
mkdir mkdir (name) Makes new directory
rmdir rmdir (name) Removes directory
clear Clears the terminal window

date Displays current date and time
cal Displays a calander
uptime Displays time since last reboot
df Displays the disk usage on partitions
du Displays disk usage of directory

id Displays your identification to system
groups Displays groups of current user
ulimit -a Displays users limits
uname Displays name of machine logged into
who Displays "who" is logged on the system
w Similar to "who"

wall Sends message to all logged in users
top Displays cpu processes memory etc
ps Displays current running processes

----------------------
RPM's Mandrake and RedHat

Check if installed already
rpm -q

To Install the rpm
rpm -ih

To Update a program using an rpm
rpm -Uvh
----------------------

Bored try this:

apropos file List tons of file commands

-----------------------

Many of the commands listed above have
options that can be added to change the
output of that command. To see what they are
do a : man (command) and it will show you the
options.

The command line is hard to learn to use at
first ..... really hard for us converted MS$
users :) but it is worth the effort.

To start a program "like Opera" type the name
at the command prompt:
$ opera

Read more...

Upgrading from a previous Fedora

One of the great new features is to be able to do a live upgrade from an older Fedora release to Fedora 9. You simply have to install the new package called preupgrade and run the program as root:

# yum -y install preupgrade
# preupgrade

This process does take a LONG TIME, requires a high speed internet connection and has a couple minor gotchas but so far I've done a couple upgrades with no data loss and pretty much everything has "just worked" afterwards. You don't need to download and burn any ISOs as the upgrade is done on top of your current installation.

After the preupgrade script downloads a ton of packages it will reboot and begin the upgrade procedure automatically. Follow the instructions and after the upgrade is complete log back in and you'll have to fix a couple little things. One things is that you'll need to update the Livna repository file below and then clear the yum cache. Once you do that you'll have to do an update again and this time yum will automatically update any extra software you had installed from Livna with the previous version.

# rpm -Uhv http://rpm.livna.org/livna-release-9.rpm
# yum clean all
# yum -y update

This too will take a while since it's likely that dozens of packages will need to be updated. Once it's done it's a good idea to reboot again for good measure and if all goes well you should be done!

Read more...

What is Windows Dreamscene

Saturday, May 2, 2009

Windows Dreamscene is a tool that comes bundled with Windows Vista Ultimate edition, allowing users to set a video as a desktop background. Free video content has been provided over the Windows Update service, allowing selections of several nature videos.

This tool does not use as much CPU power as you may think, as some video rendering is performed by the graphics card (GPU) and is automatically paused when not in view (during tasks such as gaming). This substantially reduces the processing load in the majority of situations.

To use Windows Dreamscene you must have the Ultimate edition of Vista. Assuming this is the case, right click on the desktop and select Personalization.

Now, click Desktop Background.




From this window, choose Windows Dreamscene Content from the dropdown menu.




On this screen you can select the video you wish to play as your desktop background and then click OK once the choice has been made

Read more...

Unidentified Network

Windows Vista can sometimes cause network adapters to show up as connected to an "Unidentified Network", sometimes limiting the network to local access only.



There are many reasons that can cause this problem, but some suggested solutions to try are:

* Reset your Router using the web control panel.
* Update your network adapter drivers.
* Temporary disable any Anti-Virus/Firewall package to see if the problem is resolved.
* Try assigning a static IP address to the network card.
* Disable IPv6 on old network cards / routers.

These suggestions may help you narrow down the cause of the "unidentified network" problem

Read more...

Printer Sharing in vista

Many people will have a network of computers, with a central printer connected to only a single PC. It is easy to share this printer with user networked computers, allowing everyone in your workgroup to print directly.

First of all, you need to enable printer sharing on the host PC (the one with the printer directly attached). This allows other PCs to see the shared printer and connect to it via the host computer. To do this, open the Control Panel by clicking on the Start Menu > Control Panel:



Then, click View Network Status and Tasks:



If printer sharing is disabled, click the button next to Printer Sharing, then Turn on Printer Sharing and click Apply:




Printer sharing is now enabled on the host computer, allowing access to the connected printers (as long as a username/password from that PC is used).

On the PC you wish to grant access to the printer, browse the network from the host PC to view the printer listing. Once you have found the shared printer you wish to use, right click on it and select Connect:




It may require a username and password from the host computer, if so type these details in. Windows should now install the required drivers and add access to the shared printer, allowing you to print from any application.

Read more...

Slow Shutdown Problems in vista

it is fairly common for Windows Vista to shutdown slowly sometimes, and this can be for a variety of reasons (such as installing updates, crashed applications or driver problems). If this happens more frequently, it indicates that this problem shouldn't be happening and is worth troubleshooting.

Start by loading the event viewer "eventvwr.msc" from the run box (press WINDOWS KEY + R to start this):


Once event viewer has loaded, browse to Applications and Services > Microsoft > Windows > Diagnostics-Performance > Operational. This may take a few seconds to appear, as lots of data is loading. Once complete, it will display any significant events in the centre panel. You can scroll through events occurring at the time of a slow shutdown to see which applications or services caused a slowness (look for "Shutdown Performance Monitoring" under the "Task Category" tab):



In this example, a service called TrkWks caused a shutdown problem ("This service caused a delay in the system shutdown process"). Once you have determined which services or applications are causing the problem each time, you can then google for more information to diagnose each item individually. Often, patching or updating drivers can improve these issues.

Read more...

use Grub to Chainload XP Professional or Windows 2000

To do this you must first either use fdisk (dos boot disk) to format the drives or linux.

One way of doing this is to first install linux. Boot Red Hat 7.2/Mandrake 8.2 install CD, use its partition management to wipe all existing partitions and set up the partition set,including a primary partition for WinXP (which you mark as type fat32 or EXT2).
Boot Windows XP install CD. It will refuse to reformat the partition made in step 1, so it instead deletes and recreates that partition as an Win32 partition. Then finish the install normally.
Again boot Mandrake/RH install CD; and tell it to install GRUB in the boot partition, not on the MBR; complete the install.
This leaves you with a working system that will autoboot into Windows,
since Windows had set the partition table to mark its own partition as
active (bootable). Then use sfdisk to mark the boot partition as active
(sfdisk -A1 /dev/hda) and you have a working dual-boot system.
There is no evidence that the Windows installer mucks with the other
partitions. It does, however, mark its install partition as active,
so make sure you make a Linux boot floppy so you can get back into Linux
to run sfdisk.

Read more...

Quicky Setup - Linux and Windows XP/2000 dual boot

Use fdisk to partition your drive properly.
Download an burn 3 Mandrake 8.2 CDs or your favorite distro
Install Windows XP/2000 on the first partition, make sure you use fat 32 as your file system, not xp ntfs
Start your Linux Installation and install the /root directory into the second partition.
Install GRUB into the first sector of your boot partition (usually /boot) and not in the MBR. (Note there are reported problems with lilo)
Make a boot disk during the Linux installation if possible so that you can boot into it.
Now boot into Linux and copy the boot image from the boot sector. To do this run:
dd if=/dev/hdan of=/bootsect.lnx bs=512 count=1
, where /dev/hdan is the location of /boot and /bootsect.lnx is the Linux boot image.
Copy this bootsect.lnx file to a safe location where you can reach it using Windows.
Reboot into Windows XP/2000 and copy this bootsect.lnx file into the root directory (C:\).
Edit c:\boot.ini and append the following line: c:\bootsect.lnx="Linux".
Reboot your system and boot directly from the hard disk.
The Windows XP/2000 boot loader should now give you the option of booting into either Windows XP/2000 or Linux.
Try booting into both of them to see if you were successful

Read more...

How to Setup Fedora 9 Server

Fedora 9 has arrived at last. Naturally, I already downloaded and burned the discs. But before I start setting and testing Fedora as a server and a desktop, I need to do my reading. As an ancient Chinese proverb says: “if you participate in the unknown game, never make a first move”. I already brushed through multiple reviews of beta and pre -release versions. But I need to read a review of somebody with reputation about the final version. This is the requirement of our web analytics company too.

There is already some interesting material in HowtoForge written by a famous volunteer Falco. There is also a new material describing setup of a Fedora 9 desktop as well. Falco’s recommended server configuration is based on the following applications: Apache web server (SSL-capable) with PHP5 and Ruby, Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot POP3/IMAP, Quota, and ISP firewall.

I am not much into Ruby, so I will get by without it. And I prefer Sendmail to Postfix, so I will go along with it. As usual, Falco does not use Iptables firewall but chooses ISPConfig, while I like Iptables and plan to use it.

There were several bugs that Falco discovered during setup, probably for the first time, especially with Network Manager that prevents to connect properly to Internet. I have encountered minor problems with Network Manager too and always disabled it, so it would not interfere with my network choices. He also disables SELinux and I wholeheartedly agree with this choice because SELinux caused me a lot of grief before. There are other more comprehensive ways to make your system secure unless one has some kind of paranoia.

I don’t recommend installing either proftpd or vsftpd unless you plan to provide web hosting services or want multiple users to access your server. You can also decide for yourself whether you want to install Webalizer or you would like to process your logs differently.

You also have a choice to install your server with or without Gnome. If before visual interface for the server created unnecessary overhead, now with all dual core and quad core processors and abundance of memory of modern computers, just indulge yourself a little. Go wild and install the GNOME.

Read more...

How to Uninstall Unused Old Kernels

During updates your old Linux kernels pile up. Then one day when you try to do your next updates, an interesting alert comes up from the server. Basically, it tells you that your boot partition is full and can not fit any more kernels. Sounds easy, right? It will be easy for those of you who is pretty crafty with terminal and debugging. We have seasoned sysadmins in our web analytics company, but, naturally, there are junior guys who are still in constant learning process.

Unfortunately, those of them who are used to web interface, like Webmin, will delete their old kernels but won’t be able to proceed with the installation of a new Linux kernel. Interestingly enough, great Webmin just does not show all installed kernels. Some kind of a bug, I guess.

Well, your solution is to open the terminal and find out how many kernels are there anyways. So you need to type up:
rpm -q kernel | sort

Then you need to find out which kernel is the default one on your machine. So invoke the following command on your terminal:

uname -r

Then while whistling some funny melody, start uninstalling one by one all useless kernels. Here is the command:

rpm -e kernel(and its version)

Don’t forget to reboot. The alert would not bother you anymore.

Note: Please, be careful with uninstallation. Don’t erase all kernels, leave at least a couple of them in case a new update is gonna cause you problems. In that case, you will just switch back to the old kernel and wait for another kernel update.

Read more...

How to Share RedHat and Fedora Remote Directories with SSHFS

Lots of Linux and Unix power users know how to share remote directories with Samba or NFS. Unfortunately, more and more malicious hackers get access to servers through these ways of sharing. For example, if somebody got one of Trojan horse’s access to your Windows machine and you access your server through it, there is a fat chance that the remote directories may be infiltrated to.

There is a solution to that. You can share your remote directories through the SSH file system. You just need to make sure that your remote server is running SSH (which it usually does) and that it is accessible to your user account on a client machine.

If all this is true, you will need to install with your yum software that is called fuse-sshfs. Then, naturally, you will need to create a mount point - a directory on your client machine for mounting data from a remote server to your local directory.

When you are done with these simple tasks, you can start mounting the remote directory like that:

sshfs alex@10.0.0.13:/var/yourremotefolder /mnt/yourlocalfolder

As soon as you finish your work and want to unmount the remote directory, you will need to use the following fusermount command:

fusermount -u /mnt/yourlocalfolder

This solutions will be much safer for communications between Linux machines due to the nature of SSH encryption. Try it, I guarantee that you will like it.

Read more...

20 things you didn't know about Windows XP

You've read the reviews and digested the key feature enhancements and operational changes. Now it's time to delve a bit deeper and uncover some of Windows XP's secrets.

1. It boasts how long it can stay up. Whereas previous versions of Windows were coy about how long they went between boots, XP is positively proud of its stamina. Go to the Command Prompt in the Accessories menu from the All Programs start button option, and then type 'systeminfo'. The computer will produce a lot of useful info, including the uptime. If you want to keep these, type 'systeminfo > info.txt'. This creates a file called info.txt you can look at later with Notepad. (Professional Edition only).

2. You can delete files immediately, without having them move to the Recycle Bin first. Go to the Start menu, select Run... and type 'gpedit.msc'; then select User Configuration, Administrative Templates, Windows Components, Windows Explorer and find the Do not move deleted files to the Recycle Bin setting. Set it. Poking around in gpedit will reveal a great many interface and system options, but take care -- some may stop your computer behaving as you wish. (Professional Edition only).

3. You can lock your XP workstation with two clicks of the mouse. Create a new shortcut on your desktop using a right mouse click, and enter 'rundll32.exe user32.dll,LockWorkStation' in the location field. Give the shortcut a name you like. That's it -- just double click on it and your computer will be locked. And if that's not easy enough, Windows key + L will do the same.

4. XP hides some system software you might want to remove, such as Windows Messenger, but you can tickle it and make it disgorge everything. Using Notepad or Edit, edit the text file /windows/inf/sysoc.inf, search for the word 'hide' and remove it. You can then go to the Add or Remove Programs in the Control Panel, select Add/Remove Windows Components and there will be your prey, exposed and vulnerable.

5. For those skilled in the art of DOS batch files, XP has a number of interesting new commands. These include 'eventcreate' and 'eventtriggers' for creating and watching system events, 'typeperf' for monitoring performance of various subsystems, and 'schtasks' for handling scheduled tasks. As usual, typing the command name followed by /? will give a list of options -- they're all far too baroque to go into here.

6. XP has IP version 6 support -- the next generation of IP. Unfortunately this is more than your ISP has, so you can only experiment with this on your LAN. Type 'ipv6 install' into Run... (it's OK, it won't ruin your existing network setup) and then 'ipv6 /?' at the command line to find out more. If you don't know what IPv6 is, don't worry and don't bother.

7. You can at last get rid of tasks on the computer from the command line by using 'taskkill /pid' and the task number, or just 'tskill' and the process number. Find that out by typing 'tasklist', which will also tell you a lot about what's going on in your system.

8. XP will treat Zip files like folders, which is nice if you've got a fast machine. On slower machines, you can make XP leave zip files well alone by typing 'regsvr32 /u zipfldr.dll' at the command line. If you change your mind later, you can put things back as they were by typing 'regsvr32 zipfldr.dll'.

9. XP has ClearType -- Microsoft's anti-aliasing font display technology -- but doesn't have it enabled by default. It's well worth trying, especially if you were there for DOS and all those years of staring at a screen have given you the eyes of an astigmatic bat. To enable ClearType, right click on the desktop, select Properties, Appearance, Effects, select ClearType from the second drop-down menu and enable the selection. Expect best results on laptop displays. If you want to use ClearType on the Welcome login screen as well, set the registry entry HKEY_USERS/.DEFAULT/Control Panel/Desktop/FontSmoothingType to 2.

10. You can use Remote Assistance to help a friend who's using network address translation (NAT) on a home network, but not automatically. Get your pal to email you a Remote Assistance invitation and edit the file. Under the RCTICKET attribute will be a NAT IP address, like 192.168.1.10. Replace this with your chum's real IP address -- they can find this out by going to www.whatismyip.com -- and get them to make sure that they've got port 3389 open on their firewall and forwarded to the errant computer.

11. You can run a program as a different user without logging out and back in again. Right click the icon, select Run As... and enter the user name and password you want to use. This only applies for that run. The trick is particularly useful if you need to have administrative permissions to install a program, which many require. Note that you can have some fun by running programs multiple times on the same system as different users, but this can have unforeseen effects.

12. Windows XP can be very insistent about you checking for auto updates, registering a Passport, using Windows Messenger and so on. After a while, the nagging goes away, but if you feel you might slip the bonds of sanity before that point, run Regedit, go to HKEY_CURRENT_USER/Software/Microsoft/Windows/Current Version/Explorer/Advanced and create a DWORD value called EnableBalloonTips with a value of 0.

13. You can start up without needing to enter a user name or password. Select Run... from the start menu and type 'control userpasswords2', which will open the user accounts application. On the Users tab, clear the box for Users Must Enter A User Name And Password To Use This Computer, and click on OK. An Automatically Log On dialog box will appear; enter the user name and password for the account you want to use.

14. Internet Explorer 6 will automatically delete temporary files, but only if you tell it to. Start the browser, select Tools / Internet Options... and Advanced, go down to the Security area and check the box to Empty Temporary Internet Files folder when browser is closed.

15. XP comes with a free Network Activity Light, just in case you can't see the LEDs twinkle on your network card. Right click on My Network Places on the desktop, then select Properties. Right click on the description for your LAN or dial-up connection, select Properties, then check the Show icon in notification area when connected box. You'll now see a tiny network icon on the right of your task bar that glimmers nicely during network traffic.

16. The Start Menu can be leisurely when it decides to appear, but you can speed things along by changing the registry entry HKEY_CURRENT_USER/Control Panel/Desktop/MenuShowDelay from the default 400 to something a little snappier. Like 0.

17. You can rename loads of files at once in Windows Explorer. Highlight a set of files in a window, then right click on one and rename it. All the other files will be renamed to that name, with individual numbers in brackets to distinguish them. Also, in a folder you can arrange icons in alphabetised groups by View, Arrange Icon By... Show In Groups.

18. Windows Media Player will display the cover art for albums as it plays the tracks -- if it found the picture on the Internet when you copied the tracks from the CD. If it didn't, or if you have lots of pre-WMP music files, you can put your own copy of the cover art in the same directory as the tracks. Just call it folder.jpg and Windows Media Player will pick it up and display it.

19. Windows key + Break brings up the System Properties dialogue box; Windows key + D brings up the desktop; Windows key + Tab moves through the taskbar buttons.

20. The next release of Windows XP, codenamed Longhorn, is due out late next year or early 2003 and won't be much to write home about. The next big release is codenamed Blackcomb and will be out in 2003/2004.

Read more...

Search For Hidden Or System Files In Windows XP

The Search companion in Windows XP searches for hidden and system files differently than in earlier versions of Windows. This guide describes how to search for hidden or system files in Windows XP.

Search for Hidden or System Files By default, the Search companion does not search for hidden or system files. Because of this, you may be unable to find files, even though they exist on the drive.

To search for hidden or system files in Windows XP:
Click Start, click Search, click All files and folders, and then click More advanced options.

Click to select the Search system folders and Search hidden files and folders check boxes.

NOTE: You do not need to configure your computer to show hidden files in the Folder Options dialog box in Windows Explorer to find files with either the hidden or system attributes, but you need to configure your computer not to hide protected operating system files to find files with both the hidden and system attributes. Search Companion shares the Hide protected operating system files option (which hides files with both the system and hidden attributes) with the Folder Options dialog box Windows Explorer

Read more...

Fix your Slow XP and 98 Network

You can run "wmiprvse.exe" as a process for quick shared network access to Win98/ME machines. Stick it in Startup or make it a service.

"On the PC running XP, log in as you normally would, go to users, manage network passwords.
Here is where the problem lies. In this dialog box remove any win98 passwords or computer-assigned names for the win98 PCs. In my case , I had two computer-assigned win98 pc names in this box (example G4k8e6). I deleted these names (you may have passwords instead). Then go to My Network Places and -- there you go! -- no more delay!

Now, after I did this and went to My Network Places to browse the first Win98 PC, I was presented with a password/logon box that looked like this: logon: G4k8e6/guest (lightly grayed out) and a place to enter a password. I entered the password that I had previously used to share drives on the Win98 PCs long before I installed XP. I have the guest account enabled in XP.

This solves the problem for Win98 & XP machines on a LAN; I can't guarantee it will work for Win2K/ME machines as well, but the whole secret lies in the passwords. If this doesn't solve your slow WinXP>Win98 access problems, then you probably have other things wrong. Don't forget to uncheck 'simple file sharing,' turn off your ICS firewall, enable NetBIOS over TCP/IP and install proper protocols, services & permissions."

Read more...

NTFS vs. FAT

To NTFS or not to NTFS—that is the question. But unlike the deeper questions of life, this one isn't really all that hard to answer. For most users running Windows XP, NTFS is the obvious choice. It's more powerful and offers security advantages not found in the other file systems. But let's go over the differences among the files systems so we're all clear about the choice. There are essentially three different file systems available in Windows XP: FAT16, short for File Allocation Table, FAT32, and NTFS, short for NT File System.


FAT16
The FAT16 file system was introduced way back with MS–DOS in 1981, and it's showing its age. It was designed originally to handle files on a floppy drive, and has had minor modifications over the years so it can handle hard disks, and even file names longer than the original limitation of 8.3 characters, but it's still the lowest common denominator. The biggest advantage of FAT16 is that it is compatible across a wide variety of operating systems, including Windows 95/98/Me, OS/2, Linux, and some versions of UNIX. The biggest problem of FAT16 is that it has a fixed maximum number of clusters per partition, so as hard disks get bigger and bigger, the size of each cluster has to get larger. In a 2–GB partition, each cluster is 32 kilobytes, meaning that even the smallest file on the partition will take up 32 KB of space. FAT16 also doesn't support compression, encryption, or advanced security using access control lists.

FAT32
The FAT32 file system, originally introduced in Windows 95 Service Pack 2, is really just an extension of the original FAT16 file system that provides for a much larger number of clusters per partition. As such, it greatly improves the overall disk utilization when compared to a FAT16 file system. However, FAT32 shares all of the other limitations of FAT16, and adds an important additional limitation—many operating systems that can recognize FAT16 will not work with FAT32—most notably Windows NT, but also Linux and UNIX as well. Now this isn't a problem if you're running FAT32 on a Windows XP computer and sharing your drive out to other computers on your network—they don't need to know (and generally don't really care) what your underlying file system is.

The Advantages of NTFS
The NTFS file system, introduced with first version of Windows NT, is a completely different file system from FAT. It provides for greatly increased security, file–by–file compression, quotas, and even encryption. It is the default file system for new installations of Windows XP, and if you're doing an upgrade from a previous version of Windows, you'll be asked if you want to convert your existing file systems to NTFS. Don't worry. If you've already upgraded to Windows XP and didn't do the conversion then, it's not a problem. You can convert FAT16 or FAT32 volumes to NTFS at any point. Just remember that you can't easily go back to FAT or FAT32 (without reformatting the drive or partition), not that I think you'll want to.

The NTFS file system is generally not compatible with other operating systems installed on the same computer, nor is it available when you've booted a computer from a floppy disk. For this reason, many system administrators, myself included, used to recommend that users format at least a small partition at the beginning of their main hard disk as FAT. This partition provided a place to store emergency recovery tools or special drivers needed for reinstallation, and was a mechanism for digging yourself out of the hole you'd just dug into. But with the enhanced recovery abilities built into Windows XP (more on that in a future column), I don't think it's necessary or desirable to create that initial FAT partition.

Read more...

Set Permissions for Shared Files and Folders

Sharing of files and folders can be managed in two ways. If you chose simplified file sharing, your folders can be shared with everyone on your network or workgroup, or you can make your folders private. (This is how folders are shared in Windows 2000.) However, in Windows XP Professional, you can also set folder permissions for specific users or groups. To do this, you must first change the default setting, which is simple file sharing. To change this setting, follow these steps:
•Open Control Panel, click Tools, and then click Folder Options.
•Click the View tab, and scroll to the bottom of the Advanced Settings list.
•Clear the Use simple file sharing (Recommended) check box.
•To manage folder permissions, browse to the folder in Windows Explorer, right–click the folder, and then click Properties. Click the Security tab, and assign permissions, such as Full Control, Modify, Read, and/or Write, to specific users.

You can set file and folder permissions only on drives formatted to use NTFS, and you must be the owner or have been granted permission to do so by the owner.

Read more...

Take your favorite tunes with you transfer music to a portable player

Take your favorite tunes with you when you jog or work out at the gym. Windows Media Player for Windows XP is set up to make the transfer of music to portable players as simple as 1-2-3. And since the music is stored on your computer hard drive, you can keep refilling your portable player as often as you want.

To transfer music to a portable player

Connect your portable player to your computer, according to the directions supplied with the player.
Click Start, point to All Programs, and then click Windows Media Player.
Click Copy to CD or Device. If necessary, click the player to which you want to copy music.
Choose a playlist from the Music to Copy drop-down menu.
Clear the check boxes beside any tracks you do not want to copy.
Click Copy Music.

Read more...

XP Hibernate Option

Whenever you want to logoff, shut down or reboot your Windows XP machine you have only 3 choices
(1) Standby ONLY IF the ACPI/APM function is properly enabled BOTH in your motherboard's BIOS AND in WinXP!
(2) Restart
(3) Shutdown.


To properly enable Hibernation in WinXP:

Start button -> Control Panel -> Power Options -> Hibernate tab -> check Enable hibernate support box -> Apply/OK -> reboot.


NOTE: If the Hibernate tab is unavailable your computer does NOT support it!
For some reason Microsoft did NOT enable the 4th option:
(4) Hibernate, which should be available on power saving (ACPI) enabled PCs and laptops.
But you CAN bring it back: just hold the Shift key while the Shut down menu is displayed on your screen, and notice the Standby button being replaced by a new, fully functional Hibernate button, which can be clicked with the left button of your mouse.


If you release the Shift key, the Hibernate option will disappear once again, to be replaced by Standby

Read more...

Where has Scan Disk Gone

Scandisk is not a part of Windows XP - instead you get the improved CHKDSK. You can use the Error-checking tool to check for file system errors and bad sectors on your hard disk.

1: Open My Computer, and then select the local disk you want to check.
2: On the File menu, click Properties.
3: On the Tools tab, under Error-checking, click Check Now.
4: Under Check disk options, select the Scan for and attempt recovery of bad sectors check box.
· All files must be closed for this process to run. If the volume is currently in use, a message box will appear prompting you to indicate whether or not you want to reschedule the disk checking for the next time you restart your system. Then, the next time you restart your system, disk checking will run. Your volume will not be available to perform other tasks while this process is running.
· If your volume is formatted as NTFS, Windows automatically logs all file transactions, replaces bad clusters, and stores copies of key information for all files on the NTFS volume.

Read more...

How to Write a Windows XP Driver

Install the current Windows DDK. Read the system requirements and installation instructions in the stand-alone Getting Started HTML file supplied with the DDK.

Read Getting Started with Windows Drivers. This document guides you through the planning and decision-making process involved in making a Windows device driver from design through distribution. You should also look through the DDK documentation for device-type-specific information.

The DDK documentation set has the following device-type-specific nodes:

Battery Devices

Display and Print Devices

IEEE 1284.4 Devices

Interactive Input Devices

Modem Devices

Multifunction Devices

Network Devices and Protocols

Parallel Ports and Devices

Serial Ports and Devices

Smart Card Devices

Still Image Devices

Storage Devices

Streaming Devices (Video and Audio)

Devices Requiring VDDs



IDE bus are described in System Support for Buses. Driver development for most device types also requires a strong understanding of Windows operating system fundamentals, which are described in Kernel-Mode Driver Architecture.

Look through the driver source code provided with the DDK for a sample that represents your device type. Use the sample code where possible, modifying it for your device's specifics.

The sample code can enhance your understanding of Windows XP driver implementation requirements and speed your development time.

Compile and build your driver. This should be done using the Build utility and not some other compiler, because the Build utility has certain features that are necessary for driver development.

Obtain a checked build of Windows XP, so that you can test and debug your driver using free and checked system builds.

The checked build of Windows XP provides extensive kernel-mode debugging capabilities not available in the free build.

Create an INF file so that you can install and test your driver.

Test and debug your driver. You should use Driver Verifier, a program that puts your driver through a variety of tests, stresses, and deliberate failures in order to test its response and reliability in many extreme situations. You should also use a debugger. Microsoft provides several powerful debuggers that can monitor and debug kernel-mode and user-mode drivers.
Using Driver Verifier in conjunction with these debuggers, on both the checked and free versions of the operating system, can be a powerful way to test your driver.

Provide an installation package so that customers can install devices that use your driver.

Submit your driver and installation package to Microsoft so that it can be digitally signed

Read more...

How to make My Computer' open in Explore mode with folder list

In My Computer click Tools menu, and then click Options.

Click the File Types tab.In the list of file types, highlight "(NONE) Folders"

Click Advanced button, In the Actions box, highlight "Explore" Click "Set Default"

Read more...

Layered Screen Captures Adobe photoshop

Wednesday, April 22, 2009

Read more...

Install VLC (VideoLAN Client) Fedora 8

Multimedia can be the achilles heel of Linux, but with just a little work you should be able to play just about anything your friends can. Besides Mplayer the other great video player is called VLC. It too is trivially easy to install once you have your repositories set up:
# yum -y install vlc

Once the client and a zillion dependencies get installed you can play a huge variety of video formats easy with the command vlc

Read more...

Install MPlayer Media Player in Fedora 8

At some point you're probably going to want to play a QuickTime, AVI or ASF file so you'll want the MPlayer media player. Fortunately with the FreshRpms repositories it's also very easy to download and install. Then you can go ahead and install mplayer and all it's dependencies:
# yum -y install mplayer mplayer-gui mplayer-skins mplayer-fonts mplayerplug-in

This command line will download the whole kit and kaboodle, command line utilities, plug-ins, etc. If you want to play content from a command line you will want to use the gmplayer version which will include a skin-able control panel. Restart your web browser after that whole mess is done installing and you'll also have a plug-in for Mozilla so you can play embedded content. While you're at it be sure to configure mplayer to use the Pulse sound system rather than the default. It just works better. Edit the file ~/.mplayer/config and add the following line:
ao=pulse

You can enable support for mms streaming by opening Firefox and click on the special URL about:config. Right click on the list and choose New then choose String. For the preference name enter network.protocol-handler.app.mms then for the string value enter gmplayer.

Special 64-bit instructions:
The above installs the 64-bit version of everything but because your other plug-ins are 32-bits you need to run the 32-bit version of Firefox, which won't be able to use the 64-bit version of the plug-in you just installed. The plug-in can use the 64-bit version of the mplayer application just fine so all you need to do then is to install the 32-bit mplayerplug-in plus a dependency it requires. If you know of any easier way to do this please let me know below.

# rpm -ihv http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/7/mplayerplug-in/mplayerplug-in-3.40-1.fc7.i386.rpm

And finally you'll probably also want some additional codecs to play all that proprietary video that seems to have infected the Internet. Go to the MPlayer Download page and find the Binaries Codec Package section then follow the link for codecs directory. There you will grab the latest all codecs file. You'll need to install those files in /usr/local/lib/codecs. Here are the steps. Remember the exact file names may change at some point. If you also installed xine you will need a symlink since it expects codecs to be in a different directory.
# gtar xjvf all-20071007.tar.bz2
# mv all-20071007/* /usr/local/lib/codecs
# ln -s /usr/local/lib/codecs /usr/lib/codecs
# ln -s /usr/local/lib/codecs /usr/local/lib/win32

Read more...

Instal DVD Player in Fedora 8

Currently I find the DVD player that works best is the Xine Multimedia Player which is found in the Livna repository so installing it is just this simple:
# yum -y install xine xine-lib xine-skins xine-lib-extras-nonfree libdvdcss

This will install the xine DVD/VCD/CD player. Now to get xine to automatically play a DVD upon insertion instead of the Totem player which can't actually play DVDs, you can simply use the gconftool-2 utility as follows:
$ gconftool-2 --set /desktop/gnome/volume_manager/autoplay_dvd_command \
'xine --auto-play --auto-scan dvd' --type='string'

Read more...

How to turn a flash game into a profitable product?

Probably, the most effective way to profit from a flash game is to introduce a registration fee and add limitations for unregistered users. When a user downloads such a game, he will be able to play it several days, complete several free levels or play as a character with limitations in case of a multi-user game. In order to continue playing or disable limitations, the user will have to register and get a registration code. After this registration code is entered, limitations will be disabled and the user will get access to the full version.

Use the eBook Maestro PRO compiler to introduce limitations. This compiler allows you to create stand-alone exe applications out of HTML, Flash and other files.

If you want to create a game with a limitation regarding the number of days…
1. Create a directory on the hard disk and put there flash and html files.
2. Open eBook Maestro.
3. Create a new project.
4. Use the Files tab to select the directory with flash files and specify the starting html file as the default file.
5. Select “Expire after X days” on the Protection tab.
6. Initialize protection.
7. Configure the Buy Page.
8. Compile.

If you want to create a game with limitations in levels and features…
1. Create a directory on the hard disk and put the flash files that will be available to all players to it. Use the same directory for the html files these flash files will use.
2. Create a subdirectory named 'protected' in this directory. This subdirectory will contain flash files available only after registration (with new levels and features). Also, use it to save html files that protected flash file will use.
3. Now a very important part. You must configure flash files in such a way that flash files available to everyone will call html pages available only after registration. Thus, once an unregistered user tries to open an HTML file from the protected directory, he will not see the requested file, but he will be offered to register and enter his code instead.
4. After you prepare all files for compilation, open eBook Maestro.
5. Create a new project.
6. Use the Files tab to select the directory with flash files and specify the starting html file as the default file.
7. Select “Encrypted Information” on the Protection tab.
8. Use the “Subdirectory to protect” field to specify the protected subdirectory with files for registered users.
9. Initialize protection.
10. Configure the Buy Page.
11. Compile.

While configuring the Buy Page, use the «Buy Page URL» field to enter the address of the page at your site with a detailed description of how to pay for the registration and get a registration code.

After you compile it, you will get an exe file of the game with limitations. Now distribute and promote your game, get money for registration and send keys to your customers.

Use the “Key Generator” section to create registration codes for registered users.

Read more...

MS OFFICE Tips

We probably use office programs - word processors, spreadsheets, email and presentation applications - more than any other kind of software on our computers. Of this kind of software, Microsoft's Office suite is the most popular.

It can, however, be hard to get to grips with all the time-saving features; all those menus, toolbars and buttons can seem overwhelming at times, particularly if you are just starting out.

Once you delve a little deeper and discover Office's hidden shortcuts and tricks, however, you can make your software work a lot harder for you and make your life easier in the process.
Use our handy guide to the 100 most useful hints, tips and shortcuts in Word, PowerPoint, Excel and Outlook and you will know just how to get the most out of your Office applications
WORD

1. Date
To stop Word from adding today's date to any year you type, changing, say, 'Letter 2004' to 'Letter 2004-08-22', go to the Insert menu, click on AutoCorrect and select AutoText in the next menu. Untick the box marked 'Show Autocomplete Suggestions'. If you want to use an AutoText shortcut in future, type the abbreviation and press F3.
. Add places
Add a folder to the Places Bar in Word 2002's Open and Save boxes to help you find files quickly. Find the folder you require in Windows Explorer, highlight it and then click on the Tools menu. Now click on the option marked 'Add to My Places'. If you are a Word 2000 user, you can download a Microsoft add-on to customise the Places Bar here.

3. Turn off fast save
Fast saves aren't much faster than normal saves and instead of properly saving your document, Word just appends anything you have added to the text to the end of the file. Nothing is ever deleted from the document file, so it can end up being huge. It's best to turn off fast saves by going to the Tools menu, clicking on Options, then on the Save tab and removing the tick from the 'Allow fast saves' checkbox.

4. No mouse styles
If you often write the same style of documents in Word, you may be aware of the Styles option, which can reduce the time you spend formatting a document. You can assign a keyboard shortcut to a style so that you don't have to use the mouse to find it by going to the Tools menu, then Customize, then pressing Keyboard and selecting Styles from the list on the left.

5. Follow style
If your styles naturally follow one another, say a particular text style always follows a particular headline style, you can cut down further on the time required to select them by going to the Format menu, and selecting Style. Choose the relevant style and click on Modify, then choose another from the box marked 'Style for following paragraph'.

6. Repeat find
To find a piece of text, press F3, enter the text you're looking for in the text box and press Enter. You don't need to keep the box open to find other instances of this text, however. Click on Cancel, and notice that the double arrows at the bottom of the right-hand side scroll bars have turned blue. Clicking on one of them will take you to the next place this text occurs, either forwards or backwards through the document, depending on which button you click.

7. AutoCorrect
AutoCorrect allows you to change text automatically as you type it, which can be handy for correcting frequently mistyped words. Click on the Tools menu, then on AutoCorrect and enter a piece of text in the left-hand column. Whenever you type it, it will be replaced by the text in the same row in the right-hand column of the dialogue box.

8. Select lots of text
It can be very difficult to select more than a few paragraphs of text at once using only the mouse, particularly if you have a fast PC, as the text will shoot past before you notice. But you can select large amounts of text easily by clicking where you want your selection to start, then navigating to the end of the intended selection using the mouse wheel or scroll bars. Then just hold down Shift and click again to select the block of text.

9. Saving grace
If you are working on several documents at once, you can save them all without closing Word in the process. Just hold down Shift and click on the File menu. You will see a new option Save All. There is also an option to Close All if you want to do so without closing Word.

10. Simple formatting
If you're going to create a number of documents that are similar in appearance, it's best to use styles to format text rather than applying the formatting yourself. This ensures that you can change it easily throughout the documents, if you need to. You can, however, use the Format Painter to copy the formats from one paragraph and apply it to another. Select the Format Painter button from the Word toolbar and click on the portion of text you want to copy a format from. Now drag the pointer over the selection you want to apply the formatting to.

11. Scraps
You can create 'scraps' in Word, which are small blocks of text from a document. Highlight some text in an open document and drag it to the Desktop, and you will see it appear as a document scrap. You can arrange and rename your scraps on the Desktop, and simply drop them back into Word documents as you need them. The scraps can be pasted into most other applications too.

12. Snappy corrections
Instead of using the spell checker once you've finished writing a document, you can correct words as you type. Right-click on a red-underlined word, and Word will show you a menu of replacements it thinks are suitable. This also works for green-underlined phrases that Word thinks are not grammatically correct. Right-clicking them will again open a menu with suggested replacements.

Word shortcut keys
Most of us spend more time using Microsoft Word than any other Office application, so make use of our handy guide to Word's shortcut keys and cut down the time you spend hunting for what you want among the many menus and toolbars.

Ctrl+B Make selected text bold
Ctrl+U Underline selected text
Ctrl+I Make selected text italic
Ctrl+L Align selection or paragraph to the left of the screen
Ctrl+E Align selection or paragraph to the centre of the screen
Ctrl+M Indent paragraph or selection
Ctrl+1 Single-space all the lines in selection
Ctrl+2 Double-space all the lines in selection
Ctrl+5 1.5-space all the lines in selection
Ctrl+Space Toggle AutoCorrect
Ctrl+Del Delete the word to the right of the cursor
Ctrl+Backspace Delete the word to the left of the cursor
Ctrl+Shift+8 Toggle hidden characters that mark spaces, carriage returns, and so on
F7 Run a spelling and grammar check
Shift+F7 Use the Thesaurus

EXCEL

13. Use Smart Tags in XP
Office XP features Smart Tags, which are like intelligent links to websites or locations on your PC's hard disk. Excel will recognise certain words and show Smart Tag action buttons next to them. Go to the AutoCorrect options part of the Tools menu and select Smart Tags to see which words it will recognise. You can download and install new Smart Tags from the Microsoft Office website. You will find tags there for both Excel and Word.

14. Spot corrections and errors
If you share Excel documents with others, it can be useful to see any changes they have made. Excel 2000 used red triangular indicators to highlight cells in which there were comments. In Excel 2002, there are purple indicators for Smart Tags and green ones for possible errors in formulas. Options can be found in the Tools menu, under the Error Checking tab of Options.

15. Open older macros
You will probably not be able to open old macros (from Excel 97 or 2000 workbooks) in Excel 2002 as the program will throw up a security warning notice. If you need to use old macros, go to the Tools menu and select Options, Security, then Macro Security and make sure Low is selected. Under Trusted Sources, place a tick in the Trust add-ins and Trust Visual Basic boxes. You will then need to restart Windows before you can run your old macros.

16. View important cells
Using the Watch window you can keep an eye on important cells in a spreadsheet. Click on a cell containing data and go to the Tools menu, choose Formula Auditing and then Show Watch Window. Click on Add Watch and it will display values and formulas for any cell of any open workbook.

17. Use labels in cells
You can make Excel work with labels you have given to cells instead of having to use the cell position ('Profit' instead of 'A6', for example). Go to Options in the Tools menu, and click on the Calculation tab, then tick the 'Accept labels in formulas' box.

18. Create formulas
Create a formula by clicking on the Paste Function tool (which is marked 'fx') on the standard toolbar. If you select a function from the list, its description will appear in the dialogue box, and the Help button will explain more about the formula. Alternatively, clicking on the equals sign in the formula bar will display a list of recently used functions.

19. Links
If you are seeing error messages about broken or invalid links to other workbooks or other applications, go to the Options part of the Tools menu and choose the Workbook Options tab. Make sure the box marked 'Update Remote References' is ticked. If you tick the box marked 'Save External Link Values', you won't have to worry about maintaining links but your file may end up significantly larger.

20. Create subtotals
It's easy to create sums of columns using the AutoSum tool but what about subtotals? Creating these needn't be hard either. Just use the function =SUBTOTAL (9,B2:B10). The 9 is a function number, representing SUM, and you should replace the cell references with the ones from your own worksheet. You could place it in cell B11 and then repeat it with figures below, say =SUBTOTAL (9,B12:B20), in cell B21. If you then used the AutoSum tool in cell B22 it would just display the sum of the subtotals, from cells B11 and B21.

21. Delete vs clear
There two ways to remove information from cells: Delete and Clear. Clicking on a cell and selecting Delete (or pressing Del or Backspace) will remove the cell's value or formula, but any formatting and comments will remain in place. If you want to return the cell to its original state, with no formatting, choose Clear instead.

22. Informative printouts
Many of us have spreadsheets that spread over more than a page. If you want your column titles to print on every page, go to the File menu, click on Page Setup and go to the Sheet tab. Click on the red arrow in the box marked 'Rows to repeat at top' and select the rows that contain your column titles, then click on OK.

23. Delete comments
You can delete all the comments from your worksheet at once, for instance if you have finished the sheet and want to distribute it without annotations. Press Control, Shift and O at the same time, and this will select all the cells in the worksheet that contain comments. Right-click on one of them and select Delete Comment, then click anywhere on the sheet and all the comments will have vanished.

24. Keep track of online orders
When you order online, it can be hard to keep a record of all your orders. You can, however, transfer the table from the confirmation email the retailer sends you into an Excel workbook. Open the email and click at the start of the table, then hold down Shift and click at the end of the table. Right-click on it and choose Copy, then open a blank Excel worksheet. Right-click on a cell and choose Paste. You may have to correct the formatting for it to look better.

25. Figuring out formulas
If you have a formula that's puzzling you because you can't figure out how it was derived, click on the cell that contains it, and choose the Auditing option in the Tools menu, and select Trace Precedents. You will see blue dots in the relevant cells, with arrows pointing towards the formula. When you have finished, choose Remove All Arrows.

26. Import finance data
You can import data from most online banks and finance programs into Excel, but it's often not quite as simple as just opening the document in Excel. It will usually be in Comma Separated Value (.csv) format. In Excel, click on the File menu and choose Open, then choose 'Text Files (*.txt, *.prn, *.csv)' from the 'Files of type' box, and select the CSV file you obtained from the bank website. Once it has opened, just adjust the column widths so they look right.

27. Show zeros the door
You can remove zeros that you don't need from your cells by going to Tools, Options and then View, and removing the tick from the Zero values box. If you want zeros to appear in certain cells, give those cells the custom format '0;-0;;@'. To enter a custom format, go to Format and Cells, and choose the Number tab, then select Custom and enter the format. For dashes to appear instead of zeros, use the custom format '0;-0;?-?;@'.

Excel shortcut keys
Don't get bogged down in Excel's options and commands. Use this guide to its keyboard shortcuts to fly around the keyboard and get your work done without having to take your hands away to move the mouse all the time.

Ctrl+- Delete the current cell or selection
Ctrl+Shift++ Insert cell or selection
Ctrl+; Insert current date at the selected cell
Ctrl+Shift+; Insert current time at the selected cell
Ctrl+K Insert a hyperlink or web link
Ctrl+Tab Switch to the next worksheet in the workbook
Shift+F3 Open the formula window
F11 Create a chart
Ctrl+Space Select all of the current column
Shift+Space Select all of the current row
Ctrl+Shift+1 Format the current cell with commas
Ctrl+Shift+4 Format the current cell as currency
Ctrl+Shift+5 Format the current cell as a percentage
Ctrl+Arrow key Move to the next used cell in the direction of the arrow key
Ctrl+F Open the search box

Read more...

About This Blog

Software Blogs - BlogCatalog Blog Directory

bili sao

  © Blogger templates Newspaper II by Ourblogtemplates.com 2008

Back to TOP