Operating Systems

Apache Web Server - Apache ServerBest we can say about this article is that it is merely a bried preview of what an Apache Server is and what it can do. A must for any network admin or any webmaster.
Divider Line

C Programming Tutorial (K/R Ver. 4) -

C Programming TutorialCaution: This tutorial is HUGE. Please allow ample time to load.
Every program is limited by the language which is used to write it. C is a programmer's language. Unlike BASIC or Pascal, C was not written as a teaching aid, but as an implementation language. C is a computer language and a programming tool which has grown popular because programmers like it!

Divider Line

Types of Servers 2 - Types of ServersOne of most important type of server is cluster servers. Software that enables clustering of servers is installed into a computer. Clustering servers also serve as load balancing servers between two computers. This is a common small business server. Clustering servers are used to avoid server failover. Server failover is the capability to shift to another standby server if the main server fails.
Divider Line

Computer Training Excuses - No ExcuseYou wouldn't go to a doctor who had never been to medical school, or hire a lawyer who never studied law. One side-effect of a world advancing as rapidly as ours is that fields are becoming more and more specialized and narrow. People can no longer get by on general knowledge in their careers, something I found out for myself not too long ago. I'd been out of high school for two years, scraping by on my own and picking up scraps of programming as I went. I saw all of the self-taught programmers breaking into the IT industry, and I hoped to do the same. After all, IT is one of the few industries out there where being creative and a quick learner is more important than a degree.
Divider Line

Types of Attacks on Web Servers - DOS AttackI think we hit the mother-load of server security information in this article people. We urge, every server admin as well as those looking to get into server and network security to not miss out on this article. You may already be experiencing attacks and wouldn't even know. And we like to point out that this article has no views against the "White-Hat Hacking Community."
Divider Line

