Re: [GLLUG] How can I find out if external audio is connected?

2023-01-07 Thread damion.yates--- via GLLUG

On Mon, 26 Sep 2022, Dr. Axel Stammler via GLLUG wrote:

I would like to remind myself of external amplifiers uselessly running so I 
would like to play a short sound signal once in a while if there is no audio 
playing. OTOH, the signal should obviously not be played over the built-in 
speakers. So, how can I find out (preferably using a command-line utility in 
a script) which of the ‘audio out’ connectors are actually connected to 
anything (or just have a plug in them) and if anything is played over these 
connections?


I'm not sure if it's possible to programmatically determine external vs built 
in, but if you're not opposed to simply hard wiring this in a cron job you set 
up yourself, then you can just look up up the devices with `pactl info` you'll 
need to has this through some perl or something and then grep out the local 
device leaving you with the various attached external audio devices before 
using something like aplay just send audio.  This assumes ALSA and pulseaudio 
which is reasonably likely but audio in Linux changed over many years so you 
might have Oss or you might be using pipewire etc etc.  Determining if audio is 
currently playing will also be interesting as these new technologies simply 
attempt to mix audio together rather than block when you're device is in use. 
You might be able to kludge up some sort of grep against a console based volume 
bar indicator.


This sounds like a fun little project to attempt using a bunch of Unix command 
line tools :)


 - Damion-- 
GLLUG mailing list
GLLUG@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/gllug


Re: [GLLUG] ssh local port forwarding remote interface binding.

2021-01-17 Thread damion.yates--- via GLLUG

On Thu, 14 Jan 2021, Tim Woodall via GLLUG wrote:


On Thu, 14 Jan 2021, damion.ya...@gmail.com wrote:


On Thu, 14 Jan 2021, Tim Woodall via GLLUG wrote:


In

ssh -N -L 8080:webserver:80 gateway

Is there any way to specify which interface should be bound on gateway 
other than by changing the routing table on gateway?


I found


https://unix.stackexchange.com/questions/16057/use-ssh-with-a-specific-network-interface


And my ssh manpage has indeed got a -b to change the bind address on 
your initial outgoing connection and also -B to change bind 
interface.  The rest about binding for the listening onb a fwd is 
indeed not helping your cause.


I'll give it a try but I assumed that was controlling the interface 
used on the local machine, i.e. the connection to gateway rather than 
the one from it.


Yes moments after sending I re-read your email and realised what you 
wanted was the sshd to be behaving differently, if you missed it this is 
the content:


--- content from followup email ---
Ah I misunderstood.  You want the machine called "gateway" to bind 
against a specific interface for its outgoing connectons, when doing the 
forwarding.  I had assumed this to be done by your choice of IP in the 
portion before the first port the "webserver" being remote and the part 
you want to route out to but I think I can see the issue now.  How do 
make sshd choose to use a particular binding for a host.  I can't see a 
-b in man sshd but man sshd_config does have GatewayPorts.  Otherwise 
route update or socat sound reasonable.


 - Damion


--
GLLUG mailing list
GLLUG@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/gllug

Re: [GLLUG] ssh local port forwarding remote interface binding.

2021-01-14 Thread damion.yates--- via GLLUG

On Thu, 14 Jan 2021, damion.ya...@gmail.com wrote:


On Thu, 14 Jan 2021, Tim Woodall via GLLUG wrote:


In

ssh -N -L 8080:webserver:80 gateway

Is there any way to specify which interface should be bound on gateway 
other than by changing the routing table on gateway?


I found
https://unix.stackexchange.com/questions/16057/use-ssh-with-a-specific-network-interface

And my ssh manpage has indeed got a -b to change the bind address on 
your initial outgoing connection and also -B to change bind interface. 
The rest about binding for the listening onb a fwd is indeed not 
helping your cause.


Ah I misunderstood.  You want the machine called "gateway" to bind 
against a specific interface when doing the forwarding.  I had assumed 
this to be done by your choice of IP in the portion before the first 
port the "webserver" being remote and the part you want to route out to 
but I think I can see the issue now.  How do make sshd choose to use a 
particular binding for a host.  I can't see a -b in man sshd but man 
sshd_config does have GatewayPorts.  Otherwise route update or socat 
sound reasonable.


 - Damion

 - Damion

--
GLLUG mailing list
GLLUG@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/gllug

Re: [GLLUG] ssh local port forwarding remote interface binding.

2021-01-14 Thread damion.yates--- via GLLUG

On Thu, 14 Jan 2021, Tim Woodall via GLLUG wrote:


In

ssh -N -L 8080:webserver:80 gateway

Is there any way to specify which interface should be bound on gateway 
other than by changing the routing table on gateway?


I found
https://unix.stackexchange.com/questions/16057/use-ssh-with-a-specific-network-interface

And my ssh manpage has indeed got a -b to change the bind address on
your initial outgoing connection and also -B to change bind interface.
The rest about binding for the listening onb a fwd is indeed not helping your
cause.

 - Damion

--
GLLUG mailing list
GLLUG@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/gllug