last updated:

Contents

  1. Useful unix shell commands
  2. Make Mail.app respect your .mailboxlist when using IMAP
  3. "Saving your Settings" / "Einstellungen werden gespeichert" takes forever on logout
  4. Installing SNMP-Daemon (snmpd) on IPCop for remote monitoring
  5. Installing mod_bwshare on Debian Linux running Apache 2.0.x
  6. Battlefield 1942 on Mac: Two hints for power-users
  7. Presetting second screen for VLC (VideoLAN Client) fullscreen playback
  8. HP Printers
  9. Apple Printers
  10. Default LPR Queue Names of different Vendors
  11. Windows 2000 and Windows XP as LPD Server
  12. Setting up a Virtual Postscript Network Printer on Windows

Useful unix shell commands

Please note that some commands can cause badly damage when used/changed not properly. Always keep a recent backup at hand.

Remove Apple-specific files

.DS_Store contains informations on how to display folders; e.g. list view. Such files are of no use for Linux- and Windows-users. The following command finds all .DS_Store-files in the current directory and every subdirectory and deletes it immediately. I put it in a cron-job, which is performed every five minutes.

find . -type f -name .DS_Store -exec rm -f '{}' ';'

The next thing is about these fucking Resource Forks. If I could, I would travel back through time and eliminate the person who created it. Anyway, they're among us now, and we can't get rid of'em. Well, at least they serve no needs on a Linux-server, so it's (usually) safe to delete them. As example, if you drag photos from iPhoto to a Samba-Share, not only the JPGs are stored, but also ._-files with thumbnails in it. Well then, good bye little bastards:

find . -type f -name ._* -exec rm -f '{}' ';'

Remove file types except those which contain 'foobar'

My linux servers hosts my complete electronic Music Library, sharing it using daapd. All downloads come with a mess of additional files like covers, cue-sheets, nfo-files etc. Usually, I'm too lazy to get rid of'em directly after the download. As time passed by, everything got messed up with every new album I've leeched. Instead of going through every directory - and there are many of them - I used another fine find-command to remove anything not an mp3-file within my MP3-Folder:

find . -type f \! -name "*.mp3" -exec rm '{}' ';'

Remove file types except those which contain 'foobar'

In my special case, I used the following command to separate thumbnails (expected smaller than 10KB) and closeups (expected to be greater than 10KB) in a web-dump.

find . -type f -name "*.jpg" -size +10240c -exec mv '{}' ~/newdir/ ';'

Batch rename directories

With this little script, you can batch rename directories in current folder AND subfolders

#!/bin/sh

SEARCH="set"
REPLACE="s"

for ITEMOLD in `find . -type d`
do
	echo "Processing '$ITEMOLD'"
	ITEMNEW=`echo $ITEMOLD | sed "s/$SEARCH/$REPLACE/g"`
	#echo "After search/replace: '$ITEMNEW'"
	
	if [ $ITEMOLD != $ITEMNEW ]
	then
	
		if [ ! -d "$ITEMNEW" ]
		then
			echo "Attempting to rename '$ITEMOLD' to '$ITEMNEW'"
			mv "$ITEMOLD" "$ITEMNEW"
			
			if [ ! -d "$ITEMNEW" ]
			then
				echo "[-] Renaming seems to have failed - '$ITEMNEW' doesn't exist"
				exit 1
			else	
				echo "[+] Success"
			fi
		else
			echo "[-] '$ITEMNEW' already exists"
		fi
	
	else
		echo "[i] '$ITEMOLD' does not match expression, skipping"
	fi
	
	echo ""
done

exit 0

Download page with all linked files

When the end of the semester gets close, I usually get into a rush and try to download all online material of the lectures. Being tired of clicking through thousands of pages, I remembered wget. A very useful tool, not just to download ... err ... thumbs and their linked close-ups ;-)

The following command will do the trick:

wget -r -np -nd <url>

You end up having all links recursively downloaded -r, but tell wget not the step up a level -np, and finally, we don't want to have put the files in nested directories -nd. That's it, alreay, straight and steady.

To just download files of special type, I recommend adding the following switch:

wget -r -np -nd -A *.pdf <url>

Download page with all linked files

Recently, I accidentally deleted a vital file on my linux server. Thanks to my regular backups by mkcdrec I just needed to have a look for the backup CD. After googling a few minutes, I came out with the appropriate shell command to extract the desired file out of a gzipped tar-archive:

tar -xzv --file=/Volumes/CDrec-29.07.2005/sdb1._var.tar.gz ./www/partyguide/curl/config.txt

