Saturday, September 22, 2007

DOS to NIX text format

For those of you that have ever created a text file on windows and then transfered to a Unix or Linux system you may have run into a problem with the text format.

A text file created in DOS or windows may have a different file format than what Unix or Linux likes. The file will most likely have some extra line ending characters after each line.

There is a util available on most Linux machine called dos2unix that will fix your file.

To fix your file you can run this from a command shell

dos2unix filename

where filename is the name of the file you want to fix.

This has come in handy several times for me especially for shell scripts.

Tuesday, September 18, 2007

Too many Zombies???

Ever run a "top" command on a linux machine and notice a number of "zombie processes"?

Zombies are already dead processes that you really cant get rid of without a reboot.
Ususally they are harmless and take almost no resources.

To view what process ids are the zombies you can use this command from a command shell

ps aux | awk '{ print $8 " " $2 }' | grep -w Z

This will show the pid of the zombie processes.

How to view SWAP information on Linux

Here is a small utility I have used to check the amount of swap space on linux machines.

Generally you would like to have 1 to 1.5 times the amount of swap space as you have RAM.



On a linux machine you can check the swap values with the following command run from a command prompt.

swapon -s

Hope this helps.

See also: How to add a Swap Partition

Friday, September 14, 2007

Dreamweaver Class start in October

I will be teaching a Continuing Adult Education class at Keefe Tech vocational school in Framingham MA starting the first week in October.

For those who are interested please see www.ktconed.org for more info.

Wednesday, September 12, 2007

Testing large file transfers

Another good item to put in your admin bag of tricks is small one line script that will create a file of any size on linux.

To create a file of any size run this from a command shell in linux

dd if=/dev/zero of=largefile bs=100M count=21

The above line will create a file 2100 MB in size called largefile. The "bs" times the "count" will give you the final file size. These can be adjusted accordingly.

I have used this mini script to test out network card bandwidth between servers, switches and routers.

Its really nothing earth shattering but for those that have never seen it, it might be useful.

Tuesday, September 11, 2007

tcptrack - Connection Trace Utility

Well here goes. Forgive my newbie-ness when it comes to blogging. I will get the hang of it soon.

My first real article will be about a linux network tool I found called TCPTrack. I generally use Centos and Redhat Linux versions and I have found that this tool has helped me several times.

What this tool does is display a list of connections on a specific network adapter.
It is invoked from a command shell in Linux using the following command

tcptrack -i eth0

where eth0 is the network interface you would like to monitor.

The tool gives information as to the source and destination IP addresses and ports. This tool is available on rpmfind.net as well as in some linux repos.

As an example of why I used this was to trace the connections to a mail server that were sending spam messages repeatedly. I was able to determine the offending IP address and block it from further spam.

As a network admin I recommend adding this app to your tool kit.

Welcome!

Well I suppose I should jump on this "blogging" band wagon and start one of my own.
In my hopefully non-feeble attempt at blogging I will be writing some of my thoughts on various topics about IT related items such as software and hardware. I may even throw some sports related articles up.

Thats all for now.