Davrom Consulting Pty Ltd

Established Since 2001
PO Box 1644, Sunnybank Hills, Qld, 4109
ABN: 81 096 990 804


Site Time: 15 October 2024 - 11:42




Back to Newsletters

KEYWORDS=fedora 11,xrdp,e-mail,thunderbird,usb,awk,sort Davrom Consulting Newsletter - Issue # 44 - Dated: 27 Aug 2009


From the desk of David Clark

Normally after a few people have told me they haven't seen a newsletter
for a while, I get the prompt to make sure I send one out, so here it is.

Support lately has been a myriad of things from new site installations,
putting SCO systems inside VMware, working with USB backup solutions for
Linux, installing new application servers and working with web server
e-mail and web contact/submission lists.

Also quite a few customers have been leaving Outlook (and Outlook Express)
in favour of Thunderbird which as you will have seen from previous
newsletters, is one of the best e-mail clients around. There is also an
increasing need for people to read their e-mail on their mobile phones
(easy when you have a Linux e-mail server) which is becoming a better way
for staff to keep updated rather than using SMS systems.

I am running the latest cut of Fedora 11 on my desktop and it is a good
stable platform.

I would like to thank the reader for their time in reading this
newsletter.

David.M.Clark


UNIX Quote


When you say "I wrote a program that crashed Windows", people just
stare at you blankly and say "Hey, I got those with the system, *for
free*".' (By Linus Torvalds)



Linux/UNIX server e-mail stats

If you are running an application on your Linux or UNIX server it is possible
that the application will be running some automated tasks which in turn
produce an e-mail to someone. For the most part these e-mails may just go to
the root user or the application user that runs the task - in any event most
of the time these e-mails never see human eyes all too often until it is too
late or the information the e-mails contain are now useless.

By default Linux and UNIX servers are Internet ready and it is good
practice to set them up as e-mail and web capable even if the server is for
internal use only and it never sees active service on the Internet.

Ensuring that the overnight processing of an application is sent via e-mail to
a real person, regardless of how mundane the task and resulting message, can
make all the difference to making sure database indexes and any internal
processing is running correctly. Sometimes our servers have been trying to
tell us something but we only find out the after a hickup or disaster occurs.

You can setup your server to send e-mail to an individual e-mail address
or use the server aliases facility to ensure a group of e-mail addresses
receive the notifications.

Remember, e-mail was designed for humans to read.


xrdp on Linux

xrdp allows you to access your Linux X-Windows desktop remotely via the
standard MS Windows Remote Desktop facility or Windows Terminal Services
Client.

Unlike MS Windows to MS Windows Remote Desktop, if you are already logged
on into the Linux X-Windows desktop, your Linux session will not be booted
off if you then access it via another Remote Desktop connection. Your
Remote Desktop session is treated as another connection to X-Windows and
you are presented with the default desktop environment for the user you
connected as.

This has been useful for me in our home using my wife's PC from time to
time to access my Linux desktop which is at the other end of our house.
(If I could get an RDP client for my Nokia E71, I would most likely use
this as well).

xrdp is simple to install which you compile from the supplied source code
at:

http://sourceforge.net/projects/xrdp


From the Trenches
Some comic or not so comic relief from the support days gone by.

RTM - yes, techs such as yours truly do not read manuals.

When LAN Manager server was first released for SCO UNIX in 1991, my
colleague (and boss) were working on getting a prototype setup to
demonstrate and install for a major client.

As my colleague was an MS/LAN Manager expert he was keen to have another
server option to present to customers for our various solution offerings
at the time.

We had installed the correct network card (at that point LM for SCO only
ran on 3COM and SMC ethernet cards) and the SCO server could ping the PCs
and visa-versa. Everything looked fine but whenever we ran the LAN
Manager command at the PC DOS prompt (yes I did say DOS), we received an
error message the share or drive could not be found, followed by an annoying
"Command Successful" message....

We had been running a command like:

net use e: \\scobox\public

which is standard LAN Manager syntax to assign the drive letter E: to the
servers "public" share folder/directory. (Still works in Windows today).

After rebooting and spending hours in repeated setup and testing, the same
two errors continued to show on the PC.

It was about 9:00pm and my colleague at one point typed in "E:" at the
DOS prompt and got access to the "public" share on the SCO server - it
worked despite the error message.

Upon reading the first page of the release notes it indicated that we
needed to ignore the first part of the error message as it was something
to do with MS messaging or something along those lines.

With a riotous cheer we left the office happy that despite the fact had we
simply typed in "E:" at 5:00pm, we would have gone home hours before.


Tech Tip

Here is one that I have had to work with recently as part of the
TellDavrom service - this is a service we run that processes logged
entries from customer servers so we can keep an eye on any events
and ensure backups are running etc. At Davrom I monitor a web page
that shows the entries formatted in HTML. The web page is produced
from a simple text file containing the relevant entries about the
events.

The issue was to take the file that has content such as:

bloggsco|mail|Rebooted|Clean Reboot|0908270203|
orcacomp|proserver|dmctape|HD: 179140 Tape: 179140 Mins: 44|0908270231|
schmoo|mail|davrsync|Updated to version: 1.2|0908270305|
schmoo|mail|davrsync|Server: shalev Local: 348128 Remote: 348130 Trf: 2119 Mins: 8|0908270311|
poodleco|smbserver|Disk Space Alert|/u at 97% used|0908270830|

and have it that the web page would display the data with the latest events
at the top of the web page, so I needed to get the contents above to be
in reverse order to which they were logged.

There are many ways to do this but for the sake of future preservation of
the script itself to run in either Linux or SCO (or any other UNIX) I had
to make sure the commands and code exist on most UNIX systems.

The line that does the magic:

nl -s "=_=" current_dat | sort -rn | awk -F "=_=" '{print $2}'

The 'nl -s "=_="' part places a line number at the beginning of each
line with a "=_=" separating it from the rest of the line. Using the
'sort -rn' puts the file in reverse numeric order. The final bit with
'awk -F "=_=" '{print $2}'' shows the second field of each line which is
the bit I want that comes after the "=_=". The reason I used a separator
such as "=_=" is that I know for sure that it won't ever appear in any
of the log entries TellDavrom receives. For more basic usage I would
have either left out the "-s =_=" option altogether which will just
default to using a ":" as the separator or chosen a different single
character.

There are a heap of different methods out there using perl, nawk and so
on but as in all things shell, you can use many methods to achieve the
same result - and the beauty is it is a one line command.

Let us not forget the "nl" command. A small standard program that you
will find in all versions of UNIX/Linux.

The result from the above command line:

poodleco|smbserver|Disk Space Alert|/u at 97% used|0908270830|
schmoo|mail|davrsync|Server: shalev Local: 348129 Remote: 348130 Trf: 2150 Mins: 9|0908270311|
schmoo|mail|davrsync|Updated to version: 1.2|0908270305|
orcacomp|proserver|dmctape|HD: 179140 Tape: 179140 Mins: 44|0908270231|
bloggsco|mail|Rebooted|Clean Reboot|0908270203|



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