This command recreated the directory structure in the current working dir (make sure you're not cd-ed into the CD mount point, otherwise it can't write out).

chmod only files/directories

Sometimes I'm running amok with

chmod -R 644 .
without thinking it thouroughly. So folders get lost of their execute-flag, and nobody can enter them anymore. Well, here's the solution:

find . -type d -exec chmod u+x '{}' ';'

phpMyAdmin-dumps downloaded through Safari

Somehow, the dump get's fucked up because of the line endings. They're all converted to \r. If you're trying to restore the dump on a linux machine, nothing works. If you use the following command, everything should be fine:

tr '\015' '\012' < dump-mac.sql > dump-linux.sql

The other way 'round ... Converting linux- to mac-files:

tr '\012' '\015' < unix-format-file > mac-friendly-file

After you've treated your dumps, insert'em into your database:

mysql --user=user --password=password database < dump-linux.sql

Split MP3 into tracks based on cue-sheet

To do this, you need to get Mp3splt and compile it yourself. Don't worry, it's easy (otherwise, I couldn't have made it 'til here ;-). Check the manual for proper installation steps.

mp3splt -c sheet.cue audio.mp3

Search & replace stuff in HTML-Files

Recently, I had to replace a URL linking to a no longer accurate place in hundreds of HTML-Files (yeah, this sites origin dates even before ST:ENT started. Terrible!).

Well then, I had two choices: Download anything onto my machine, look out for a nice GUI-editor which allows search & replace for whole folders or ... well, dive into the web and put a nice shell-script together which does the work for me. Since GUIs are for kids and professors, i chose the second option. Here is the result (you surely notice how much safety measures I took. In the final version, i disabled creation of .tmp-Files, because it would have messed everything even more. I had luck - everything worked out the way I expected it to ;-):

#! /bin/sh
STRSEARCH="www.unibe.ch\/faculties\/humanities_d.html"
STRREPLACE="www.philhist.unibe.ch\/"

if [ -d /var/www/hist ]
then
	# AT HOME
	cd /var/www/hist
else
	# ON UBECX
	cd /u/hist/www
fi

find . -type f -name '*.htm' -print | while read i
do
	cp "$i" "$i.tmp"
	
	if [ -f "$i.tmp" ]
	then
		#echo "s/$STRSEARCH/$STRREPLACE/g"
		sed "s/$STRSEARCH/$STRREPLACE/g" "$i" > "$i.new"
		if [ -f "$i.new" ]
		then
			mv "$i.new" "$i"
		else
			echo "$i.new doesn't exist"
		fi
	else
		echo "$i.tmp wasn't created"
	fi
done

Backup my Mac OS X home directory with rsync

Please be aware to use the special rsync-Version written for Mac OS X (fucking resource forks, again!). Otherwise you could end up with a mess (only on the backup side, but this sucks as much!).

I separated iPhoto-Files from the rest, because the .sparseimage wouldn't fit on a DVD anylonger.

backup.sh

#!/bin/sh

if [ $# -lt 1 ]
then
	echo "Please provide a destination to store the backup to:"
	echo "fwdsk (Firewire-Drive)"
	echo "eth (Server-Share)"
	echo "tmp (/tmp)"
	exit 1
fi

case $1 in
	"fwdsk")
		IMAGEFOLDER="/Volumes/TRANSFER";;
	"eth")
		IMAGEFOLDER="/Volumes/RSYNC";;
	"tmp")
		IMAGEFOLDER="/tmp";;
	*)
		echo "Please provide a destination to store the backup to:"
		echo "fwdsk (Firewire-Drive)"
		echo "eth (Server-Share)"
		echo "tmp (/tmp)"
		exit 1;;
esac

if [ ! -d "$IMAGEFOLDER" ]
then
	echo "Directory '$IMAGEFOLDER' not found"
	exit 1
fi

BACKUPINFO=( "home" "iphoto" )

