22 ms·
Bye CUPS: Printing with Netcat
- deleted 5y ago[deleted]
- mackman 5y agoMy 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.
- voidmain0001 5y ago...all downhill since then. Well said greybeard, well said. https://dilbert.com/strip/1995-06-24 https://dilbert.com/strip/1995-06-24
- mbreese 5y agoA few years later (2002-ish), I setup a Zebra barcode/label printer that had a similar mechanism. I’d write the code for the label in the printers language (ZPL?) and then FTP a file to the printer. I was in grad school in a wetlab, so I had to label a ton of microcentrifuge tubes. Having a quick web interface e to generate the ZPL files that would be FTP’d to the printer let me avoid writing all of that out by hand. It was such a simple system. And the FTP server was basically a queue, so you could print a bunch of labels at a time.
- herpderperator 5y agoHow would you get an application, such as Firefox or Chrome, to know to use netcat to print?
- Evidlo 5y agoChoose 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.
- r3trohack3r 5y agoOh fascinating. If I use the system dialogue, I can choose the application to print to. There is an `lpr` option, and I can specify the application it invokes in a "Command Line" field. I can put `nc [printer_ip] 9100` there and it will just print. I just printed your comment this way. That's cool! Thank you for teaching me something!
- gsich 5y agoBack in the day I opened telnet on that port. Typed some stuff and was fascinated that it got print.
- jkingsman 5y agoYou'd need to set up a system printer using the JetDirect/socket protocol, then you could print via normal print dialog.
- r3trohack3r 5y agoToday I: CTRL+P -> Save to PDF. If I want to print multiple pages per sheet: Open PDF in Firefox, CTRL+P -> Save to PDF and configure the document. You can also pipe through `gs` to do this. For _huge_ documents (100s of pages), I'll pipe through `gs` first to do the pdf->ps conversion on my laptops CPU. The printer can do it, it just takes a lot longer.
- mongol 5y agoFound some info here https://en.wikipedia.org/wiki/JetDirect#Protocols https://en.wikipedia.org/wiki/JetDirect#Protocols
- turminal 5y agoConvenient, but not very secure
- lucb1e 5y agoI would recommend you never sniff a hospital's LAN. The print jobs that you see coming over the line, not all of them are SFW. (Very few printers in the world seem to be setup to use secure connections unfortunately)
- jim-jim-jim 5y agoHah. 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.
- cogman10 5y agoThe secret of *nix that people don't like accepting is the file approach is often the right approach. Consider lowly embedded linux. You COULD dig down deep into the documentation of which register, which interrupt, which special memory address needs to be written to interact with the right ports on a embedded linux board. All while adding a bunch of safeguards and checks to make sure "Only you are doing this". Or, as if often the case, you can simply find the right /dev/xxxx device and read from it or write to it. 9 times out of 10, you'd not suffer any negative consequences from using the /dev/xxx system as intended and you get the bonus ability of being able to interact with the outside world using programming languages other than C.
- Denvercoder9 5y agoI don't think this has anything to do with the file approach per se, just with using an interface at a higher abstraction level.
- PaulDavisThe1st 5y agoThe file approach ignores anything that exists (at least in part) in the time domain. Audio files are (for me) the canonical example. A text file has no inherent bit-rate. An audio file being handled without knowledge of (even just) its sample rate has its semantics distorted or destroyed. There's an awful lot of things you can do with the file approach, and I love it. Cross into the time domain and try to retain the same approach, and I say you're making a serious mistake. What's worse is when the actual programming APIs (as opposed to just redirecting stdout to /dev/dsp) also fail to model the time aspect, and encourage programmers to think that you can just shovel data at a device without any consequences for your software's properties (like latency).
- terinjokes 5y agoThis is how this Hackernews printed several pages worth of the plaintext representation of a PDF on an office printer a few years ago before figuring out how to cancel the job.
- Arnavion 5y agoSo how did you cancel it? I assume killing the nc process wasn't enough because it had buffered the whole file, so you had to do it at the printer?
- squarefoot 5y agoHappens all the time when something goes wrong, like malformed files, wrong driver loaded, etc. All printers have an internal buffer, so when one goes crazy printing pages of gibberish, the only solution is to kill the job directly on the printer, or turn it off asap, then go to the computer and empty the print queue should something exist there as well, then do the same at the print server, if there is one. The point is that once a print is started, all buffer will eventually end up to the printer, so it's the 1st device we must stop and the last one to restart once we're sure no data to print is left between the application and the paper, that is, not before all spoolers have been emptied.
- exikyut 5y ago[Smiles in n-gate]
- dredmorbius 5y agoIf 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.
- cbhl 5y agoThe 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 at the mid range you avoid the "printers whose ink cartridges are more expensive than the printer" zone.)
- BearOso 5y ago> 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.
- GeekyBear 5y agoApple 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.
- dimitar 5y agoWorks on any OS (just tried macOS for example), but its not very convenient to set print options. Passed a jpg and it printed out the metadata.
- herpderperator 5y agoI just tried this and while it worked, it was very slow. It takes a minute to start printing a page in a PDF, meanwhile nc is still hanging and sending the data, seemingly very slowly. The printer is constantly showing "Receiving Data" on its screen. The PDF is only 450KB. Edit: It took about 5 mins to print a 3-page document, with long pauses between each page.
- r3trohack3r 5y agoI suspect it's the printer doing the pdf->ps conversion. I have a beefy printer, so only run into this for large documents. But I'll cat through `gs` then to `nc` to do the pdf->ps conversion locally, and it is much faster.
- herpderperator 5y agoThat makes sense. That's why you want to do print spooling on client devices, which run on extremely fast CPUs in comparison. I guess that is why we don't send documents directly to printers.
- voidmain0001 5y agoYMMV as the printer needs to support PCL/PDL and not all HP network servers have it built-in. HP chose to save some money by making dumb network cards that forced the PCL/PDL rendering on the Windows computer which made using Linux difficult. http://danieru.com/2013/06/06/what-is-port-9100-how-to-print-to-it/ http://danieru.com/2013/06/06/what-is-port-9100-how-to-print... While you're at it you may as well try out the printer exploit kit https://github.com/RUB-NDS/PRET https://github.com/RUB-NDS/PRET
- marcodiego 5y agoI once did something similar to that on my previous job. A colleague came by asking who printed several pages of garbage. Me: "Sorry, I just inferred every reputable printer supported postscript". The problem: the job was an outsource for a pinter vendor. They obviously did not like my comment.
- corbet 5y agoFWIW, the Internet Printing Protocol (and IPP Everywhere in particular) make printer setup in CUPS far, far easier, but distributors seem reluctant to encourage it. I wrote about my experiences with IPP back in June (https://lwn.net/Articles/857502/ https://lwn.net/Articles/857502/). I expect to never have to hassle with printer drivers again...
- merb 5y agokeep in mind not every printer has a good http stack, especially if the device never gets restarted this can be a problem.
- gerdesj 5y agoProbably true but why not turn it off and on again daily. While you are at it, you can restart your print queues regularly via a cronjob or Taskman. There is no need to suffer if that will do the job. Pragmatism is not the enemy of perfection.
- MonaroVXR 5y agoDidn't know about that, you got some examples?
- gerdesj 5y agoI own a HP MFP and for several years HPLIP generally worked for several to many months at a time, until it didn't. Me and the wiff both run Arch on our laptops (she doesn't know or care). After a particularly rubbish time trying to get HPLIP working again after a pacman -Syu I did a literature search: Mr CUPS had deprecated everything apart from IPP Everywhere. So, I tried it out. Me and the missus send docs to print and they get printed. I cannot remember the last failure (apart from running out of paper.) I also have toner levels monitored via Home Assistant. I also have an office with several MFPs and inkjets, accessed via Windows (Server 2019) print queues. They are not so reliable. I often have to restart the Print Spooler service on our print server. To be fair, it is generally one queue that is at fault.
- 5y ago
- ggm 5y agoCUPS exist because not all printers are HP. Magic in printing is still an arcanum. PPD files. Windows 10 as a print server. (some print devices are not networked) Prelude files. in-printing logic like line reversal, density adjustments for photos. Double sided printing meta-signalling, n-up.. "oh, I don't need that stuff" fine, fine, nc is going to work for you, at the end of a bumpy road to a printer which supports it. And, right up until its 2am, you want to colour print that late birthday card for your favourite aunt, and the printer is stuck on nc...
- naikrovek 5y agoI guess some people need CUPS but.. I have a $90 Brother laser printer and it has support for all kinds of protocols, and I can send multiple text files (9100 is the "raw data" port, not anything else) to it at the same time on port 9100 and it figures everything out and doesn't get confused. I can send stuff to it over FTP, too. $90! I will never use CUPS again. I'll need a printer driver, yes, but I'll never need CUPS.
- TacticalCoder 5y agoI used to do this at home all the time (from Linux though): networked printer with its own IP address and then good old netcat. I'd do it with PostScript files and send them to HP LaserJet 4M+: not only do these beauties speak PostScript natively, they can also be made to display the infamous "PC LOAD LETTER" message. I'd try to find these printers used then I'd upgrade them: more RAM, more fonts, adding a network card inside the printer etc. I still have several of these printers in a garage, some of them have printed more than 300 000 pages. They probably still work: some things were that good back then. And, yup, there's something feeling magical when netcat'ing a .ps file (or another format) directly to the printer.
- na85 5y agoHow did you add network cards? Do some printers have PCI expansion slots?
- kindall 5y agoProprietary, not PCI, but expansion slots, yes. On HPs it was called the MIO slot and later the EIO slot. If your printer came with a MIO card that only did serial and parallel, you could swap it for one that added networking.
- jeffreygoesto 5y agoAnd if it stops working, try re-soldering it in an oven before throwing away. Some infamous batches had bad soldering problems that can be fixed. See i.e. [0] [0] https://community.spiceworks.com/how_to/2077-how-to-bake-an-hp-jet-direct-card https://community.spiceworks.com/how_to/2077-how-to-bake-an-...
- jtvjan 5y agoI recently tried that with my Epson Ecotank, but instead of rendering the document, it just printed out the literal source code. It then held the paper halfway through the machine until I sent enough newlines. I was only half disappointed.
- deeblering4 5y agoHave fun printing a shipping label from your phone using Netcat.
- ReactiveJelly 5y agoI have netcat in Termux. Not sure if I can access files though.
- zaik 5y agoGive Termux storage permission and `cd /storage/emulated/0`.
- alexpotato 5y agoBecause Apple "owns" both CUPS and iPhones, you can print from an iPhone directly to a printer shared on a Linux machine if they are on the same network. My wife (not technical) figured this out one day and I didn't believe her at first that this would all "just work".
- RajBhai 5y agoAndroid hasn't needed any printer plugin to be manually installed for a while now. Since Oreo I believe. I've printed from my phone to my pi CUPS server. Even Windows 10 understands IPP.
- gopaz 5y agoWait until he finds out about /dev/tcp :) It actually blew my mind after doing Linux for 10 years. "Everything is a file" isn't a lie.
- justinsaccount 5y ago/dev/tcp is a lie though. It's not actually a file, it's implemented directly in bash.
- vortico 5y agoBeen doing this for years since when I accidentally opened my printer's IP address in my browser and it printed a page starting with GET / HTTP/1.1
- bharrisonit 5y agoLooks like there's a reasonably tidy script for conventional print options with a nc back-end, so to speak. http://tkrh.co.uk/netcat.html http://tkrh.co.uk/netcat.html Untested, but code reviewed with one eye.
- nonameiguess 5y agoThe 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 alone and are the only user on your LAN, betting no one else is sending a job to the printer at the same time might be a rough bet. Even when it works, there might be downsides, as some other comments are alluding to. The long print time one mentioned is likely because while you're lucky that your printer understands how to transcode pdf to ps in order to print a pdf, the onboard processor on the printer is much weaker than whatever you have on your computer. 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.
- deleted 5y ago[deleted]
- ChuckMcM 5y agoHence the existence of lp(1), which at its simplest is just a queue that sends things to the network as they arrive.
- AceJohnny2 5y agoHuh. So can one leverage/hack lp to serve as a generic service spooler? Has anyone done so (in a mildly documented way)?
- mprovost 5y agoYes, 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/lpdforfunandmp3playing/ https://patrick.wagstrom.net/weblog/2003/05/23/lpdforfunandm...
- tonyedgecombe 5y ago
- e12e 5y agoWell, seems to be missing that for many, the point of CUPS is to take a regular, non-network enabled printer (parallel port, USB etc) and turn it into a networked printer... https://www.freedomit.co.nz/kb-centos/76-using-port-9100-to-print-to-a-printer-queue-on-a-cups-enabled-server https://www.freedomit.co.nz/kb-centos/76-using-port-9100-to-...
- deaddodo 5y agoThat's definitely not true. That is a side-effect of CUPS, but CUPS exists very much in the same realm as PulseAudio and other service-enabling frameworks around hardware. It allows software/clients to interface with printers in a seamless and safe manner.
- tracker1 5y agoIn a former life, I was doing tech support for UPS in the early-mid 90's I played around quite a bit with the commands to reset the various serial printers via echo and port targets. Not surprised things have moved beyond this. Nice to see that .pdf pretty much just works.
- anthk 5y agoYou can do the same with IRC and a ksh/Perl script implementing a loop and PING, Gopher, FTP, MUDs, Finger and NNTP servers. With Plan9/9front everything involving TLS could me made a script and an Acme frontend, except for video.
- r3trohack3r 5y agoKISS Linux taught me this! Once I realized I could read/write to IRC over netcat, I paired that will all the Bash magic KISS taught me and created a pure bash IRC client in 54LoC: https://github.com/retrohacker/irc-sh https://github.com/retrohacker/irc-sh
- anthk 5y agoI'd prefer to have one based on nc and sh as it's more portable (think busybox systems). Also, check this for gopher: https://github.com/hb9kns/nago https://github.com/hb9kns/nago Now you can browse HN, play IF, read news, and so on over Gopher with just Busybox (sh, grep, tail and netcat requiredin the busybox build) and an internet connection: gopher://hngopher.com gopher://mozz.us Altough with just less, echo and nc: echo / | nc mozz.us 70 | less echo /long/selector/to/a/text/file.txt | ncmozz.us 70 | less Crazy but it could work on heavily tiny restricted devices such as a RetroBSD with nc, echo and less in a tiny microcontroller.
- anthk 5y agoAlso, I forgot, poor man's dictionary: dict(){ echo "define * $1\\n\\q" | nc dict.org 2628 | less ; } dict unix
- r3trohack3r 5y agoWoah! This is awesome!
- massysett 5y agoIt’s odd that the author does not mention that because this is FreeBSD, the recommended print spooler is the Berkeley line printer daemon, not CUPS. It’s discussed right on the page he linked to.
- newman314 5y agoSo.... there is this thing where I can upgrade the firmware on a Brother printer with netcat. Equally cool and terrifying. I can dig up my notes if someone is interested.
- astatine 5y agoKinda similar, we could use LPT1 on DOS as a file and write to it or even just do a "copy" on the command line ( remember "copy CON LPT1" ?). This was pretty much the default way to print, with applications sending ESC sequences to pretty up the page. The problems were to do with handling problems like printer jams, out of paper etc which require, in essence, a partial resend and was tricky. Print spoolers on all platforms managed some of this complexity. The greater memory on printers and the ability to locally retry a page make it simpler today, but only in the most casual settings. If you want to print anything substantial, treating a printer as a file is not really a good idea.
- tonyedgecombe 5y ago>The problems were to do with handling problems like printer jams, out of paper etc which require, in essence, a partial resend and was tricky. Print spoolers on all platforms managed some of this complexity. The only system I'm aware of that managed that was AFP on IBM mainframes. Certainly the Windows print spooler doesn't. It assumes the printer handles a paper jam and just waits until it is ready to accept more data.
- teknopurge 5y agoAll *nix does this. Also try piping to lp then a device. Sorry to be cheeky, but welcome to 1977. ;)
- gigatexal 5y agoThis has to be the single best resource and reason to use FreeBSD: “ Off to the FreeBSD Handbook I went.” The Handbook is really well written and helpful.
- neilv 5y agoTwo downsides to being able to send PDF bytes direct to TCP port 9100 hosted directly by the printer firmware on the printer's own network interface... * That's not encrypted. * (More importantly) You might look at the printer firmware's complexity, excessive IoT/cloud-friendliness, and hints from the printer brand about their current engineering standards... and become uneasy about plugging that into your LAN, even if you firewall it to heck. Partial solution: for my modern laser printer, I've left its NIC unconnected, and put my own print server in front of it, on a VLAN, and connected via USB. And I still strongly suspect at least a couple classes of vulnerability still present, but no time to look into it or mitigate. Variation for the article's needs: you can make a one-line script TLS/SSL tunnel from a local port on your workstation host(s), to a thin isolating host (old RasPi?) in front of the printer. So content is encrypted over the LAN, and the printer is more isolated than it would be normally. Another variation: plug the printer directly into a single host that needs it (such as via USB or a dedicated Ethernet NIC), and then decide what to do about any other hosts that want to use the printer.
- jamiewildehk 5y agoFirst job out of uni I worked for a company who had software that output pure HP PCL5, and yeah, you just netcat it directly to the printer IP (or configure an LP queue with no filtering to do it for you). Fun days.
- fouc 5y agoA lot of CUPS defenders in here, but they're all talking about the usefulness of CUPS in more complicated situations. It seems far more friendly to mention that netcat is an option to the average home linux user.
- cupcake-unicorn 5y agothat's great and all but not everyone has an HP...once we have better driver support, sure. Or am I misunderstanding something?
- jcrawfordor 5y agoWhile 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, which leads to a lot of inexpensive network printers actually lacking postscript support. Further, printers are very slow at rasterizing, and so while support for PDF rasterization is very common you probably don't want to use it. You can easily see a minute per page for printing modest PDFs. In-printer PDF rasterization is also of very uneven quality, and I have seen issues like completely broken kerning in documents due to the printer's poor handling of embedded fonts. One of the key functions of something like CUPS is to address this problem: CUPS standardizes the format of all printed documents to something that is well-supported by the printer, and performs much of the rasterization ahead of time on the much faster print server. This saves time and improves reliability since you don't need to figure out if a given document is supported by the printer. For most printers these days some variant of PCL is the preferred language for jobs, as it's simpler and easier to implement than Postscript. It also presents fewer security concerns. Of course the other major problem CUPS solves is the management of the queue, including across multiple users. That's an important feature but not one that matters in a lot of home situations. That said, if you don't use a printing system you can and will run into annoying situations where you cannot print a document because you are waiting for the previous one to complete sending, which often gets blocked on the printer's memory space or rasterization.
- thayne 5y agoThat's pretty neat... But does it work with postscript files? Or maybe pdf? I also assume it only works for networked printers?
- r3trohack3r 5y agoThe Handbook doc linked in the article shows how you can do the same over USB.
- ok123456 5y agoPipe it through through gs.
- jasonhansel 5y agoQuestion: is there an equivalent for printing over USB?
- henearkr 5y agoI immediately tried it... Aaand this is how I made my printer spit out dozens of garbage pages with just one to two lines of gibberish on each (the PDF source code, admirably giving up the page at each occurrence of the corresponding char)...
- UberGuidoZ 5y agoTurns out that's the same result on Windows when using Ncat /shrug
- henearkr 5y agoI'm on Linux (Arch) and I had no more luck with PS than with PDF... My printer is a Brother HL-2270DW... seems to be quite a dumb one...
- avodonosov 5y agoI am printing from Ubuntoo for years withopt troubles, and don't even know is that CUPS or not. When installing Ubuntoo on new laptop I configure printing with help of internet search and forget. Is Linux printing really such a problem?
- Cloudef 5y agoI wrote once a escpos emulator[1] that takes in escpos code and turns it into a bitmap image. I failed to get this bitmap image to print properly with cups so I ended up writing my own printing routines as well for that certain receipt printer[2]. 1: https://git.cloudef.pw/escpos2raster.git/tree/ https://git.cloudef.pw/escpos2raster.git/tree/ 2: https://git.cloudef.pw/escpos2raster.git/tree/src/bin/starpbm.c https://git.cloudef.pw/escpos2raster.git/tree/src/bin/starpb...
- noway421 5y agoThis is amazing. I am on Mac OS, and honestly even for me it looks enticing. I will try it!
- stjohnswarts 5y agoYeah try that with a random laser printer :) .
- rhdxmr 5y agoWhat a surprising knowledge. I didn't know that printers support parsing PDF or even ASCII. I considered printers only support printer protocols.
- fogihujy 5y agoSo, network equivalent of piping text to the parallel port?
- axiolite 5y agoTerrible 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.
- andix 5y agoThat’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.
- yubiox 5y agoPlain ascii worked but a pdf printed garbage, on an old samsung laser. I use the generic PCL laser printer driver on mac with it.
- pimeys 5y agoI 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-services.nix#L4-L39 https://github.com/pimeys/nixos/blob/main/modules/home-servi...
- scns 5y agoYour config files make we wanna learn NixOs, but i'm in the process of backing up this one and installing Tumbleweed on it. Thank you for sharing.
- djmix 5y agoConfronting network driverless printers with other models that needs to be supported with specific drivers doesn't seem to be very fair
- mmcgaha 5y agoI hated the change to CUPS. I liked both the simplicity and complexity that I had going with lpd. The system itself was simple and my filters were a beautiful mix of AWK and Ghostscript. I even had a queue to email PDFs. I guess CUPS works fine but just working out of the box is not very fun.
- blueflow 5y agoI've been using netcat for 4 years to print in my office. I'm on linux, and i convert non-text files to postscript via the firefox "Print to file" functionality (save as *.ps), and then netcat that postscript to the printers IP port 9100. This requires the -N option of netcat to work correctly. I did not realize this was an exotic thing to do? Edit: Now that im testing it, i see that firefox has recently dropped support for printing to postscript. Classic firefox. Can someone recommend me an alternative browser?
- jleahy 5y agoJust print to pdf and add pdftops (from poppler) to your pipeline.
- 6c696e7578 5y agoPSA: If you're going to try sending odd file formats to your printer. Just leave one sheet of paper in the tray whilst experimenting.
- NelsonMinar 5y agoWhat if you put CUPS... in the printer? And made it a network device? Unix printing was designed in an era when most printers were dumb serial or parallel devices chained directly to a computer. Or if they had an ethernet jack, had some bizarro proprietary system that was very minimal and included no memory, queueing, or ability to interpret complex formats like PDF. That is the environment CUPS was designed for. And it was a huge improvement over the old lp system. The "l" in "lp" literally means "line". Like everything else in the computer world printers have gotten a lot more capable. They may literally be running CUPS. That's why you don't need another complex print spooler and format convertor on your client machine.