UNIX Programming Environment - UNIX-Programming-EnvironmentCaution: This tutorial is HUGE. Please allow ample time to load.
If you are coming to unix for the first time, from a Windows or MacIntosh environment, be prepared for a rather different culture than the one you are used to. UNIX is not about `products' and off-the-shelf software, it is about open standards, free software and the ability to change just about everything.

Divider Line

Crash Proofing Your Computer - Crash Proofing Your ComputerThis is a list of nine very useful tips to Crash Proof your computer. Install more RAM. Yeah, everybody says it, but its true. If you can't stop buggy programs from leaking memory, you can at least give them more memory to leak. How much RAM do you need?
Divider Line

LiLi USB Creator 2.8 - LiLi USB CreatorThe advantages of a USB flash memory over a CD or DVD are obvious and indisputable. The speed and efficiency of data manipulation, and the ever growing capacity, with the constant drop of prices made the popular flashes became the integral part of everybody's personal pocket inventory. When you add the fact that most new computers have the option to boot from transportable media, it is completely logical that this method will become popular and almost a default way to start live systems.
Divider Line

What are Operating systems? - Operating systems The way that computers work is that they use something called an Operating System, basically a platform in the form of a low level software which enables programers and other people to make other, more complex programs. A common misconception is that OS (operating system) software runs only on computers, but the truth is that it runs on phones, routers and other network devices.
Divider Line

Differences Between Linux And Windows - Windows or LinuxThis article will discuss the differences between the Linux and Windows operating software's; we discuss some of the pro's and con's of each system. From this point forward we will discuss some of the more prominent ways in which Linux deferrers from Windows.
Divider Line

Web Server Error Messages - Web Server Error Messages Many times these errors have more to do with the Web servers you're trying to access rather than something being wrong with your computer. Here is a list of error messages you might encounter while surfing the Web and their respective meanings to help you figure out just what the problem is. Here is a list of error messages you might encounter while surfing the Web and their respective meanings to help you figure out just what the problem is.
Divider Line

Short Introduction to Operating Systems - Operating systemsWe at TW were browsing about the web when we stumbled upon Mark's work. Although it's much outdated, it's very fundamental. And please don't let the title fool you. This is not a small short article but a short OS introductory book. An operating system is a layer of software which takes care of technical aspects of a computer's operation. It shields the user of the machine from the low-level details of the machine's operation and provides frequently needed facilities
Divider Line

Brief History of UNIX - Brief History of UNIXUnlike DOS, Windows, OS/2, the Macintosh, VMS, MVS, and just about any other operating system, UNIX was designed by a couple of programmers as a fun project, and it evolved through the efforts of hundreds of programmers, each of whom was exploring his other own ideas of particular aspects of OS design and user interaction. In this regard, UNIX is not like other operating systems, needless to say. It all started back in the late 1960s in a dark and stormy laboratory deep in the recesses of the AT&T.
Divider Line

Ubuntu in Place of Windows - UbuntuMost people think of Linux as something only for geeks and computer power users. However, we have come to see various flavors of LinuxOS being sold in major retail stores in the last few years and we also see a trend being set online. In this article, we're simply going to single out only one of many Linux flavors known as Ubuntu.
Divider Line

TW Tech Glossary - Misplaced your bible? Well here it is - Tech Glosasary! This truly took a while to complete and should be used by all from beginners to advance techies.
Divider Line

MD5 File Hasher 1.3 - MD5 File HasherThe hash function is a way of mapping a collection of information that can be various lengths in other values of fixed length. The values that the hash function gives are called hash values, codes, sums, checksums or simply hashes. MD5 is a cryptographic hash algorithm, which means that it takes information of arbitrary length and creates fixed lengths for it, a cryptographic hash value, in a way that any change of data (accidental or on purpose) leads to the change of that value.
Divider Line

How To Recover Deleted Files? - How To Recover Deleted Files?How many times have we come across TW visitor saying "How do I recover files" or "I deleted files from the recycling do I restore deleted files?"

Well, don't worry and be happy that you came across this little article on TechiWarehouse.Com.

You can often successfully recover deleted files from a PC, it all depends on what has happened since the files were deleted.

Divider Line

Internet Security and Acceleration (ISA) Server - ISA ServerThis weeks article discusses the nitty gritties of Server and Network Security and how to implement them. ISA Server uses Cache Array Routing Protocol (CARP) to enable a Web proxy array of virtually unlimited size for high availability and accelerated Web access. Internet Security and Acceleration (ISA) Server was built to enable companies to customize and extend their security and management features for optimum security and network performance by using a wide range of third-party solutions.
Divider Line

Most Common TCP Ports - TCP Ports TCP ports will popup almost with any application you use wether it is ICQ or FTP. It will soon be realized how good its knowledge is once you yourself will start applying it in day to day tech use. TCP/IP uses several protocols, the two main ones being TCP and IP.
Divider Line

Types of Servers - Types of Server Ever wonder what types of things servers take part in? Ever wonder the possibilities? Well read all about it here in this weeks article. A good 10 minutes reading for all you future potential system admins. Servers are often dedicated, meaning that they perform no other tasks besides their server tasks.
Divider Line

What is Unix?

Due to its portability, flexibility, and power, UNIX has become the leading operating system for workstations. Historically, it has been less popular in the personal computer market, but the emergence of a new version called Linux is revitalizing UNIX across all platforms.

UNIX was one of the first operating systems to be written in a high-level programming language, namely C.

Pronounced yoo-niks, a popular multi-user, multitasking operating system developed at Bell Labs in the early 1970s. Created by just a handful of programmers, UNIX was designed to be a small, flexible system used exclusively by programmers.


Copying an Entire Directory Structure

The Unix tar command provides an easy and effective way to copy an entire directory structure. For example, to copy the directory ~/projects/codered to ~/backups/codered

$ cd ~/backups
$ mkdir codered
$ CD codered
$ tar cfv - -C ~/projects codered | tar xvpf -

This will create an exact duplicate of the codered directory in the ~/backups directory. The permission lists for each file and directory will be preserved and symbolic links will continue to point to the correct files.

What directory am I working in?

If you forget which directory you are currently working in try using the pwd command. Pwd lists the full path to the working directory.

$ pwd

Use the find and grep commands together to create a powerful searching tool.

The find command searches for files by filename and the grep command searches for text string within a file. Used together, they are a powerful searching tool. For example, suppose you are looking for a document you wrote earlier in the year. You don't remember its name or what directory it is located in but you know it contains the string elephant. Use find to recursively search through all files in your home directory. Use the -exec option to execute the grep command on all files found.

$ find ~ -name '*' -exec grep -l 'elephant' \{\} \;

The document animals.txt located in the directory Africa contains the string elephant.

Use the IP Loopback Address to Check for TCP/IP Networking

Virtually any UNIX machine using TCP/IP networking supports the IP loopback address When a machine is told to connect to, it will connect to itself. One of the first steps in troubleshooting a network problem is to ping the loopback address.

$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=255 time=0.053 ms
64 bytes from icmp_seq=1 ttl=255 time=0.056 ms
64 bytes from icmp_seq=2 ttl=255 time=0.044 ms
^C--- ping statistics ---

3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.044/0.051/0.056/0.005 ms[1]
If ping responds with a message like ping: no answer... or 100% packet loss there is no TCP/IP networking functioning on the machine. The address will work even if the machine is not physically connected to a network so the ping command only checks that TCP/IP is installed and configured well enough for basic functionality.

Using Nohup

Use the nohup command to keep a process running in the background after you logout.

$ nohup cmd &

For example, suppose you use the tar command to backup the /docs directory to a tape, /dev/rmt/0

$ tar cvf /dev/rmt/0 /docs > tar_log &

In this example, standard output is redirected to the file tar_log. If you logout before the command finishes executing, it will stop the process and your backup will not be completed. However, precede the tar command with the nohup command and the backup will finish even if you logout.

$ nohup tar cvf /dev/rmt/0 /docs > tar_log &

Enter multiple commands on a single line.

You can enter multiple commands on a single line by separating them with a semicolon. For example,

$ date; pwd ; ls
Tue Jan 9 22:17:57 CST 2001
file1 file2 file3 sdir1
file4 anotherfile ddir

executes the date command, followed by the pwd command followed by the Ls command.

Use tee to simultaneously save command output in a file and see it on the screen.

The tee command duplicates standard input then sends one copy to standard output and saves another in a file. Tee is typically used with a pipe. For example,

$ find . -name '*.txt' -print | tee txtlist

searches an entire directory structure for files whose filenames end with .txt and saves the output in the file txtlist while simultaneously printing the output to the screen.

Tee can also be used to view the intermediate output from a group of commands linked by pipes. For example,

$ grep -i 'urgent' err_log | tee todo | wc -l

Searches for the string urgent in the file err_log using the grep command and saves the output in the file todo as well as piping it to the wc (word count) command. There are 9 lines in the err_log file that contain the string urgent.

Use your shell's history function to save typing.

Most shells provide a history function to reexecute commands without retyping them.
If you use the c-shell, tc-shell, bash or z-shell, type


to reexecute the most recent command that begins with string. For example,

% find . -name '*' -print > flist

creates a file named flist in the current directory that contains a file listing. After running other commands

% cat f1
% CD ~/proj1

you can rerun f ind without retyping the entire command.

% !fi

Use CTRL-d to cancel a login.

Ever telnet, rlogin or ftp to the wrong machine? Use CTRL-d instead of a username to cancel the login.

$ telnet


Connected to

Escape character is '^]'.

FreeBSD/i386 ( (ttyp4)

login: CTRL-d

Connection closed by foreign host.

Use the touch command to create an empty file.

The touch command normally updates the access and modification time of a file. Used with a filename that does not exist, touch will create an empty file named filename.

$ Ls newfile
Ls: newfile: No such file or directory
$ touch newfile
$ Ls newfile

This can be useful before using output redirection or when writing shell scripts.

Trouble spelling a word? Use the look command to find it in the dictionary.

Not sure how to spell a word? The look command will help.

look pattern

Look will search the system word file for words starting with pattern. It is a good way to check spelling. For example, say you're not sure if the correct spelling of the word success is success or sucess. Try

$ look suc

Use the cal command to generate a calendar for a given month and year.

For example,

$ cal 1 2002
January 2002
Su Mo Tu We Th Fr Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

Note that you must use the four-digit year. Use cal without specifying a month or year to get the current month.

Recursively Change File Permissions

You can recursively change file permissions using the find and chmod commands. For example, to change the file permissions for all files in the private directory and all of its subdirectories so that no one but you has access use the following commands.

$ CD ~/private
$ find . -name '*' -exec chmod go-a \{\} \;

To change the file permissions starting from your home directory so that others have no access use the following command.{\} \;

$ Find ~ -name '*' -exec chmod o-a \

Be careful if you have a web page. If others have no access to the web page files then they can't load your pages in their browser.

You can use more advanced features of the find command to search for files and change permissions. For example, search for any files that have write access for the group or others and remove them.

$ Find ~ -perm -002 -exec chmod o-w \{\} \;
$ find ~ -perm -020 -exec chmod g-w \{\} \;

Use Info-ZIP to uncompress Windows zip files on a UNIX system.

The zip compression and archiving standard is commonly used to store and distribute Microsoft Windows files. Because Windows is such a commonly used operating system, UNIX users may find they need to create or uncompress (i.e. unzip) a zip archive to share documents. Fortunately, the Info-ZIP organization provides a free UNIX version of the zip and unzip programs. They can be downloaded as source or ready-to-run binaries for several different UNIX flavors. After installation, unzip can be used to uncompress a zip file. For example,

$ unzip

uncompresses files in the zip archive named into the current directory. Unzip will create subdirectories if necessary. Use the -d option to specify a directory other than the current directory.

$ unzip -d /tmp

Use the -l option to list the contents of the zip archive without uncompressing.

$ Unzip -l

Zip can be used to create a zip archive which Windows users can easily unzip. For example,

$ zip *.c

creates a zip archive named that contains all of the files in the current directory whose filenames end with .c. If you want to include entire directory structures in your zip archive use the -r (recursive) option. For example,

$ zip -r cdir

includes the entire directory structure beginning with cdir in the zip archive
Other commands that come with the Info-ZIP utilities allow you to unzip files as part of a pipe, create self-extracting archives and encrypt archives for security.

Compiling a program

Most of the compilers on UNIX machines will automatically compile, assemble and link your code. You can use command line options to specify otherwise.

The compile component of a compiler will check the source code for syntax errors. If there are no errors the assembler creates an object file (.o). The compiler links the object file to any specified libraries and creates an executable.

Using the Fortran compiler as an example, the basic syntax for a compile command is:

f77 [options] source-filename

FORTRAN source code files have ".f" as a suffix. C programs end in ".c", C++ in ".C" and Pascal in ".p". Object files end in ".o" and libraries end with ".a".

The simplest compile statement would have a format as follows:

f77 file.f

The above statement would create an executable file called a.out. If you want your executable to be called something else, then you can use the "-o" option for the compiler. In the following example, the executable will be called "myprog".

cc myprog.c -o myprog

Options such as "-o" are common to most UNIX compilers. For more information on the options available for a compiler see the man page for the specific compiler (i.e., "man f77" or "man cc").

If there are several source files, the files can be compiled together, provided that the source code with the "main" procedure is listed first.

f77 -o myprog1 main.f sub1.f sub2.f

To run the executable created above, type myprog1.

If executables run incorrectly, or not at all

If the source code compiles without errors, yet does not run correctly, you will need to debug the programs. There are many UNIX debuggers available, including dbx, x11ups and gdb. To be able to use a debugger you must compile your source code with the "-g" option. This tells the compiler to create an object file with some additional symbolic information that will be used by the debugger.
cc -g filename.c -o filename

The dbx debugger can be used to debug C, FORTRAN, Pascal and, in some instances, C++ code

How do I print a UNIX man page?

On most systems the following command syntax will work.

man cmd | col -b | ul -t dumb | lprFor example,

$ man Ls | col -b | UL -t dumb | lpr

will print the manual page for the Ls command. Similar command syntax can be used to save manual page output in a plain text file that can be viewed with a text editor or printed. For example,

$ man Ls | col -b | UL -t dumb > ls.txt

creates a file ls.txt that contains the output from the man Ls command in plain text.
Also, see the Online Man Pages document for links to HTML formatted man page for various UNIX flavors.

jdate: today's date in English

A convenient way on inserting the date in my favourite format in any document: e.g. in vi, typing "!!jdate", or the ex equivalent ":r!jdate", inserts "Sunday 21st October 2001".

set `date +'%A %d %B %Y'`
case $day in
01) day=1;;
02) day=2;;
03) day=3;;
04) day=4;;
05) day=5;;
06) day=6;;
07) day=7;;
08) day=8;;
09) day=9;;
case $day in
1?) day=$day"th";;
*1) day=$day"st";;
*2) day=$day"nd";;
*3) day=$day"rd";;
*) day=$day"th";;
echo $1 $day $3 $4

whattime: the time in various time zones


for i in Europe/Dublin Europe/Berlin US/Eastern US/Central US/Mountain US/Pacific
export TZ=$i
case $1 in
"") echo "`date` $i";;
*) echo "`date` $i" | grep $1;;

overwrite: overwrite one file with another

#overwrite: overwrite file with o utput of command
#note: must use redirection of input from file in command if required


case $# in
0|1) echo 'Usage: overwrite file cmd [args]' 1>&2; exit 2

file=$1; shift
new=/tmp/overwr1.$$; old=/tmp/overwr2.$$
trap 'rm -f $new $old; exit 1' 1 2 15

export PATH=$opath;
if "$@" > $new
cp $file $old
trap '' 1 2 15
cp $new $file
echo "overwrite: $1 failed, $file unchanged" 1>&2
rm -f $new $old
exit 1
rm -f $new $old

Job Control

List Jobs that are currently running and the status: jobs

Move a job to the background for processing: bg ##[enter] (## would be a valid job number)

Move a job to the foreground for processing: fg ##[enter] (## would be a valid job number

Shell Tricks

To display the hostname in the shell prompt do the following:

add PS1=`\hostname`#\ to the .profile file

FreeBSD 4.5 sets the telnet session to try to "auto login" when connecting to things like Cisco routers.

To disable this "feature" you can do one of the following:

Type this command - echo default unset autologin >> ~/.telnetrc

Type this command - telnet -K somehost.somenet

Security versus Integrity

Security is a question of how easy it is for unauthorised users to access the machine, or the data stored on the machine. Walking away from an active terminal is a breach of security.

Integrity is a question of how safe the data is on the machine. Users who leave incomplete updates on their terminals are a potential danger to data integrity.

Shutting Down

Always shut down your UNIX machine cleanly. The power switch and reset button are for emergencies, not convenience.

Teach your users to log out of the machine when they have finished work. If they simply turn their terminal off, they may not close their login session; this leaves a large hole in the security and integrity of the system.

Did You Know?

  • Unix is known to be one of the most stable Operating Systems to be used.

  • UNIX sytem can support over one hundred users with each running a different program set. This feature is thus extremely cost effective.

  • UNIX kernel is the main center of the UNIX operating system. The kernel takes on the resposibility for managing and controlling the computer's resources so that each user has his/her fair share of these resources.

  • The UNIX shell is the interface between the user and the operating system. The shell in this way acts as a "command interpreter".

  • Different shells are good for different things as they each have shell specific commands. The C Shell, for example is excellent for creating and editing programs written in the C programming language.

Premium Tutorials & Screencasts

Partners Links