for VOLNAME in ${BACKUPINFO[@]}
do
	DISKIMAGENAME="$VOLNAME"
	DISKIMAGEPATH="$IMAGEFOLDER/$VOLNAME.sparseimage"
	
	BACKUPSOURCEFILE="/Users/mario/Rsync/bkpsrc/$VOLNAME.txt"
	
	if [ ! -f "$BACKUPSOURCEFILE" ]
	then
		echo "File '$BACKUPSOURCEFILE' not found"
		exit 1
	fi
	
	BACKUPSOURCE=`more $BACKUPSOURCEFILE`
	BACKUPDESTINATION="/Volumes/$VOLNAME"
	RSYNCEXCLUDE="/Users/mario/Rsync/exclude/$VOLNAME.txt"
	
	#-------------------------------------------------
	# Create/reuse & mount Disk-Image
	#-------------------------------------------------
	if [ ! -f "$DISKIMAGEPATH" ]
	then
		# Disk-image-file doesn't even exist - create it
		echo "Creating disk image \"$DISKIMAGEPATH\""
		hdiutil create -fs HFS+ -type SPARSE -size 20g -volname "$DISKIMAGENAME" "$DISKIMAGEPATH"
	else
		echo "Using pre-existing disk image \"$DISKIMAGEPATH\""
	fi
	
	if [ ! -d "$BACKUPDESTINATION" ]
	then
		# Disk-image doesn't seem to be mounted
		hdiutil attach "$DISKIMAGEPATH"
	fi
	
	#-------------------------------------------------
	# Did Disk-Image mount correctly?
	#-------------------------------------------------
	if [ ! -e "$BACKUPDESTINATION" ]
	then
		echo "There was a problem creating or mounting the disk image"
		exit 1
	fi
	
	#-------------------------------------------------
	# Rsync
	#-------------------------------------------------
	/Users/mario/Rsync/rsync.sh "$BACKUPSOURCE" "$BACKUPDESTINATION" "$RSYNCEXCLUDE"
	
	#-------------------------------------------------
	# Unmount Disk-Image and do maintenance operations
	#-------------------------------------------------
	# hdiutil info | grep /Volumes/$VOLNAME | cut -f 1
	# 
	# Expected output: /dev/disk2s2    Apple_HFS       /Volumes/Rsync-Backup
	#                  ^ this info is required to unmount
	
	DISKIMAGEDEVICE=`hdiutil info | grep /Volumes/$VOLNAME | cut -f 1`
	echo "Disk image mounted as $DISKIMAGEDEVICE"
	
	hdiutil detach -quiet "$DISKIMAGEDEVICE"
	echo "Disk image ejected"
	
	hdiutil compact "$DISKIMAGEPATH"
	echo "Disk image compacted"
done

rsync.sh

#!/bin/sh

