Archive for the ‘Tech’ Category

aix printer backend (recover file name)

Sunday, September 25th, 2016

#!/bin/ksh
#
# AIX queuing system backend for SMS processing
#
# This AIX queuing system backend is used in the conversion
# of McDonalds SMS files to HR-Access
# It performs the following tasks
# – Recovers the original filename of the SNS file
# from the queuing system control file
# – Copies the file to a spooling location with its original name
# – Resubmit the job to the final processing queue with new user
# custom writing service (depends on sudo being correctly configured)
#
# Created: 18.10.06 Markus Baertschi, IBM
#
#

# recover the environment from the path where the file is stored
# example: /home/hrprd/bin/smsbak.sh -> prd
HRENV=$(dirname $0)
HRENV=${HRENV#/home/hr}
HRENV=${HRENV%/bin}
# define sone of the variables we use
HRUSER=”hr$HRENV”
SMSDIR=/var/sms/$HRUSER
HRQUEUE=”sms$HRENV”
NQUEUE=${HRQUEUE}2
LOG=/var/log/$HRUSER/smsbak-sh.log

# write all output to the logfile
exec 2>&1 >> $LOG

echodate () {
echo “$(date +’%d.%m.%y %H:%M:%S’) $*”
}

echo “=========== smsbak.sh ===============”
echodate “Args: $*”
echodate “User: $HRENV/$HRUSER/$HRQUEUE Id:$(id)”

FNAME=”$1″
echo “Spooled file name: $FNAME”

#
# Search for the control file of my job
#
CFILE=$(grep -l “$FNAME” /var/spool/lpd/qdir/*)
if [ -z “$CFILE” ]
then
print “Error: control file for $1 not found”
echo “!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!”
exit 1
fi
#
# Extract the original filename from the control file
#
JNAME=$(awk -F”\-[TB]” ‘/\-T/{print $2;}’ “$CFILE”)
if [ -z “$JNAME” ]
then
print “Error: job name in ‘$CFILE’ not found”
echo “!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!”
exit 1
fi

echodate “Extracted Job name: $JNAME”
#
# Copy the job file to a spool directory (to be created if necessary)
# and change its owner to the target user
#
mkdir -p $SMSDIR
cd $SMSDIR
cp $FNAME $JNAME
sudo chown $HRUSER $JNAME
ls -l $JNAME

#
# Re-submit the file to the SMS processinq queue Inflatables Quality using the target user
#
CMD=”enq -P $NQUEUE -T $JNAME $SMSDIR/$JNAME”
echo sudo su – $HRUSER -c $CMD
sudo su – $HRUSER -c $CMD

lpstat -psmsprd
echo “———– smsbak.sh ———–“

Basic ksh configuration

Monday, January 1st, 2007

The AIX command line, as shipped by IBM, has no comfort whatsoever. This is unfortunate as it is easy to add some basic stuff to make life much easier. Here what I install on a new AIX box as soon as possible.Inflatable Water Slide

(more…)

TW-100: Service Manual

Monday, January 1st, 2007

The TW-100 is a nice, but not well known shortwave transceiver. It was built by Transworld in California for government agencies and NGO’s. The set is solidly build and uses high quality components.

A while ago I’ve spent some time scanning the complete service manual of the transceiver. It should be complete and I will correct omissions or errors as far as possible.

(more…)

TW-100: Muting mod

Monday, January 1st, 2007

When you fine-tune the operating frequency the TW-100 has the unfortunate habit of muting the speaker on each keypress/frequency step.

This mod describes how to disable this muting facility on your TW-100.

(more…)

TW-100: LF/MF Sensitivity mod

Monday, January 1st, 2007

The TW-100 features a high pass filter to reject low frequency signals. This filter is very effective to suppress the signal of your 10MW MF station 2 miles away. UnfortunatelyEast Inflatables, if you don’t have this station and would like to use the TW to listen to signals below 1600kHz, there is no way to switch it off. (more…)