routing audio through pulseaudio to a flash app running on remote machine - qemu

I have multiple VMs running on qemu-kvm. I want to send audio output from each VM to its respective remote user. I want to run flash on the remote machine for this purpose.
I came across pulse audio in this regard. pulse audio can take a source and route it to a sink. I am unable to achieve this right now.
I want to understand how exactly i can take my VMs as source and send that audio to their respective remote sinks.

Take a look at the output of qemu-kvm --audio-help.
The section on pulseaudio looks something like this:
Name: pa
...
Options:
...
QEMU_PA_SOURCE: string, default = (not set)
QEMU_PA_SINK: string, default = (not set)
You should be able to set the environment variable QEMU_PA_SINK before running qemu to define the sink that the audio stream of the virtual machine should be routed to.

Related

i would like to auto detect the environment and set the appropriate variables

I have the same web application running on 2 different servers. It also runs on 2 different servers. Each of environment have its own database.
The file config.json contains every database informations.
Developement environment: The app.js and database/db.js files, are calling a file getConf which retrieves config.json informations with preprod object.
Production: I update the retrieved object from preprod to prod.
Call:
// Pre-production
var config = require('./database/getConf').preprod
// Production
var config = require('./database/getConf').prod
I would like to do this automatically, which means, to update to production environment, I don't have to update any files. Just a copy paste from the dev but it detect automatically the environment and set the appropriate database.
I tried many modules like nconf, dotconf, and config but they all required to select the environment in the command line before launching the app.
But my 2 apps are running in two different IIS servers in my company and they're launched from IIS and not from the command line.
I hope doing just a copy paste of the hole project folder from thedev to the prod.
According to the documentation, you can find out pretty much every thing you need to know about the system with the module os.
If you're looking for the CPU architecture : os.arch().
If you're looking for which type of OS : os.type().
Hope it can help you ^^.

How to convert elastic beanstalk classic load balancer to application load balancer on a running application?

I have several EB applications that I would like to convert from a classic to an application load balancer. In the documentation it seems that the default way is to create a new environment from scratch with the proper load balancer. Considering that I have many environment variables and several environments, I would prefer not to have to rebuild applications. Is there a way to switch out the load balancer on an already running application?
It is not possible to set a a load balancer type except at creation time. You can use elastic beanstalk cli and aws cli to clone the application with the same config and version. To get the deployed application version run:
aws elasticbeanstalk describe-environments --application-name ${APPLICATION_NAME} --environment-names ${SRC_ENV_NAME} | jq -r '.Environments | .[] | .VersionLabel'
The jq pipe filters out the rest of the json blob.
After that, you can save the config of the curent appication using:
eb config save $SRC_ENV_NAME --cfg "${SRC_ENV_NAME}_save"
Then create an application clone using:
eb create $NEW_ENV_NAME --elb-type application --cfg "${SRC_ENV_NAME}_save" --version $APP_VERSION
Where APP_VERSION is the string extracted in step one.
It is not simple, but it can be done.
If the Envivornment name is important to you, it gets a little trickier.
Here is it how it should go, step by step (using the web console):
Save the configuration of the Environment you want to change
From the Saved config, generate a new Env (select Customize settings)
2.1) Change the LB type to Application and fill out all the necessary info for this
Swap the URLs from the original env to the new one (check if everything is working with the new env, if not swap back)
[STEPS ONLY NECESSARY IF ENV NAME IS IMPORTANT]
Delete the original env (which now is not receiving traffic and has a Classic LB)
Wait until the original name disappears from the console (it make take a couple of hours)
Clone the production env, and give the new env the original env name
Swap URLs
Done!

How to run local program (exe) via Chrome via HTML/javascript

I am trying to build a (single page) local portal in Chrome that opens several things.
The problem is we want to run a local executable via a button on a (local) webpage. Is this possible?
The second thing is that i want to do is to run a .pps file directly in the powerpoint viewer.
I can control to the startup of chrome, so i can access local files.
All things i tried so far only made the file(s) to download, not to run.
Can somebody help me how i get this done?
You can set a protocol like myapp://launch/activity or the like to automatically launch your app by setting up a registry key in HKEY_CLASSES_ROOT with the name of your protocol and the action it should take.
There is a MSDN article showing the following example of a registry for an alert protocol:
HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "alert.exe,1"
shell
open
command
(Default) = "C:\Program Files\Alert\alert.exe" "%1"
Which would then be called by requesting a url with alert:YOURPARAMS, which would then call alert.exe YOURPARAMS.

Adobe Air Android Debug

I am using Flash Builder 4.6 to develop an Android game using Air. When I debug on PC it works fine, however when I plug in my Android phone and attempt to debug, I get an error with the location of a db file.
This is what I presently have the location set to:
private static var DefaultDB:File = File.applicationDirectory.resolvePath("com/arakaron/Assets/Database/DefaultDb.db");
What / where should I be setting it to? It seems that when I debug the app, nothing gets transferred to the phone as I can't find any Arakaron resources on the phone.
Any help would be great.
Thanks.
You can't access the DB in this way.
Please use below code.
File.applicationStorageDirectory.resolvePath("DefaultDb.db");
Your db has to be within the application storage. If you want to have inside the folder then you define the folder name like below:
File.applicationStorageDirectory.resolvePath("db\DefaultDb.db");
The File.applicationDirectory on Android refers to your application and assets. On Android this is contained packaged in your APK and assets are decompressed in memory by the OS when you access them. You shouldn't use this directory unless you are reading assets from your package. Assets in this directory can only be accessed via a url and won't have a nativePath property.
Most likely you should use the File.applicationStorageDirectory or if the files can be safely deleted without breaking the operation of your application you should use the File.cacheDirectory.
You can read more on these locations: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html
If you package a database with your application you should use the File copy process to copy the file to one of the above locations before attempting to access it as a database.

Would it be possible to make a web/application server locally?

A little bit of background: I am trying to create a Google Chrome that will play videos in your browser locally. Meaning it should be able to play without an Internet connection. Since I'm only using HTML/Javascript, I can only play webm, mp4, and ogg files. However, I am interested in playing other formats, such as AVI, MPG, and maybe a few others. I was thinking of creating a local server somehow where I can run ffmpeg to encode the videos to webm/mp4. So my main objective is to get ffmpeg to run. Is this possible?
Not just using html5 and javascript. If you have the option of running a local webserver than you can run any executable you want, including ffmpeg. You'll basically be calling a server side process (using php, java, or whatever) which happens to be running locally.
Download FFMPEG.EXE from here
Extract the FFMPEG.EXE from the archive.
Place the FFMPEG.EXE in the webdirectory.
As you all know how to upload a file (So i'm moving to the next step).
After the file uploaded just put the below line
exec("ffmpeg -i recipe_videos/$path -f flv recipe_videos/$test[0].flv");
//Format exec("ffmpeg -i pathofthevideouploaded -f towhichformat wherethefiletobesavedwithextension");
If you want delete the old file.
Now you can view the video in the desired format.
What you're trying to do is impossible. The browser prevents the server from accessing the user's computer (including running programs). You'll either need to transcode the videos on the server before serving them or have the user download FFmpeg and transcode the videos themselves.