Using open source to manage your site.

Friday, April 25th, 2008

Print This Post Print This Post  |  Email This Post Email This Post

 

There are lot of things that need to be managed in the typical small and medium sized computer facilities. My list is as follows
1. System service availability and notification of outage
2. Performance and capacity analysis of servers
3. Performance and capacity of network
4. Hardware/software inventories of servers and workstations
5. software/patch distribution
6. Network traffic analysis
7. Anomaly/threat detection.

This is a lot of information and services that often times are not done either because of cost or complexity. I have found that FOSS applications can go a longway to providing these services at a price you can afford and without requiringng the services of a gaggle of programmers.

These are my must have picks:

(more…)

Is Google wrecking the internet ?

Tuesday, March 11th, 2008

Print This Post Print This Post  |  Email This Post Email This Post

I have always been a fan a  Google. They have pushed the Internet into areas it never thought it would go. BUT, some of it’s success ( translate - money ), has started to make the Internet almost unusable.  There is no doubt that search engines are a necessity and in many respects the backbone of  Internet use. Without the search facilities - we would just be islands of users and information. They provide a great and necessary service to the Internet.

What is starting to  happen is the income paradigm that Google is using is advertising based. And they are willing to let anyone become a vehicle for their advertising. Advertising income is based on the number of people that view an ad and the number of interested people that view the ad. It’s  just like TV or  Radio - so there is nothing new there.  What is new is that everyone wants a little of  Googles money - and  Google is happy to oblige. So, people build websites with lists of subjects that they have found on Google so they can get there little ( or big ) Google advertising income. Now there are becoming an increasingly large number of middle-site websites that only aggregate or replicate  websites so you will  look there first and the site owner  maks e ad revenue from Google. The real rub is we find these site using Google. I have seen pages of Google search results - that are almost identical  and completely middle-sites. They are providing nothing to the net. They will say the aggregation is a great benefit, but that aggregation was one of the fundamental traits of Google and the early search engines.  Worse yet, the technology is easily built that would remove these duplicate and unnecessary middle-sites. Google has no reason to do this, though. The more sites you have to click on , the more ads you are subject to and the more revenue Google makes.

I am feeling the glut of middle-sites and they are making it very hard to user the Internet for research.

Google’s success may bog the Internet down with so much duplicate and unnecessary middle-sites, that is becomes painful and cumbersome to use, just the opposite of what it could be.

Just my opinion

thx

Bill

Ohio is not the mid-West

Thursday, January 24th, 2008

Print This Post Print This Post  |  Email This Post Email This Post

I hear it all the time on the new - that something happened in the mid-West and it is in Ohio or Indiana. I just don’t get it. From my map - Ohio is next to Pennsylvania - which is definately the East. The West starts at the Rocky Mountains wich is over 1200 miles away. And to boot - Ohio is in the eastern time zone. I think Indiana is in the same boat - so is Tennesee. I am hear to lobby for a new designation call ed the mid-East. Any state that is primarily to  the East of the Southern Tip of Lake Superior , should be refered this way.  And for that matter Texas and probably are too far South for my mid-western taste. But I will hold off judgement on that for now.

So please national media - can we get it right now?

thx

Bill

A little script to clean out horde files after removing users

Monday, January 14th, 2008

Print This Post Print This Post  |  Email This Post Email This Post

Horde is an open source application framework that supports a number of applications. We use it here and like it. Here is the script I use tod elete users and clean the associated horde database files. This is setup for a regular PAM authorization  and Mysql environment.

Hope it is useful.

thx

Bill

