Live data from Hacker News

Bye CUPS: Printing with Netcat

retrohacker.substack.com

131–140 of 183 posts

Re: Bye CUPS: Printing with Netcat

#131

The point of CUPS and of server middleware in general like PulseAudio and what not is when multiple clients all want to send output streams to the same sink. Just sending the stream directly to a device with no middleman works fine provided 1) the stream is encoded in a way the device understands, and 2) no one else is trying to use it at the same time. For a shared network resource like a printer, unless you live al…

Hence the existence of lp(1), which at its simplest is just a queue that sends things to the network as they arrive.

Huh. So can one leverage/hack lp to serve as a generic service spooler? Has anyone done so (in a mildly documented way)?

Re: Bye CUPS: Printing with Netcat

#132

While the article is correct, it omits most of the actual function of CUPS. Many printers are capable of accepting various types of documents directly over the network, with postscript, HP PCL, and PDF being commonly supported---and ASCII pretty much universally supported. The problem is that few printers support _all_ of these standards. Postscript, for example, is surprisingly complex to implement in practice, whic…

What about Page Layout / Color/Mono selection etc.,?

Postscript has commands for that, you can preprocess the file appropriately.

Re: Bye CUPS: Printing with Netcat

#133
Terrible idea on several levels.

Avoid jetdirect (9100) port like the plague. Partial files? Errors parsing the postscript? Outputting to the jetdirect port will result in printing every bit of that trash out, no questions asked. Walked up to a printer and found Nearly blank pages with one PCL or Postscript line telling you there's an error? That's jetdirect printing for you, and there's no good reason for it. LPD and IPP have actual protocols signaling start and end of jobs, so nothing comes out if something in the process fails, saving paper, toner and frustration. Yeah, you can't just use netcat, but you can easily use lp: lp -h 192.168.0.30 file.ps

Printing raw to a printer without drivers is also a terrible idea, it happens to work some of the time, but leaves you at the mercy of printer defaults. Printing a US Letter page on a printer which defaults to A4 (or vise versa)? Say goodbye to part of your print job. Now, yeah, you could program the correct command sequences into your postscript document, but why would you want to? Plenty of other things used in documents will cause errors if sent to a printer without being sanitized by CUPS (or filters to lpng, or whatnot).

CUPS isn't great. It makes printing so much harder than it needs to be. I absolutely hate having to remember the exact syntax to select B&W on my color printer: lp -o ColorMode=Monochrome It's very difficult to track down how it's mangling your print jobs, when there's a problem and you need to do so. Having to do an old apache style allow,deny reverse polish notation logic to configure who you want to access the printer and admin interface is user-hostile to be sure. And more. But it certainly has made it much easier to go from nothing to up and printing quickly, it's certainly got every feature you could need, and it's certainly reliable. I've done it in the old days, and I certainly don't want to go back to configuring printcaps manually with inscrutable invocation of ghostscript and many other print filters.

Re: Bye CUPS: Printing with Netcat

#134

Earlier quoted context omitted.

Hence the existence of lp(1), which at its simplest is just a queue that sends things to the network as they arrive.

Huh. So can one leverage/hack lp to serve as a generic service spooler? Has anyone done so (in a mildly documented way)?

Yes, at OpenBSD hackathons they used lpd as a queue for mp3s so all the devs could submit music to be played for the room.

https://patrick.wagstrom.net/weblog/2003/05/23/lpdforfunandm...

Re: Bye CUPS: Printing with Netcat

#135

The point of CUPS and of server middleware in general like PulseAudio and what not is when multiple clients all want to send output streams to the same sink. Just sending the stream directly to a device with no middleman works fine provided 1) the stream is encoded in a way the device understands, and 2) no one else is trying to use it at the same time. For a shared network resource like a printer, unless you live al…

> Also beware that if you're doing this on a radio network, I don't think netcat can encrypt the traffic. So don't be printing your credit card statements this way.

Of course netcat does not encrypt anything. But if your printer accepts encrypted traffic you can send that over netcat. The question is what encryptions do the printers support? What protocol (stack) CUPS uses in the end? I have never heard that a printer certificate has expired, so my first guess would be it's all in cleartext.

Re: Bye CUPS: Printing with Netcat

#136
That’s why you should only buy printers that support standard formats. Preferably PDF and PCL.

They also don’t turn into junk, after the next OS update, when the manufacture decided not to provide driver updates anymore.

Re: Bye CUPS: Printing with Netcat

#137
post #83
post #23

Earlier quoted context omitted.

The CUPS web front-end also has rough edges; Apple maintains CUPS these days and OS X now ships with the web interface on :631 disabled. If you still need a print server, it can be well worth the extra $100 or so to buy a business-class printer with an IPP server in it, so that CUPS runs on a chip inside the printer instead of on a separate computer. (Generally anything that supports "Airprint" will do this, and also…

> Apple maintains CUPS these days Apple never really maintained CUPS. They hired the author, Michael Sweet, and he pretty much served as the printing team. He left Apple a couple years ago, and basically stalled their printing department. He’s recently become head of the Printer Working Group, and they’re all pushing IPP Everywhere towards greater adoption. It’s a laudable effort.

Apple moved to IPP (branded as AirPrint) a decade ago.

Google shut down Google Cloud Print in 2020 and moved to IPP.

Microsoft announced that they were moving to IPP (branded as Universal Print) in 2020 as well.

CUPS still exists because legacy printers don't have built in IPP support.

Re: Bye CUPS: Printing with Netcat

#139
I used to dread setting up printers on any operating system. I've done it countless of times with Linux, Windows and macOS, and it's been quite common to have some kind of fight with the printer until I get my paper out.

Only recently, by buying a Brother laser printer at home, and setting all my machines to use NixOS, I haven't been needing to think about printer problems anymore. All I need is this piece of config, and the printer will Just Work with the new computer:

https://github.com/pimeys/nixos/blob/main/modules/home-servi...

Re: Bye CUPS: Printing with Netcat

#140
post #56

Earlier quoted context omitted.

Rinse & repeat when every desktop environment brought their own audio daemons, then later PulseAudio and now PipeWire. I still roll my eyes and I don’t get surprised every couple of years when somebody releases a yet another Linux audio daemon. Maybe it’s some kind of Linux tradition. At least PipeWire is saner compared to PulseAudio.

> every couple of years when somebody releases a yet another Linux audio daemon. You seem to be stuck in, oh, maybe 2008. There hasn't been "yet another Linux audio daemon" in more than a decade. JACK came along in the early 2000's (I wrote it), and PulseAudio in 2004 or thereabouts. All that nonsense with esd, artsd etc. was over because the aughts were over.

Thank You For JACK.

Even though i don't do audio on Linux.

Post reply on HN