Using Wetty for multiple users for web application? - command-line

I'd like to use Wetty on my Django (for exapmle) web application, basically users will be able to run "telegrambot.py" with their own token, settings for the script. So here Wetty should be great for such use case I thought.
Since it's a web application a lot of users should use it, allocating unique port number to each user is not feasible idea I thought.
wetty --port=3001 --command="./telegrambot.py" & # for user A
wetty --port=3002 --command="./telegrambot.py" & # for user B
wetty --port=3003 --command="./telegrambot.py" & # for user C
# and so on, 1000 or 10000 or more of them
I tried something like this also, but this didn't work
wetty --port=3000 --command="./telegrambot.py" --base "usera-token" & # for user A
wetty --port=3000 --command="./telegrambot.py" --base "userb-token" & # for user B
wetty --port=3000 --command="./telegrambot.py" --base "userc-token" & # for user C
# and so on, 1000 or 10000 or more of them
So, what's the best way to use Wetty for (a lot of) multiple users for web application?

Related

Why do I get different data over Local Server?

I use now persistenceMapperWEBAPIClient1 as PersistentMapper with default Uri http://localhost:5000/api/A0_WebApi and default User: a/Password: 123456
While prototyping on Local Server I have saved some data for the same(default) user.
Now I start my application with persistenceMapperWEBAPIClient1 as PersistentMapper, but I get no data. So it seems I access quite different data from prototype and from my application. Is it a thing of prefix perhaps? But I use the same user in both cases
/Efim
That is the answer of Hans:
The turnkey application can either go in prototype mode - then it saves to a xml file named as the model - controlled by App_Data/MDrivenServerOverride.xml
...or it can connect to an MDriverServer in one of two ways:
MDrivenServer is found relative to TurnkeyApp ./__MDrivenServer and user and pwd taken from App_Data/TurnkeySettings.xml
MDrivenServer is found from setting in App_Data/MDrivenServerOverride.xml :
http://localhost:5010/
https://wiki.mdriven.net/index.php/MDrivenServerOverride
/Hans

oracle forms - web config file

We are running an application over oracle forms 11 g .
we are planning to set up 2 web url links in the same web server for different languages. We are looking forward to set up an variable at the web config file or environment config file. And during runtime check the values of this variable and display forms data to the used in the forms. Can you please help me on setting up this variable and how to get this value during runtime? thanks for your valuable time.
You could setup 2 different configurations in the formsweb.cfg. You would have a default.env ( or whatever name you wanted to give ) for each one. When you launch from the web url link, you would define your configuration name ( config=LANG1, config=LANG2 ). Within forms, you can then use get_application_property( CONFIG ) to return to you which language you were in.

Perl: How to retrieve album metadata from MusicBrainz?

I am creating a Perl script which will move a mp3 file to my music folder in format artist/album/mp3file. Now it is possible that some of my mp3 files don't have an album tag so I thought of querying the MusicBrainz database to retrieve album metadata given track title & artist.
I am using WebService::MusicBrainz Perl module for this task, but I am not able to see any method that gives album metadata info. My current code is:
use WebService::MusicBrainz::Track;
my $ws = WebService::MusicBrainz::Track->new();
my $response = $ws->search({ ARTIST => 'Ryan Adams', TITLE => 'when the stars go blue' });
my $track = $response->track();
print $track->title(), " - ", $track->artist()->name(), "\n";
say $track->id();
So, how do I get my the album info for a given track using MusicBrainz and if it is not possible what are my alternative options?
First of all, what you want is adding metadata to mp3s which is the most common usage scenario people have. The "normal" way is to use a Musicbrainz Tagger, open these files there and work with the interface to attach the correct metadata.
The suggested (gui) tool is Musicbrain Picard
I also want to state that the Perl module is using the now deprecated Web Service Version 1 of MusicBrainz.
That Web Service has a couple of problems because it was made for another database scheme than the one used now at MusicBrainz.
However, the current Web Service Version 2 has only a python library available: python-musicbrainzngs.
You can still work with the Perl module, but if you run into "weird" problems, this might be the reason.
This is how the Web Service works in general (and how it should apply directly for the Perl module as a wrapper for this web service):
Your search gives this:
http://musicbrainz.org/ws/1/track/?artist=%22Ryan%20Adams%22&title=%22when%20the%20stars%20go%20blue%22
There you get a list of recordings of this track. These recodings occur on multiple releases (ReleaseList).
You can disregard many of these, as they are of the type "compilation". You probably want the "album" releases.
You probably ask yourself why there are multiple album releases with the same name in the list.
This is because a "release" on MusicBrainz is a combination of a release-event and a couple of mediums.
You might have an US release and a german deluxe edition and so on.
All of these releases are in one "release group".
You probably want the name of this "release group", which mostly is also the name of every release in this group.
You might want to read a bit on how the MusicBrainz Database is structured.
This is only the basic use case of course.
You might run into misspellings in artist/title, multiple or missing album release groups and other things.
However, altogether it should work and you can just drop the "problem" cases in a special directory and work with them in Picard.
Picard also has other means of identifying files per "musical analysis" (PUIDs, Acoustids)
EDIT:
my #tracklist = $response->track_list();
foreach my $track ( #tracklist ) {
print $track->title(), " - ", $track->artist()->name(), "\n";
my #releaselist = $track->release_list();
foreach my $release ( #releaselist ) {
print " ", $release->title(), " - ", $release->type();
}
}
Should work in general, but it doesn't. It gives you all tracks of the response, but somehow it can't extract releases from release_list(). Possibly because the schema changed or because the perl module is broken.
Check out our perl modules for accessing the Cover Art Archive:
http://metacpan.org/pod/Net::CoverArtArchive
More info on our archive is here, including specs:
http://coverartarchive.org/
Good luck!