#! bin/bash
#
# This is my script to delete all records for a given
# users in the horde tables
#
# Exemple usage : /root/horde-delete.sh “john-doe”
#
USER=”$1″
# horde database
DB=”my-horde–database-name”
# horde mysql userid
SQLUSER=”my-horde-Mysql-user”
# horde mysql passwd
SQLPWD=”my-Horde-user-Mysql-password”
# delete from pam
userdel $1
#
# Count records before delete
#
HP_B=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.horde_prefs WHERE pref_uid=’$USER’”`
KE_B=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.kronolith_events WHERE calendar_id=’$USER’”`
MM_B=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.mnemo_memos WHERE memo_owner=’$USER’”`
TO_B=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.turba_objects WHERE owner_id=’$USER’”`
NT_B=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.nag_tasks WHERE task_owner=’$USER’”`
HD_B=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.horde_datatree WHERE user_uid=’$USER’”`
HDA_B=0
COUNT=0
mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT datatree_id from $DB.horde_datatree WHERE user_uid=’$USER’” > /tmp/01
while read I
do
COUNT=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.horde_datatree_attributes WHERE datatree_id=’$I’”`
HDA_B=`expr $HDA_B + $COUNT`
done </tmp/01
#
# Delete records (Comments out these lines for testing)
#
mysql -s -u $SQLUSER –password=$SQLPWD -e “DELETE from $DB.horde_prefs WHERE pref_uid=’$USER’”
mysql -s -u $SQLUSER –password=$SQLPWD -e “DELETE from $DB.kronolith_events WHERE calendar_id=’$USER’”
mysql -s -u $SQLUSER –password=$SQLPWD -e “DELETE from $DB.mnemo_memos WHERE memo_owner=’$USER’”
mysql -s -u $SQLUSER –password=$SQLPWD -e “DELETE from $DB.turba_objects WHERE owner_id=’$USER’”
mysql -s -u $SQLUSER –password=$SQLPWD -e “DELETE from $DB.nag_tasks WHERE task_owner=’$USER’”
mysql -s -u $SQLUSER –password=$SQLPWD -e “DELETE from $DB.horde_datatree WHERE user_uid=’$USER’”
while read I
do
mysql -s -u $SQLUSER –password=$SQLPWD -e “DELETE from $DB.horde_datatree_attributes WHERE datatree_id=’$I’”
done</tmp/01
#
# Count records after delete (Should always give zero)
#
HP_A=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.horde_prefs WHERE pref_uid=’$USER’”`
KE_A=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.kronolith_events WHERE calendar_id=’$USER’”`
MM_A=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.mnemo_memos WHERE memo_owner=’$USER’”`
TO_A=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.turba_objects WHERE owner_id=’$USER’”`
NT_A=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.nag_tasks WHERE task_owner=’$USER’”`
HD_A=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.horde_datatree WHERE user_uid=’$USER’”`
HDA_A=0
COUNT=0
mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT datatree_id from $DB.horde_datatree WHERE user_uid=’$USER’” > /tmp/01
while read I
do
COUNT=`mysql -s -u $SQLUSER –password=$SQLPWD -e “SELECT count(*) from $DB.horde_datatree_attributes WHERE datatree_id=’$I’”`
HDA_A=`expr $HDA_A + $COUNT`
done</tmp/01
#
# Display tables record counts after delete operation
#
echo “Before and after records count for user $USER’”
echo “===========================================================================”
echo “horde_prefs: $HP_B / $HP_A”
echo “kronolith_events: $KE_B / $KE_A”
echo “mnemo_memos: $MM_B / $MM_A”
echo “turba_objects: $TO_B / $TO_A”
echo “nag_tasks: $NT_B / $NT_A”
echo “horde_datatree: $HD_B / $HD_A”
echo “horde_datatree_attributes: $HDA_B / $HDA_A”
exit 0

Help with CSS and xmlhttpd requests

Thursday, December 6th, 2007

Print This Post Print This Post  |  Email This Post Email This Post

I suppose I  am the last person to know about certain things. I know for sure that I spend time messing with code that is CSS’s that I want to modify or are broken and I see more xmlhttp requests that I would like to check.  have been using tcpdump  or Wireshark. I was also using a Firefox addon called Webdeveloper - and this was pretty good , then I was told about Firebug. It is like a light bulb was turned on. Works wonderfully and captures the dynamic xmlhttpd traffic so you can work on it. CSS is a cinch. It is a really nice add on. I have only touched the surface of it’s capabilities as I only started using it this week. But by all means - find it, use it, and smile.

th

Bill

Automatic Shutdown of Windows/Xp Workstations - Part 3

Thursday, December 6th, 2007

Print This Post Print This Post  |  Email This Post Email This Post

Now that we have a command that allows the remote shutdown of machines we need to frame it with so that is can be called via Windows/2003 server scheduler. We want to be able to  call a routine and feed it a list of machines to shut down.
I found on testing the shotdown command that it is very slow to time out. So I want to check and see if a machine is alive before I  issue the shutdown command.

First I need a wrapper to handle the looping through the file . I only did this because it was easier to isolate the file looping and the actual shutdown machanisms.


@echo offif “%1″ == “” goto help
if “%1″ == “” goto help
if “%1″ == “/?” goto help
set listname=%1
echo rocessing list “%listname%”
@echo off
for /F “eol=; tokens=1″ %%i in (%listname%) do call hhs_shutdown %%igoto :eof:help
echo automatic shutdown process


So now we have a wrapper that reads our file of machine to shut down - and will call something called hhs_shutdown with the name of the machine to make things actually happen. Here is hhs_shutdown. BTW - the hhs stands for Hurley High School


@echo offif “%1″ == “” goto help
if “%1″ == “/?” goto help
set pc=%1set pcstatus=
for /f “skip=3 tokens=6″ %%g in (’ping /w 100 %pc%^|find /i “TTL”‘) do @set pcstatus=%%g
if not “%pcstatus%”==”" goto do-shutdown

echo fail on ping test - skipping %pc%
goto end

:do-shutdown
echo Shutting down %pc%

shutdown /c “Server Scheduled Shutdown” /s /m \\%pc% /f
goto end
:help
Echo shutdown machines script
goto end

:end


I added the ping tes to see if the machine is a alive - shutdown take too long for me - when it times out - so I just skip dead machines.
All that is left is to set up your machine name lists and set up an automatic scheduled event to do the actual shotdown. Hope you find this helpful

thx

Bill

Automatic shut down of Win/XP Workstations — Part 2

Friday, October 12th, 2007

Print This Post Print This Post  |  Email This Post Email This Post

So now we know about the command that will allow us to remotely shutdown machines. Next we need to find out how to use it in a shell command or batch file - so we can automate the procedure.  We will open a shell windows and try a “shutdown -?” which should give us the help information. Click for a full size view.

Shutdown Help

Perfect - so now we see what we want the function stub to look like .
we want to shutdown the  remote machine with  these options:

-s -m \\computer-name

It would probably be nice to display some sort of message - just in case someone is watching

-c Shutdown message”

we would  like to give a 30 second warning before  the shutdownjust in case someone is at the computer

-t 30

and lastly, we want to force shutdowns even is someone is  logged on - this is optional - but in general since I am shutting machine down when nobody should be around - I really want to force the shutdown.

-f

So here is  what the functional stub  look like.

shutdown -s -m \\workstation-name -c “shutdown-comment” -t 30 -f

One  other itemthe command runs in the security context of the user that is issuing the command. Thusly, a general user can not shutdown another machine - only administrative users can do that.  That means we will need to run it as an user that has administrative rights on all the machine we wish to shut down. In a win2003 with Active Directory - this is  someone with administrative rights for the domain. 

Now we have gotten the parts together - now the plan which is to build a command file ( .cmd) that we can pass a  the workstations we wish to shut down. We will set this up on our server and use this as a scheduled task - running under the context of an administrator, to shut down the machines at given times.

In part 3 of the article - I will lay out the .cmd and we will put it all together.

thx

Bill

On Media and Computing

Wednesday, October 10th, 2007

Print This Post Print This Post  |  Email This Post Email This Post

When I refer to media , I am talking about the way  information is introduced and stored in computers. Early on , this amounted to coding on paper, which was the storage medium and the program was introduced ( put into ) the computer with switches.

DEC PDP 8/i

This was done because the programs were written in machine code  and permanent auxiliary storage didnt exist or was too expensive to purchase. You would write the program and “desk check it” on paper, then at the computer , you would set a memory address and then  set he binary data to store in that memory address and tell the computer to store the instruction. You would do this over and over , untiil you got the whole program stored in memory, then you would set the machines instruction register to point to the address of your program and tell it to start executing instruction. Typically the output would in the lights of the  machine, that were interperted to be the results.  This was cumbersome , but we found it very exciting, as we ere actually programming a machine to do something for us.

The next media evolution I worked on was paper tape. These was used both for storage of programs and data. Early computers were often outfitted with teletypes

Teletype with paper tape reader

and these had the reader/punches built into them.  These worked pretty well, but after many runs would get a little soft and frayed.

Next , for me anyway, was the 80 column card.  In the early days these held both data and programs. The  80 column card had a long history and were in use in calculating machines that proceeded general purpose computers. These were primarily as commercial tabulating machines. The machines were programed by hard wired cards and had a variety of peripheral machines to reproduce cards, sort cards, and put writing on the tops of the cards. 

 80 column card

Later, as the general purpose computers started to arrive and with the advent of tape and disk drives,,  cards were primarily used as a programming or job control medium. I do however remember working at an insurance company that held data on cards, during these times,  and at the end of the year,  we would do sorts and total for some 5 million cards.  cards had 80 culumns of little square cutouts in them and user Hollerith code comprised of 3 zones and the numbers 0-9.   Towards the end of the card eara - smaller 96 columns were intorduced and if I remember correctly they used round cutouts for the holes , instead of the square

I guess to keep the rambling from getting too long - I will stop for the time beiang. I will try and   finish the rest of the story another time.

thx

Bill

PhotoFiltre Fits

Saturday, October 6th, 2007

Print This Post Print This Post  |  Email This Post Email This Post

I have been looking for a good - not too complicated - but not too dumb - Photo editing program to provide to my students and staff ( for me too ). I have tried a pile of them and none  were  something I would use , so I sure wouldn’t send them out to my users. Then I  found PhotoFiltre.   I was looking for something with the following characteristics:

  1. Free or inexpensive.
  2. Easy to install
  3. Fast
  4. Easy and intuitive for the beginner.
  5. Full featured enough for the more advanced user.

(more…)

Automatic shut down of Win/XP Workstations

Tuesday, October 2nd, 2007

Print This Post Print This Post  |  Email This Post Email This Post

Seems to me  if workstations are  not going to be used because the facility is closed, it makes sense to shut them down. Not to mention that Windoz  likes to be cycled regularly :) . This was an early on project of mine during Win/98 days. After researching this, I came upon a piece of software called Sleepy. When it was loaded on the machine , it would shut the machine down at a certain schedule. If was free and worked pretty well. As we moved to Win/XP sleepy was enhanced and then moved from the realm of freeware to pay-for-it ware - and it became less attractive, although it now allowed for central control of the shutdown process , rather than logging on to each machine individually. I decided to revisit the situation and do some more research. I had in mind three criteria:

  1. Automatic distribution
  2. Central configuration
  3. Free

Guess what ? - I found it and it was already built in.

Windows has a batch command called shutdown. It works very well , is ACL aware, and runs from the command line or as a GUI. This is a great start.

It allows a number of parameters to customize the shutdown, including

  • Content of Warning message
  • Length of time between warning message and shutdown
  • The forcing of a shutdown if a user is logged on

(more…)