Back to Newsletters KEYWORDS= Davrom Consulting Newsletter - Issue # 43 - Dated: 12 Dec 2008 From the desk of David Clark Well its Christmas time again and by now most of us are looking at spending a few days with family and friends (and food and .....). We are available for support over the Christmas break excluding the usual public holidays. In this last issue for the year I have covered using the /etc/hosts file as your network setup reference and reviewed some of the solutions we have worked on during the past year that might help others become aware things you can do with Linux and UNIX. I would like to wish all of you a very Holy and Happy Christmas and that the New Year sees you healthy, happy and prosperous. I would like to thank the reader for their time in reading this newsletter. David.M.Clark UNIX Quote By golly, I'm beginning to think Linux really *is* the best thing since sliced bread. -- Vance Petree, Virginia Power hosts file A practice that I have followed for a long time now is to use the hosts file to keep an accurate updated record of what IP addresses are most relevant to the Linux/UNIX servers in the network. As not all sites or at least most sites do not run their own internal DNS server (Domain Name Server) to lookup names to map to IP addresses, keeping an update hosts file is essential in maintaining a network and diagnosing any network issues. Sites running DHCP will not require the hosts file to be too detailed but the average server should contain as much network device information as possible. On Linux and UNIX the /etc/hosts file contains, at the very least, the local loopback IP address of 127.0.0.1 (never remove or alter this entry) and the local LAN IP address of the current server. By adding other IP addresses on your LAN to the /etc/hosts file gives you a central record of what devices are actually connected to your network. A typical hosts file might be: 127.0.0.1 localhost.localdomain localhost Note the use of the # symbol throughout the file to place comments on what the entries pertain to. Adding the additional comment to the end of the each IP address line is always especially helpful. It is very simple to then see what IP addresses are available for new network devices and gives you the ability to use utilities like ping, rcp, rsh, rcmd, ssh, rsync and traceroute without having to remember the IP address. One final thing I recommend with /etc/hosts once it is updated is to then replicate it around the network to the other servers and Windows PCs. A copy of the hosts file in Windows XP can be found in C:\windows\system32\drivers\etc folder and is called hosts. Older Windows versions had a hosts.sam file which you then renamed and modified to act as a real hosts file. Why not look at making your hosts file your central source of network reference. Davrom projects over the past year It is always good to look back over a year or two and revise projects you have been involved with and to this end I have listed here some of the projects and kinds of capabilities existing with UNIX and Linux systems aside from being application and basic e-mail/web servers. The following is a list of solutions both custom written for the customer or simply implementing another phase of an existing technology solution available. Squirrelmail: Squirrelmail is still one of the best webmail based solutions available. This facility allows remote users to browse to the web server and access e-mail via web browser. This is implemented on all Davrom installed web servers. Some customers have opted for extra plugin features to be installed to have features like the browser not being able to remember the password (ideal for security when using someone else's browser) included in webmail. Remote file uploads/downloads: Using both HTML (PHP) and FTP we have been involved in projects that allow remote users to upload and download files to/from their company's web server. We have also designed web interfaces that allow administrators to control access to the HTML/ftp sites. Secure e-mail groups with Procmail: We have implemented various procmail solutions which allow a defined group of e-mail addresses to pass e-mail to each other without the fear of e-mail being sent to the group by spammers or non-group members. Procmail is an extremely powerful extension to Linux/UNIX e-mail servers and can be used to control spam or create automated distribution e-mail lists as well as handle incoming e-mails in a whole host of ways. Secured websites: We have implemented a number of secure websites using PHP technology to allow users to access websites using a username and password to access private/company information via web browser. Centralised backup to USB drive: With the high availablity of affordable large USB hard drives, a lot of customers are now running solutions like our dav2usb product that performs backups of their entire UNIX/Linux systems to external USB hard drives. We are finding that more and more people are favouring backup to USB drives instead of tapes owing to their pricing, capacity and ease of restore capability. VMware: 2008 is surely our year of VMware. We have installed quite a few VMware based solutions these past two years with the greater portion of these this year. VMware offers a highly flexible way to continue and preserve to use older applications running on older operating systems that are no longer compatible with the latest hardware architecture. The most common of these of late is running older SCO application servers inside Linux Fedora servers or Windows Servers. On my desktop I am running various other UNIX, Linux and one Windows VM so I can boot these and test various things for customers - all without needing separate hardware. General e-mail solutions: We have continued to develop davromspam which is a web front-end into controlling and monitoring SpamAssassin including white and black listing capabilities. From the Trenches Some comic or not so comic relief from the support days gone by. This one has been going around for some years now in one form or another. UNIX Christmas Song: better !pout !cry better watchout lpr why santa claus cat /etc/passwd >list ncheck list ncheck list cat list | grep naughty >nogiftlist cat list | grep nice >giftlist santa claus who | grep sleeping who | grep awake who | grep bad || good for (goodness sake) { be good } Tech Tip Have you ever wanted to kill off a set of processes or print jobs that match a specific pattern? Here's how to cancel print jobs destined for a particular printer: lpstat laser1 | awk '{print $1}' | xargs cancel This will run the cancel command (thanks to xargs) on all print jobs currently queued to the laser1 printer. Another handy command that you can run with some caution is to bulk kill a specific set of processes. Perhaps you are running Apache and it won't close down - here is how to kill off all proccesses that are running for Apache: ps -ef | grep httpd | grep -v grep | awk '{print $2}' | sort -rn | xargs kill First our "ps -ef" gives us a listing of all process. Then "grep" shows us the httpd processes. We ignore our "grep" command using "grep -v grep" so it doesn't try to kill it. awk extracts the second field from the "ps -ef" listing which is the proccess ID. We run this through sort numerically in reverse order. Finally xargs then runs a kill command on the process list. You can't beat UNIX/Linux for this kind of control over the operating environment. Back to Newsletters Website design by Davrom Consulting Pty Ltd This site is fully tested with Google Chrome and Firefox web bowsers Home Page | Support | Misc | David's Pages | Podcasts | Contact Us | Blog |