Live data from Hacker News

Bye CUPS: Printing with Netcat

retrohacker.substack.com

31–40 of 183 posts

Re: Bye CUPS: Printing with Netcat

#31

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 eventuall…

At some point you may get bitten by just nc’ing files around as tcp checksums alone are not that great. A lot of transfers or large files will at some point introduce errors. This is where an application layer error check may be desirable.

Re: Bye CUPS: Printing with Netcat

#32
post #29

I 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 ca…

How did you add network cards? Do some printers have PCI expansion slots?

Proprietary, 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.

Re: Bye CUPS: Printing with Netcat

#33

I 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 ca…

I 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.

Re: Bye CUPS: Printing with Netcat

#34
post #7

Convenient, but not very secure

I 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)

Re: Bye CUPS: Printing with Netcat

#35

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 eventuall…

My favorite version of this is reading from /dev/dsp will capture audio from the mic. I would cat this audio to /dev/dsp on another host over ssh in the school lab.

Re: Bye CUPS: Printing with Netcat

#36

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 eventuall…

When I was first learning Linux many years ago a friend and I got intoxicated and catted /dev/hda into /dev/dsp. It was all basically static with sometimes very structured patterns that we would try to guess as to what filetype was producing them. He had download and forgotten about a long uncompressed audio recording of a piano performance on his drive that suddenly started breaking through the static in chunks of varying length. We came to the conclusion that this was probably just what the kernel source sounded like.

Re: Bye CUPS: Printing with Netcat

#37
post #31

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 eventuall…

At some point you may get bitten by just nc’ing files around as tcp checksums alone are not that great. A lot of transfers or large files will at some point introduce errors. This is where an application layer error check may be desirable.

Is that really the case? (I mean i know in theory, but in practise does it matter?). Its not like http has its own checksum, and i've never had problems downloading over http (yes https does have better checksums, but i suspect it would just fail and not auto retry, which has never happened to me)

Re: Bye CUPS: Printing with Netcat

#38
post #21

FWIW, 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/ ). I expect to never have to hassle with printer drivers again...

keep in mind not every printer has a good http stack, especially if the device never gets restarted this can be a problem.
Post reply on HN