Tuesday, September 26, 2017

Pharos Printing from Linux


Pharos Printing from Linux
This document assumes you’re installing on a Debian 9.x computer, and that you’re printing to a Pharos release station, not to an actual Pharos printer queue. If you need the latter, you can probably add the functionality by recoding /usr/local/bin/pharospopup to ask for a password, and recoding /usr/lib/cups/backends/pharos to process that password, but I’ve not looked into that at all. Maybe next year, in the Year of the Linux Desktop ;-)

1 - Install CUPS

aptitude install cups

2 - Install Python

  1. Install Python
    1. aptitude install python
  2. Test for wx
    1. Start python (“python” at the command prompt)
    2. At the python prompt (>>>), type “import wx”. If you get no errors, great! If you get a message that no module named “wx” is found, you’ll have to install that piece (see below)
    3. Exit python with “quit()”.
  3. To install the wx modules,
    1. aptitude install python-wxgtk3.0
    2. Repeat the text for wx as above.

3 - Install pharos-linux

This is an open-source pharos client for Linux, written in python (which is why you installed python above).


  1. On the green button to the right, that says “Clone or download”, choose “Download zip”.
  2. In a Terminal window, navigate to where you downloaded the zip file, and unzip it:
    1. cd ~/Downloads  (for example)
    2. unzip pharos-linux-master.zip
  3. Navigate into the directory created by the unzipping above:
    1. cd pharos-linux-master
  4. Here you have to create a “printers.conf” file. This will be different than the CUPS “printers.conf”, so don’t get them confused. But you may need some info (like the printer driver name, etc) from the CUPS version of the file, so you may want to create a dummy printer temporarily in order to collect that info:
    1. Web-browse to “localhost:631”
    2. Use this normal CUPS interface to create a temporary lpd:// version of the printer you’re wanting to install. Make sure to make it as accurate as you can, including the IP address and model and driver.
  5. Now that you’ve created a temporary dummy printer in CUPS, you can look in the “/etc/cups/printers.conf” file for some of the info you’ll need in the pharos “printers.conf” file. Create/edit “printers.conf”. Mine, for an HP Laserjet p4015dn printer, looks like this:

# ACU Brown Library Kiosk Printer Configuration File
[Printers]
printers=BLKiosk_1

[BLKiosk_1]
Make=HP
Model=LaserJet p4015dn
Driver=hpcups
LPDServer=tychicus.acu.edu
LPDQueue=BLKiosk_1
Location=Brown Library Circ Desk
Description=Circulation Desk Printer

The “README” and “CONFIGURATION” files may provide you some help.

On one of my machines, I had to aptitude install printer-driver-hpcups to get the correct driver installed for this printer.

  1. Now that you’ve created the pharos version of the “printers.conf”, you can run the pharos setup program:
    1. ./setup.py
  2. If all goes well, you should see a message that remote printing has been successfully installed.
    1. This created a new “backend” processor for CUPS, named “pharos”. This is what allows you to select “pharos” as the protocol when you add (or modify, as in the next step) a new printer. If you're curious to see the file, you can find this new backend in the “/usr/lib/cups/backend” (“/usr/libexec/cups/backend” on Macintosh, just FYI) directory.
    2. It installed some executables and config files in “/usr/local”, such as “/usr/local/bin/pharospopup” (which is the python script that creates the popup window when you print).
    3. It created a symlink to “/usr/local/bin/pharospopup” in the KDE or Gnome startup locations of any users it found on the system, so that the popup client "daemon" will be running in the background when you start KDE/Gnome, which watches for print jobs sent to the Pharos printer and then pops up the credentials window. In my case, running XFCE4 instead of KDE or Gnome, I had to manually create an autostart item (using the XFCE4 System Settings GUI, but I could have done it by hand in the “~/.config/xfce4/autostart” directory) that runs the “/usr/local/bin/pharospopup” executable” when XFCE4 starts up. When this executable is running, you should be able to see it with a “ps ax | grep pharos”. If it’s not running, something’s wrong (did you log out / back in?).
  3. Now you need to go back to your CUPS configuration page (web-browse to localhost:631), and “Modify” your temporary printer, changing only the protocol from the lpd:// you used earlier to the newly-available “Pharos” protocol (not named that; can’t recall or access at the moment).
  4. If all has gone well, when you try to print, you’ll get a popup asking for printing credentials, and all should be working.
  5. If your printer dialog has more printers than just the ones you want, you can turn that off. Apparently in earlier versions, the “browse” options in “/etc/cups/cups.conf”, or the “/etc/cups/cupsd-browsed” were controlling factors, but now Avahi seems to override those settings. (You can even turn off CUPS altogether, and your wanted printer goes away, but the autodiscovered ones remain. Arg.) I’m currently testing how best to do this. Here are three possible options:
    1. Turn off avahi-daemon altogether. Avahi is related to (the same as?) ZeroConf / Bonjour / Rendevouz / Auto-discovery. You’d think that you could turn it off with a simple:
