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.
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.
It has never occurred to me to do that but it is actually quite an obvious thing to do when you "know" that everything is a file.
Any idea what the visual equivalent would be?
Perhaps:
head -c800 /dev/urandom > /dev/tty
Or:
mplayer -demuxer rawvideo -rawvideo w=80:h=60 /dev/urandom
Change that to w=720 h=576 (for pal countries) and you can relive the glory days of analog TV static. Except not - mey memory seems to tell me it's more colourful. I guess it's to do with the limited chroma resolution in pal?
mplayer -vf eq2=1:1:0:0.6 -demuxer rawvideo -rawvideo pal /dev/urandom
Analog color television color information is sent "out of band" from the point of view of black-and-white television (as a sideband frequency, with neat analog trickery to cancel out its effect on main signal). Color TV is backwards compatible. It's unlikely that random input happens to look like meaningful properly encoded color information, so television static is largely black and white.
It's for you.
Warning, headphone users: may hurt your ears. Trust me on the volume lowering.
With 16 bit samples and (default) two channels, you can recognizeably hear small integer values in your left ear. :)
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.
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).
The irony, of course, is that the proprietary version of OSS failed, and it ended up going open source again.
IMO, /dev/dsp was the right approach and should have been extended instead of being replaced with entirely different interfaces.
Meanwhile, OSS on FreeBSD just worked.
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.
In what way?
It is really important to run a sound daemon with realtime privileges. This is the only way to ensure no cracks.
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.
Even though i don't do audio on Linux.
While it supports the same APIs as Pulseaudio, it's still a new audio (and video) daemon.
I don't get why this was never fixed at the kernel level. You have onions of layers.
It is the audio solution for Linux.
PipeWire does video too, and when combined with a compatible Wayland compositor, serves as a replacement for remote X11.
Don't worry, THIS time we got right FOR SURE.
FWIW, I have recently switched from PulseAudio to PipeWire. I remembered how rough the switch from plain ALSA to PulseAudio was, and thus was utterly baffled how smooth the transition to PipeWire is. I just uninstalled PulseAudio, installed PipeWire, rebooted, and everything just worked, down to the Bluetooth headset that I never quite got to work well with PulseAudio.
There were (and are) many problems with the OSS API, a number of which continue to exist in the ALSA API too.
All serious audio APIs (plugins, or native audio I/O) use a pull model at the bottom of the stack, so that i/o is driven by the hardware. You can layer a push model (where software does blocking read/write calls whenever it wants) on top of that, but not the other way around.
And yes, OSS and ALSA both implement select/poll etc. for audio devices, but do not enforce the use of this model, resulting in the 2000s being filled with Linux (and *BSD) apps that couldn't function correctly without oodles of buffering.
I used a script to toggle the SPDIF output stream of my Soundblaster Live to get track marks on the Mini Disc player recording the output.
I'd never though of that, so simple!
# On the receiver
nc -l 9000 > output.file
# On the sender
nc 172.17.0.7 9000 < input.file
My only issue is that it seems to hang after it's done. What am I missing?Netcat has plenty of (confusing) options, but there's usually a solution.
# on sender
ncat --send-only --listen 12345 < file.zip
# then, on receiver
ncat --recv-only 1.2.3.4 12345 > file.zipI also setup a horrible video chat in bash using just vlc and netcat. Audio works better like this
I never bothered with a printing system.. I'd just cat a ps file to /dev/lp0
Being able to just send wave data to the audio device "file" is pretty common on most systems that smell like Unix.
The netcat trickery from the article works on any platforms where netcat is available, what file formats are specifically supported varies by printer. Most will take text and Postscript (though some famous printers like the LaserJet 4 still had PS as an optional addon), anything more complicated is implementation-specific.