Export AD structure from specific OU, then re-create structure in new domain

I've researched and found the way to export our active directory information for our application is like this:
csvde -d OU=MyAppsOU,DC=dot,DC=testdmz,DC=lan
-f C:\temp\addump_ou.csv -r (objectClass=organizationalUnit)
Now, I've read that to do an import from that file, you just have to add the -i option to the line like this:
csvde -i -d OU=MyAppsOU-New,DC=dot,DC=newdmz,DC=lan
-f C:\temp\addump_ou.csv -r (objectClass=organizationalUnit)
Obviously, I'm very scared to try this as I don't want to blow away anything. My questions are:
Does specifying the OU=MyAppsOU-New create the new OU structure with that specific name? (I'm just trying to be 100% positive)
Does specifying the different domain name (newdmz) just update all of the data in the file to contain the new domains name?
or
Do I need to modify the exported csv file to change the domain name (testdmz) to what the new domain name will be (newdmz)?
Is there a different way I should be doing this?
I just want to re-create the OU structure without groups, roles (which are groups) and users. I will probably do those in a different process because we have different usernames for test and production.
Wow ! lost of question here, but according to me not enougth.
Begining by the end. CSVE.EXE is really not the exact tool I would use. As a Directorie developper I prefer LDIFDE.EXE, because it generates LDIF (LDAP data Interchange Format) which is more standard and more readable. You can also have a look to tools like ADAMSync.EXE that allow to synchronize two directories in AD world (but it's a big hammer for whant you want to do here)
Now choosing LDIFDE.EXE you will see that LDIF format is almost importable as is, but you nned to remove operational attributes (system attributes) from the file. The best way is to take them during the rxport. So you will use -L to only export the attributes you need or -O option to omit operational attributes.
To import in another domain, you will use -C option to change original domain part (DC=dot,DC=testdmz,DC=lan) by the new domain part.
Try it before in a virtual machine.

Records spanning over multiple lines in graphviz

I am trying to visualize a rather complex structure in the dot language.
Because the record is big, I would like to write the code in mulitple lines. So instead of:
A11[label="A.11 Access Control|{A.11.1 Business requirements for access control|A.11.2 User access management}|{A.11.3 User responsibilities|A.11.4 Network access control}|{A.11.5 Operating System access control|A.11.6 Application & information access control}|A.11.7 Mobile computing & teleworking"];
I would like to enter it somewhat like this
A11[label="A.11 Access Control|
{A.11.1 Business requirements for access control|A.11.2 User access management}|
{A.11.3 User responsibilities|A.11.4 Network access control}|
{A.11.5 Operating System access control|A.11.6 Application & information access control}|
A.11.7 Mobile computing & teleworking"];
Unfortunately the parser for dot complains about a "string running past line end" or something alike. Does anyone know how to denote a linebreak in the code? I tried a \ at the end of the line, but it didn't seem to work.
thanks in advance
I am guessing you want something like this:
graph G{
A11[label="A.11 Access Control|\n\
{A.11.1 Business requirements for access control|A.11.2 User access management}|\n\
{A.11.3 User responsibilities|A.11.4 Network access control}|\n\
{A.11.5 Operating System access control|A.11.6 Application & information access control}|\n\
A.11.7 Mobile computing & teleworking"];
}
You can also do like
label = "line1\n" +
"line2\n" + ...