systemctl disable avahi-daemon
but on reboot, it seems to be back in service. Flipping the bit in “/etc/default/avahi-daemon” doesn’t help either. You might have to tweak the avahi files in “/etc/init.d” to disable it.
    1. Tell Avahi to not publish on dbus the devices it finds. Edit “/etc/avahi/avahi-daemon.conf”, uncommenting the line under “[server]” that says “enable-dbus=yes”, and changing the “yes” to “no”.
    2. Tell the GTK-3 applications (like Firefox) to not use the devices published by Avahi. Create “/etc/gtk-3.0/settings.ini”, and add the following content to it:

[Settings]
gtk-print-backends=file

(the default, without this setting, is "gtk-print-backends=file,cups)

Of these three methods, I’ve had the best results with “b”.

You should now be able to print to a Pharos printer from Linux. I edited the “/usr/local/bin/pharospopup” python script to swap out “myACU” for “myITT”, and to tweak the “release station” to “the Circulation Desk”. Now the popup is customized more specifically for my environment.

Wednesday, September 20, 2017

Biblical Complementarianism

N.T. Wright (whom I've never listened to before; didn't really know anything about him) is asked a question about "Gay Marriage", and presents a very interesting concept from a much wider view:

The Biblical design of our (pre-Fall original and future restored) cosmos is one of complementary contrasts:
  • Light - Dark
  • Day - Night
  • Heaven - Earth
  • Land - Seas
  • Birds (flying in air) - Fish ("flying" in water)
  • Male - Female
  • God (Christ) - Humans (Church)
  • New Heaven - New Earth
  • Lion - Lamb
  • Body - Spirit
This is the Design. Anything else is something other than the Design.

Friday, September 08, 2017

What Matters is the Heart

I recently read online the claim that, "What truly matters is obedience."

And I do not in any way want to diminish the need for obedience.

But let me suggest that the Pharisees thought the same way, that, "What truly matters is obedience". They were so ultra-concerned with obedience that they tithed on even the smallest spices - mint, dill, and cumin.

But Jesus said there were weightier matters than this type of obedience - justice, mercy, fidelity.

Jesus spoke often to this issue. He said that if you're in the middle of a worship ritual - obedient sacrifice - and remember that you've got something against your neighbor, you were to leave your sacrifice at the altar and go deal with the neighbor issue.

He spoke about how food going into your mouth does not defile a person, no matter how "obedient" you might be concerning dietary restrictions; what matters is what is in, and what comes forth from, the heart.

He spoke about white-washing the outside obediently, but having a dead inner-man.

He spoke about praising God outwardly, with the lips, while the heart simply isn't in it.

Obedience is not about finding and enforcing every little legal nuance in a legal system; it's about having the spirit that drives you to want to please God. When you tell your ten-year old son to clean his room, and he obediently goes off to do it, you're pleased with his obedience. But when he gets distracted and pulls out a bunch of toys and makes the room worse, he's not at all being disobedient; he's being a ten-year old boy. He needs correction, not removal from the family.

Failure to precisely obey every jot and tittle does not equate to disobedience. What matters with your child is not his perfect performance; what matters is his attitude, his heart. Is he earnestly trying to do the right thing, even if he doesn't understand, or gets distracted, and fails to accomplish the exact goal you set for him?

In the old covenant, it was about a legal system written down on paper (rock, actually), in specific regulations such as "don't touch, taste, handle", that had to be taught one to another. But the new covenant is not like the old; it's written on the heart, and doesn't consist of regulations like "don't eat this; observe this holy day, etc", that has to be taught one to another. It's a matter of attitude - love - first for the Creator, and then for one another. It's a matter of where your heart is.

Now granted, if the heart is in the right place, one will seek to be obedient in all things. But a perfect score in Performance is not what God is looking at in the new covenant; Jesus got that score for us, which is given to us on the basis of our attitude and trust in him. He's looking at our hearts.

Willful disobedience absolutely will disqualify one from the reward. But an imperfect score will not disqualify us, because Jesus' perfect score is given to us (he even got baptized to fulfill even that detail of right-ness, not because *he* needed to be baptized, but because *we* need to be).

What matters is the heart.