Live data from Hacker News

Bye CUPS: Printing with Netcat

retrohacker.substack.com

1–10 of 183 posts

Re: Bye CUPS: Printing with Netcat

#3
My first introduction to the internet was downloading Magic the Gathering card lists as postscript files via FTP and then FTPing them to a postscript printer. Would have been 1994 and they were some sort of Sun machine at LMU. Internet has been all downhill since then.

Re: Bye CUPS: Printing with Netcat

#6

How would you get an application, such as Firefox or Chrome, to know to use netcat to print?

Choose Jetdirect/Appsocket in the printer add menu and it will do the same thing.

There is nothing magic about netcat. You are just dumping Postscript/PDF data on a TCP port the printer is listening on.

Re: Bye CUPS: Printing with Netcat

#8
Hah. I had a similar moment of enlightenment with FreeBSD when somebody explained that you can just cat a wav file into /dev/audio (or /dev/dsp? forget the exact name). And that you can produce white noise by catting /dev/random to the same destination. With no barrier to the sound card like that, I was free to experiment with programming dfferent noise algorithms and figuring out how digital audio works. I eventually did things the proper way with OSS and finally sndio on OpenBSD, but direct, universal interfaces like files invite that initial exploration and help you get things done quick and easy.

netcat is also a secret weapon around the house. My girlfriend runs macOS, but it's way more reliable to just nc files to each other over wifi than deal with all the cloud and airdropping bullshit.

Re: Bye CUPS: Printing with Netcat

#10
If you have a single host, and a single printer, or your printer itself is both network-enabled and can manage its own print spool, direct TCP/IP printing may indeed work for you.

The value of CUPS is that it enables the CUPS-serving computer to run as a print server. This means not only print drivers (document format support --- typically plain text, Postscript, and one or more PDL (printer definition languages) & PCL (Printer Control Language), but status on the printer, queue management, job control, and access control. Note that if your printer is generally available on your local WiFi network, you might want to give more thought to that last element.

If those are overkill for you and your printer Just Works with generated output, then yes, you can get by without the complexity.

Note that you can also often telnet directly to the printer port.

Be aware of what you're trading off, though, and whether or not you actually need what CUPS, or direct network access, offers.

Post reply on HN