Limiting web browsing on LTSP terminals

Running Linux
cover
Amazon | Powells
IndieBound

With LTSP, all applications run on the server. This is great for the low maintenance involved: install an application program once, and it is available immediately on all terminals.

However, some times you may want to discriminate between different terminals. For example, you may want to restrict web browsing at one terminal or another.

Because the browsers run on the server, all outgoing HTTP connections come from the same machine. This means you cannot just restrict by IP address. You need a finer grain of control, by X display.

There is no easy perfect solution for this problem. The best solution would be to have two different terminal servers, and have the two classes of terminals connect to the appropriate server.

I’ll describe my hack attempt to solve this problem. My approach was to set browser proxy settings based on the X display.

First, you must decide how you want to limit the browser. In my case, I created two browser proxy configure scripts, which are usable by Netscape, Mozilla, Opera, and Internet Explorer browsers.

Script for allowing internet access: “proxy.pac”

function FindProxyForURL(url, host) { if (isPlainHostName(host)

Printing from Open Office through KPrinter


RedHat Linux 9 Bible
cover
Amazon | Powells
IndieBound

To print from Open Office through KPrinter, set up a printer in Open Office for it.

Run spadmin as root. On RedHat 8.0 it is at

/usr/lib/openoffice/spadmin

Add a new printer of type “Generic Printer”. This means simple Postscript output. For the command line specify

kprinter –stdin

Name your printer entry “KPrinter” or something recognizable to you.

Now when you print from Open Office, you can select this printer and be able to make use of KDE features such as the prefilters.

Submitted by amillar on Sat, 2004-02-07 13:35

Printing Greeting Cards in Linux


Linux in a Nutshell
cover
Amazon | Powells
IndieBound

Many people are familiar with the “print your own greeting card” idea. You print four small page images on a single sheet of paper and fold it in half twice. You get a little greeting card with a custom cover and interior, all from one single-sided piece of paper.

I wanted to do this from a Linux application, without needing Windows or MacOS. Preferably, I could use any application to produce 4 pages, and have some magic transform it into the single page with all parts reduced and oriented properly for folding.

After a little googling, I was able to find this list archive message by Ronan Heffernan describing exactly what I wanted. His “make_card” script takes a postscript file and does the appropriate transformation:

#!/bin/shcat $1 | pstops -pletter -b “4:3U@.5(1w,1h)+0U@.5(.5w,1h)+1@.5(0,0)+2@.5(.5w,0)” > $2

This works well, but I wanted something that my family could use from
Linux apps without the command line.

My favorite print spool tool in Linux is KPrinter from KDE 3.0. It can be used with any X Window application, not just KDE apps. It is perfect for the generic X apps like
Mozilla and Acrobat Reader. Instead of sending print output to the command lpr, send it to the command kprinter (or kprinter –stdin if it pipes it).

The method I found is to create a “prefilter” for KPrinter. This
allows you to select greeting card formatting for any print job to
any printer.

Create the following files:

/usr/share/apps/kdeprint/filters/Greeting-card-4-up.desktop

[KDE Print Filter Entry]Comment=Greeting card- 4 pages on double-folded US letterMimeTypeIn=application/postscriptMimeTypeOut=application/postscriptRequire=exec:/ps2ps

/usr/share/apps/kdeprint/filters/Greeting-card-4-up.xml

<!DOCTYPE kprintfilter><kprintfilter name=”Greeting-card-4-up” ><filtercommand data=”pstops -pletter -b ‘4:3U@.5(1w,1h)+0U@.5(.5w,1h)+1@.5(0,0)+2@.5(.5w,0)’ %filterinput %filteroutput” /> <filterinput><filterarg format=”%in” name=”file” /> <filterarg format=”” name=”pipe” /> </filterinput> <filteroutput><filterarg format=”> %out” name=”file” /> <filterarg format=”” name=”pipe” /></filteroutput></kprintfilter>

I found that the KDE prefilters were not terribly well documented, but I
was able to muddle through it. To create one, run KPrinter and select
“System Options”. In the print configuration dialog box, select “Commands”.
This will allow you to create a new filter. You simply need to compare the
entries to other existing print filters.

When your new filter is created, it will be in your personal directory, such as

$HOME/.kde/share/apps/kdeprint/filters/

Move it to your system-wide print filter directory, which might be

/usr/share/apps/kdeprint/filters/

or something similar.

I could not get the paper size to work automatically using the poorly-documented
paper size substitution variable, so I had to hard-code the US Letter paper
size. If anyone knows how to fix this, let me know.

Submitted by amillar on Sat, 2004-02-07 13:35

Latina Pro Populo


Latina Pro Populo
cover
Amazon | Powells
IndieBound

Latina Pro Populo, also titled Latin For People, is a good introduction to the Latin language.

It covers basic Latin grammar and vocabulary. While Latin is known (deservedly so) as a complex language, this book does a good job of providing the basics, allowing the reader to actually read and comprehend simple Latin sentences in just a short amount of time.

Anyone who is simply curious about Latin, without the desire to spend years of study just to read a sentence or two, would find this book to be a great starting place.

Submitted by amillar on Mon, 2004-02-02 11:39

Mac on Linux

Mac on Linux is a software package for Linux running on a PowerPC processor. It will allow you to run MacOS in a virtual machine.

It is similar in concept to VMWare GSX, where the disk images are stored in the host’s file system but the guest VM screen is not tied to the host’s screen.

Hardware

I’m running it on an old Power Computing PowerCurve Mac clone. It has been upgraded to a 225MHz PPC 604 CPU and 128MB ram.

Software

Submitted by amillar on Sun, 2004-02-01 21:01