execute through socket

Hello,

I'm trying to launch a few programs (primarily audacity) from buttons on a flash page. This is all on a local machine, and I am aware of the inherent security risks. From what I've been able to find online, AIR and Flex can launch executables in windows, but not in nix.

I've heard mention that it can be done by building a socket between the swf and your OS, but I can't find any information on how to go about doing so.

Can any of you point me in the right direction to
a) launch programs with flash buttons?
or
b) pass commands to the terminal from flash?
or
c) run a shell from flash?

I'm not opposed to including other things (PHP, js, etc) whatever it takes.

Thanks

p.s. if it makes a difference I'm using ubuntu 10.10 with KDE and XFCE installed.

Not designed to do that.

I wouldn't depend on that even in Windows. Cow-sized security holes aside, it'd mean relying on a feature likely to disappear the first time anyone abuses it, or at least buried under n+1 layers of "are you really sure you're really sure" the way ActiveX ended up.

There's not anything running locally for your flash script to connect to either, unless you run it yourself. You could set up a webserver that allows connections only on localhost, install sudo, and allow your webserver to run sudo -i -u username /path/to/command so it can pop up windows on you when you load a PHP or CGI script. This is still a gaping security hole in that it allows anything running on your system to run arbitrary programs as you, but at least you're protected from the network at large.

In the end, though? Don't: This is a bad idea anywhere. Pick a language suitable for the job and use that.

Like I said, I am aware of the risks. But this is intended to run on a system with no WAN connection. Just a loopback on a LAMP server. That aside, if you have a better suggestion for setting up a graphical display to run programs on the server from a browser, I'm all ears. But most of the people who will be using it are useless with the terminal, or anything semi-complicated. It needs to be easy for them to use.

KDE already does menus without the firefox+nsflash+html+apache+cgi+php+sudo-based cthulu. Edit its menus to your pleasing, protect the settings files from user changes, and off you go. You could even just drop icons on the desktop and set a desktop background with useful instructions.

Believe me, you won't be doing the users or yourself any favors with the flash based monster. I just got finished helping untangle someone else's awful cthulian flash/CGI mess.