Make an internet radio station with one line of bash
21–30 of 55 posts
Re: Make an internet radio station with one line of bash
#22Browse the Internet with one line of Bash: firefox https://news.ycombinator.com But seriously, the commands in the article are not Bash commands (they don't even use Bashisms) and are valid in any POSIX-compliant shell.
> Your own internet radio station in one line
Re: Make an internet radio station with one line of bash
#23Re: Make an internet radio station with one line of bash
#24Browse the Internet with one line of Bash: firefox https://news.ycombinator.com But seriously, the commands in the article are not Bash commands (they don't even use Bashisms) and are valid in any POSIX-compliant shell.
The original title of the article is: > Your own internet radio station in one line
The original title did include the word "bash" (it was the one and only instance of the word "bash"). I removed this word from the main article because including the word "bash" superseded a conversation that was nominally about internet broadcasting. Maybe the title of this HN submission can be changed too.
I appreciate the commenters that picked up on the main theme of article and shared some interesting links! But I did enjoy the humorous comments too (who doesn't enjoy some good-natured bashing (pun-intended)).
Re: Make an internet radio station with one line of bash
#251. I host a VGM radio [1] 2. I use a combination of icecast2 and darkice to have a full home audio networking.
With the home audio network, there's a lot to optimize, but I haven't implemented it much more to experiment with it further.
Basically I have a Ubuntu Desktop VM on my home server. A long range bluetooth receiver [2] is feed from Proxmox host into the VM. The audio from the Bluetooth source (say your phone or your computer) is pulled from Darkice and renders an MP3 file/stream into Icecast2, which then broadcasts it on 10.0.0.10:8000/home I can use devices like Raspberry Pis to continuously listen on that URL for playback and play if it's available. There's CLI audio players like mpg123.
This could be used for whole home audio playback, but there's weird quirks to deal with like the delay between the audio in and when you hear it, as well as it becoming desynced over time.
It can also be setup in reverse where a RPi ingests audio from it's audio jack and sends it to the audio hub VM and the audio hub sends it out to the network.
[1] https://vidya.fm [2] https://www.amazon.com/gp/product/B07KTK8YP3/
Re: Make an internet radio station with one line of bash
#26I think the dissenting / mocking comments here are missing the spirit of the post. Since bash can evoke any Turing complete program, feasibly anything could be done with one line of bash. The authors intent as I saw was to show what that line was. Would you have known without this article? Whether or not people are just being sarcastic, I feel we should definitely not mock but rather encourage any open and free attem…
Bash can run any program, that's why you don't advertise running a program with it in your title unless the program is (at least mostly) in bash which is an interesting constraint to go check out. There are some really whacky crazy interesting things done in actual bash scripting including internet applications like this via bash's builtin /dev/tcp functionality... come to think of it this might actually be one of those crazy "I did it in pure bash"able things.
I'm sure most on HN knew you could pipe the output of a media application like ffmpeg into something like curl instead of locally. All of the exact options and methodology used here off the top of their head? Very unlikely but is that really what this title sets the expectation of?
I don't think mocking is the best recourse but I'm not sure it's much more useful to argue the author should only be receiving blind encouragement in cases like this either. Like I said I highly doubt the author had any malice when changing the title for HN but I also understand why many don't want to blindly encourage posts where the title can be so misleading/confusing.
Ironically "Creating my own free and easy to use internet radio station host" would probably have gotten even more attention with almost never of the pushback and the project work on norns is probably worth its own post.
Re: Make an internet radio station with one line of bash
#27Earlier quoted context omitted.
I love that Biden's putting his password into ~/.bash_history
It's also visible in the process table (ps auxww). It can be erased by rewriting the arguments from inside the process (I think this is OS-specific, not the same as changing argv in-place), but that is a race condition. The safe way is to either read it from stdin/fd (maybe call isatty(3) to check if someone doesn't echo password | ./foo), or open a file (check if permissions are 600). You could also have a named soc…
gpg -d ~/secrets/nuclear_launch_codes.gpg
source ~/secrets/nuclear_launch_codes
where the gpg key has a password and is stored on a hardware dongle that doesn't allow copying the private key off. If you really want to be fancy, there are some hardware security keys that also require a biometric to confirm.The other option is something like Hasicorp Vault, but we're way out of "one line bash" territory :p
Re: Make an internet radio station with one line of bash
#28This article isn't very useful for a "one liner radio", but I use icecast2 in a couple of ways 1. I host a VGM radio [1] 2. I use a combination of icecast2 and darkice to have a full home audio networking. With the home audio network, there's a lot to optimize, but I haven't implemented it much more to experiment with it further. Basically I have a Ubuntu Desktop VM on my home server. A long range bluetooth receiver…
You may want to check out Snapcast. I use it to distribute audio to 6 clients on diverse hardware (several Raspberry Pis, a Windows PC, a Linux PC) and it handles synchronized playback very well, after tweaking the latency offsets for each device (once).
https://github.com/badaix/snapcast
(Edit: Ok, Snapcast doesn't get rid of the delay. But it does keep the players in sync, if you can tolerate some delay between source and speakers.)
Re: Make an internet radio station with one line of bash
#29 ffmpeg -f avfoundation -i ":1"Re: Make an internet radio station with one line of bash
#30Browse the Internet with one line of Bash: firefox https://news.ycombinator.com But seriously, the commands in the article are not Bash commands (they don't even use Bashisms) and are valid in any POSIX-compliant shell.