if [ $# -ne 3 ]
then
	echo "Usage:"
	echo "rsync.sh   "
	exit 1
fi

BACKUPSOURCE="$1"
BACKUPDESTINATION="$2"
RSYNCEXCLUDE="$3"

if [ ! -d "$BACKUPSOURCE" ]
then
	echo "Source directory '$BACKUPSOURCE' not found"
	exit 1
fi

if [ ! -d "$BACKUPDESTINATION" ]
then
	echo "Destination directory '$BACKUPDESTINATION' not found"
	exit 1
fi

if [ ! -f "$RSYNCEXCLUDE" ]
then
	echo "Exclude file '$RSYNCEXCLUDE' not found"
	exit 1
fi

# --verbose
# --showtogo
# --dry-run
time sudo /usr/local/bin/rsync -a --delete --delete-excluded --eahfs --showtogo --exclude-from\
 "$RSYNCEXCLUDE" "$BACKUPSOURCE" "$BACKUPDESTINATION"

bkpsrc/home.txt

/Users/mario/.

bkpsrc/iPhoto.txt

/Users/mario/Pictures/iPhoto Library/.

exclude/home.txt

Music/
Movies/
PoisonDownloads/
Cache/
Caches/
.Trash/
Fun-Stuff/
.DS_store
iPhoto Library/

exclude/iphoto.txt

.Trash/
.DS_store

Make Mail.app respect your .mailboxlist when using IMAP

Mail.app is a nice, sleek E-Mail-Client which does quite everything you need in everydays use. But there's one great drawback: Apple engineers sometimes simply miss the point. When accessing IMAP-mailboxes through Mail.app, you're not only presented all the expected IMAP-folders, but all those crappy dot-hidden-files (.*) in the IMAP-root, even if there is a .mailboxlist, which tells well written (!) Mail-clients which folders to subscribe to (isn't it even mentioned in a RFC?). Mail.app doesn't - god knows why. In fact, it seems also to depend on which mail-server your provider uses. If it's pmdf, you're most likely to end up the way I am. Another provider I use to store my eMeidi.com-accounts on, there are no such issues at all.

Anyway, while browsing the web I only found some small hints ... one worked! There's some manual work to do, so it's essential to have SSH-/Telnet-Access to the server where your folders are being stored.

I feared to mess it up, so I waited months before I took these steps. Now I wish I had done it earlier. It's so smooth to see only your mailfolders and all the other .profile, .whatever and .huh being gone forever!

PHP-like foreach with bash

for i in {debug,info,notice,warning,err,crit,alert,emerg}
do
	logger -p daemon.$i "Test daemon message, level $I"
done
Hint taken from oreilly.de

Integrate HTML Tidy with Platypus

Well, with a few modifications you could also make this script work from command line. But I prefer dropping an .html-File onto the Icon ... *swooosh*
The Mac OS X-Application bundle is available from eMeidi.com for download
#!/bin/sh
# brought to you by eMeidi.com, 2005 v0.1beta
# feel free to distribute this piece of software
# licensed under gnu general public license

# check whether two vars were passed to the shell-script
if [ $# -lt 2 ]
then
	echo "You need to provide a path to an .html-file."
	exit 1
fi

# check whether the source html-file exists
if [ ! -f "$2" ]
then
	echo "File '$2' not found."
	exit 1
fi

# get application-directory
cd "$1"
APPDIR=`echo $PWD`
RESDIR="$APPDIR/Contents/Resources"

# configure binary/config-file locations (inside the .app-folder)
TIDYBIN="$RESDIR/tidy"
TIDYCONF="$RESDIR/tidy.conf"

if [ ! -f "$TIDYCONF" ]
then
	echo "Configuration file '$TIDYCONF' not found."
	exit 1
fi

# since there always happens shit(tm), backup the source file before tidying it
SEARCH=".htm"
REPLACE=".old.htm"
BKPFILE=`echo $2 | sed -e "s/$SEARCH/$REPLACE/"`

mv "$2" "$BKPFILE"

# only proceed when the backup has been created
if [ ! -f "$BKPFILE" ]
then
	echo "Couldn't create backup file."
	exit 1
fi

# well, here we are - let's go
$TIDYBIN -config "$TIDYCONF" "$BKPFILE" > "$2"
Platypus 3.0
HTML Tidy

Replace changed files in different folders with same structure

The following script helps me to update all instances of a custom-built CMS on my local server. Since the CMS is shared by almost 10 different web-sites now, it becomes very time consuming to update changed files manually.

#!/bin/sh

echo "eMeidi.smt-Upgrader v0.1"
echo "(c) by Mario Aeby, eMeidi.com"
echo ""

if [ $# -lt 1 ]
then
	echo "Usage: $0 "
	exit 1
fi

WWWROOT="/var/www/"
PROJECTS="kiesen neuenegg dkf wsu tierstall spneuenegg schmid-baeume privatcoaching sek uhc"
FILES="admin/inc/emeidi_smt.lib.php admin/inc/stylesheet.css admin/tools/table_editor.php admin/tools/photo_gallery.php"

if [ ! -d $WWWROOT ]
then
	echo "'$WWWROOT' doesn't exist."
	exit 1
fi

SOURCEDIR=$WWWROOT$1"/"
if [ ! -d $SOURCEDIR ]
then
	echo "'$SOURCEDIR' doesn't exist."
fi

for PROJECT in $PROJECTS
do
	PROJECTDIR=$WWWROOT$PROJECT"/"
	
	if [ ! -d $PROJECTDIR ]
	then
		echo "$PROJECTDIR doesn't exist."
		exit 1
	fi
	
	for FILE in $FILES
	do
		SOURCE=$SOURCEDIR$FILE
		DEST=$PROJECTDIR$FILE
		
		if [ ! -f $SOURCE ]
		then
			echo "Source file '$SOURCE' not found."
			exit 1
		fi
		
		if [ ! -f $DEST ]
		then
			echo "Destination file '$DEST' doesn't exist. Creating dummy because of programmers lazyness."
			touch $DEST
		fi
		
		if [ $SOURCE = $DEST ]
		then
			echo "Source path is identical to destination path, skipping '$DEST'."
			continue
		fi
		
		COMPARE=`cmp "$SOURCE" "$DEST"`
		COMPARELEN=`expr length "$COMPARE"`
		
		if [ $COMPARELEN -lt 1 ]
		then
			echo "Source and Destination-File seem to be identical. Skipping '$DEST'."
			continue
		fi
		
		DESTBKP=$DEST".bak"
		
		if [ -f $DESTBKP ]
		then
			echo "Previous backup found, trying to remove '$DESTBKP'"
			#mv "$DESTBKP" "$DESTBKP.bak"
			rm "$DESTBKP"
		fi
		
		if [ -f $DESTBKP ]
		then
			echo "Could not remove previous backup. Aborting."
			exit 1
		fi
		
		mv "$DEST" "$DESTBKP"
		
		if [ ! -f $DESTBKP ]
		then
			echo "Could not create backup copy. Aborting."
			exit 1
		fi
		
		echo "Trying to copy '$SOURCE' to '$DEST' ..."
		
		cp "$SOURCE" "$DEST"
		
		if [ ! -f $DEST ]
		then
			echo "Although copied, it seems that '$DEST' hasn't been created. Aborting."
			exit 1
		else
			echo "Success: '$DEST' copied."
		fi
	done
	
	echo ""
done

exit 0

"Saving your Settings" / "Einstellungen werden gespeichert" takes forever on logout

  1. Group Policy Editor (gpedit.msc)
  2. Local Computer Policy
  3. Administrative Templates
  4. System
  5. Logon
  6. "Maximum retries to unload and update user profile" = 2 (default 60 [seconds? tries?])
Hint taken from Annoyances.org

Installing SNMP-Daemon (snmpd) on IPCop for remote monitoring

The Task

After some days of testing I finally found out a relative simple solution to run a SNMP-Daemon on my IPCop-Router.

Package management under Mac OS X

First of all, I had to deal with Debian-packages. This posed some problems to me, because I don't have any linux box here except the one running IPCop, which hasn't package-managers installed. After I dived into manuals for dpkg i was able to extract the files on my PowerMac running Mac OS X. Before you can execute the shell command below, you need to download and install Fink. After that, continue:
dpkg-deb -x <package>.deb <destination-dir>

Installation

You now do have the required files on your workstation, but yet they need to be put on the IPCop-box. Make use of an SFTP-Client, which requires the SSH-Service enabled on the router. With a SSH-connection to the box, I checked the error messages which occured upon start of the snmpd and then went out to look for the additional files required. The 'search file within packages'-Function of some package-sites helped me a lot!

Packages needed

These 3 Debian-Packages are essential for your success. Download the .debs and extract them to a single folder with the command mentioned above:

File locations

I had to copy all files over to IPCop manually, therefore I made this list to monitor all the files necessary.

/lib/libwrap.so.0
/usr/lib/libucdagent-0.4.2.so
/usr/lib/libucdmibs-0.4.2.so
/usr/lib/libsnmp-0.4.2.so

/usr/sbin/snmpd

Caveats

Don't try to copy snmpd.conf over to the box. In my case, it prevented snmpd to act the way it should. I have no idea where the problem lied, but after deleting snmpd.conf, everything worked fine. I hope this saves you a lot of headaches.

Installing mod_bwshare on Debian Linux running Apache 2.0.x

Recently, I noticed msnbot was spamming my whole upload bandwidth because it seemed to create a complete dump of my photo gallery - several image requests within a minute! After some googling I discovered several Apache modules which promise to get rid of such bots running amok (although there are some concerns about artificially prolonging download times for leechers - beware!). I finally decided to go on with mod_bwshare. In a temporary "dust of war", I got the wrong impression that I needed to upgrade to Apache 2.0.x to be able to get a precompiled .deb. Well, haha! There isn't a debian package available right now. Well, okey, at least I'm running the newest Apache now, although I had to

apt-get remove apache
dpkg-reconfigure php4
dpkg-reconfigure php4-mysql
dpkg-reconfigure php4-curl
dpkg-reconfigure php4-imap
dpkg-reconfigure php4-gd

to get back to my "touched working system" and make PHP aware of Apache 2. Be aware: Everything starts with untouched config files, so make sure you enable error logging in PHP again. Especially if you're a web-dev like I am, you know about usefulness of

error_reporting = E_ALL

Okey, now straight back to the task. Since all this stuff is open source, we could at least give it a try with compiling and stuff (honestly, I just now enough about compiling to completly havoc a system, but I was a lucky guy in this case). So download the source files:

cd /tmp
wget http://www.topology.org/src/bwshare/bwshare-0.1.3.zip
unzip bwshare-0.1.3.zip

So, there we had'em now, hundreds of lines of codes. As stated on the developers homepage itself, running

cd src/modules/bwshare
apxs2 -c mod_bwshare.c
apxs2 -i mod_bwshare.la

Should do the trick. Nada, first we needed the developer package:

apt-get install apache2-dev

Once again:

apxs2 -c mod_bwshare.c
apxs2 -i mod_bwshare.la

A lot of warnings were displayed, but finally, I read

...
chmod 644 /usr/lib/apache2/modules/mod_bwshare.so

After having succesfully compiled mod_bwshare, I had to create two text-files in /etc/apache2/mods-available/

bwshare.load
bwshare.conf

and pasted the following contents:

LoadModule bwshare_module /usr/lib/apache2/modules/mod_bwshare.so
# Some bandwidth control parameters.
BW_tx1cred_rate         2
BW_tx1debt_max          10
BW_tx2cred_rate         1000
BW_tx2debt_max          1000000

<Location /bwshare-info>
SetHandler bwshare-info
</Location>

<Location /bwshare-trace>
SetHandler bwshare-trace
</Location>
</IfModule>

That was it (if you got that far, you surely know now what comes next - putting symlinks in mods-enabled/ and doing a

apache2ctl graceful

(Thanks to our solaris master Aeschlimann at the University for the graceful hint some time ago - greetz).

Battlefield 1942 on Mac: Two hints for power-users

Dual screen/display set up - run on secondary screen

It took me some time to figure out: Press and hold the 'Apple'-key and doubleclick on the Appliction icon (Note: This only seems to work with 'Battlefield 1942.app' and not with 'Battlefield 1942 The Road To Rome.app'). Instead of launching the game, a small dialogue box comes up, where you can set the monitor on which the game should be displayed (aside, there are some other nice features like: play windowed, set resolution and refresh rate).

Bring up command console in the game

A lot of googling didn't help - some sites mention the ~ key, others state ^ should be pressed, the third thinks it's better to press the key above tab - nevermind, it's < > on Mac!

Presetting second screen for VLC (VideoLAN Client) fullscreen playback

Ever wondered how to preset video output screen in VLC (Videolan Client) permanently instead of switching to device two every time you fire up the client (Video > Video device > Screen 2)? I finally found the following hint at a support mailing list of the videolan developers:

The default screen can be set under

preferences >
modules >
interface >
video device

HP Printers

HP provides a variety of software solutions to set up or manage your HP Jetdirect-connected network printers. more...

#CH 12 27 94 91 9

Apple Printers

Apple Knowledge Base

Default LPR Queue Names of different Vendors

List

Windows with LPR-Support: Use the name of the printer as it appears in Start > Settings > Printers (don't know whether spaces and special chars cause problems).

Windows 2000 and Windows XP as LPD Server

You can turn your Windows 2000 and Windows XP-Clients in a LPD Server at ease:
  1. Just make sure you have the Other Network File and Print Services components installed.
  2. Set the TCP/IP print server service to startup automatically
According to www.uark.edu

Setting up a Virtual Postscript Network Printer on Windows

This installation instructions were compiled of several pages I've found on the web. Since i'm using Windows 2003, the screenshots may be up to date and valid for Windows 2000 Professional/Server, Windows XP Home/Professional.

The Task
I wanted to make my Brother HL-760 compatible with Mac OS X - unfortunately, Brother gives no driver support for this platform. There is a solution with GIMP-Print, which didn't satisfy me at all (it's a bit tricky, graphics get badly dithered). Fortunately, the HL-760 supports a printing standard at all - PCL. This helped a lot. I'm not sure wheter this print-server could print to any printer which has driver-support on windows?

The Printing Process
After you've set up the virtual printer, you can install a Postscript-Compatible driver on mostly any known workstation (like Mac OS, Mac OS X, Linux, ...) and print to to the Windows-Server (first try to use LPR because it's an open standard). The postscript-data received by the server is being processed by Ghostscript, converted to PCL (proprietary HP Printing Language) and finally sent to the Brother HL-760.

The Requirements
You need the following software, available for free: The Installation Screenshots
After you've successfully installed Ghostscript and RedMon you're ready to set up and configure your print-server. (Please note that these screenshots were made on my server at home and therefore reflect my environment. It may vary from yours, but as you're obviously kinda pro who got to my page, you should be able to perform the necessary translations with ease).









Error Logging was essential after the first test runs didn't work as expected. The error messages stored to the error log file did help a lot fixing problems (pathnames with spaces, as example).



After you've successfully set up RedMon and Ghostscript, you need to set up a new printer.







This is the clue: You need to assign not a physical, but a virtual port to the printer - the RPT1:, set up above.



It is essential that you create a postscript-compatible Printer, whereby the Apple Laserwriter II is recommended.



I called the printer 'Postscript' to avoid having troubles with spaces and special-chars in LPR-Queue-Names, which could confuse UNIX operating systems (?).