Where to read the source code of azure vm serial console? - azure

I want to apply serial console function to my own application, like clicking a button then it will pop out a serial console of the vm, so need to read the source code to know how to mock the request, the sdk can't meet my request.There are many open source repo from azure in github, I'm not clear which one is the right one.Looking forward to the reply, thx!

Related

Pop up an alert when someone tries to check out a project that is already checked out by someone else

I want to pop up an alert when someone tries to check out a project/file that is already checked out by someone else on TFS, Visual Studio 2012.
Let's say I checked out a file and let others to check out but prevent from check in. When someone else tried to check out same file, pop up should inform them about my checkout, but they can still checkout and try some changes. I searched the web but couldn't find a solution for that.
I know we can look for current checkouts form VS console with tf status command, but I'm looking for something visual when they tried to check out.
One way to achieve this is to use a version control system such as Git or TFS (Team Foundation Server) that supports file locking. In TFS, you can use the "tf lock" command to lock a file so that only you can check it out. When someone else tries to check out the locked file, they will receive an error message telling them that the file is locked.
Another way is to create a script or program that periodically checks the status of the files in the repository and displays a pop-up message if a file is already checked out by someone else. This script can be run on the client side as a background process or on the server side as a service.
You can use the TFS API to check for check-out status and trigger the alert accordingly.
It's also worth noting that some integrated development environments (IDEs) such as Visual Studio have built-in functionality for displaying file lock status, so you may want to check if the functionality is available in your chosen IDE before implementing a custom solution.

Listen for linux command in a Qt app running in background?

I wonder if there is a way to send data from an OS command (Linux to begin with, but I would be interested about Windows too) to a Qt app working in background.
My use case would be to right click in a context menu in a file explorer and then send the path of the selected file(s) to the already running Qt app to trigger an action inside that app.
Can anyone provide some explanations or a link to an example achieving that ?
I already read about adding right click in Nemo/Nautilus with some custom config files, I am more interested by the Qt part.
AFAIK, there is no such component available with QT. (Don't know if anything added recently, I haven't used qt from long time)
But what you can do is write some code in qt app like server ( May be socket server OR pipe), when some data comes on that you can take action based on that data value.
On other side write some small utility which will get called, which send data to you server, with path of selected file when clicked via context menu.

How can I download the Azure Bot source code in Python?

Via the link below I know it is possible to create a Web App Bot in Python and to deploy it. At the moment I have a created a bot remotely in Azure using QnA Maker, and I was hoping to download the source code in Python and build some feature locally and deploy it afterwards. I am currently stuck at this, because the download source code options only lets me download the source code in C#. In Configuration -> General settings -> Stack settings, I changed the Stack to Python already, but this seems to have no effect. Thus I have 2 questions:
How can I download the bot's source code in Python?
If the Stack setting did not change the source code, what is this setting's purpose?
Please let me know whether I need to change/add something to this question and/or problem statement. Thanks a lot!
link: https://learn.microsoft.com/en-us/azure/bot-service/python/bot-builder-python-quickstart?view=azure-bot-service-4.0
You can't download python source code off azure, because there are no templates on Azure for python. The only templates that exist are node and C#. When you clicked the 'Create a bot' on Azure, there is a setting in the creation blade that shows what language to create your bot in:
I'm not sure how you're downloading your source code, as when I got to my bots to get the code, there isn't an option to change my language, only a prompt asking if I want my app settings and keys.
The bot framework samples repo has a sample QnA bot here. You can add your qna keys into this bot, test locally and deploy from local up to azure. But there is no way to pull 'source code' in python from azure.

How could I prohibit anonymous access to my NodeRed UI Dashboard on IBM Cloud(Bluemix)?

I'm working with node-red, on boilerplate IBM cloud. I know that there is a way, changing the value of enviroments variables(NODE_RED_USERNAME and NODE_RED_PASSWORD), to change username and password of the editor flow. But, what about UI dashboard? I mean using dashboard nodes. Forbid access to
https://noderedservicename.mybluemix.net/ui/
I know that on the code, changing the variable httpNodeAuth on the file settings.js I can do what I want. What is the way for doing that on IBM Cloud?
Thank you in advance!
You need to add the httpNodeAuth (not the httpAdminAuth as this is for controlling access to the Node-RED editor and can done with the environment variables discussed in the other answer.) to the app/bluemix-settings.js file.
Something like this:
...
httpStatic: path.join(__dirname,"public"),
httpNodeAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},
functionGlobalContext: { },
...
Details of how to generate the pass can be found here
There are a number of ways you can edit the file, some of which include linking the Node-RED deployment to a git repository or downloading the whole app, editing the file and pushing it back to Bluemix (when you first deploy Node-RED from the starter pack it gives you instructions on how to download the source to make changes and then push them back. You can get to these instructions by clicking on the "Getting started" link in your Node-RED Bluemix console page).
But the quickest/simplest/dirtiest way is probably to just SSH into the instance and change the file with something like vi. Details on how to ssh to an app instance can be found here. But the following should work:
cf ssh [app name]
Once you have edited the file you will need to tell bluemix to restart the app. You can do this from the web console or with the cf command line tool.
(The changes made by this method will not survive if the app is restaged, or bluemix decides to move your instance to another machine internally because it will rebuild the app from the pushed sources. The permanent solution is to download the source, edit and push back)
This link will help you but it's written in Japanese.
http://dotnsf.blog.jp/archives/1030376575.html
Summary
You can define the "user-defined" environment variables through the IBM Cloud dashboard.
It contains the variables to protect Node-RED GUI.
You have to be set as follows
NODE_RED_USERNAME : username
NODE_RED_PASSWORD : password

UWP Push notification stop working if built from another machine

I am implementing push notifications in our Xamarin.Forms application.
What I have followed is this documentation: https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started-push
Android and iOS are working perfectly as intended, my problem is with the UWP Push notification.
I have used Visual Studio to associate the application with the store, and I took the Package SID and the Application Secret and added them to the Notification hub in Azure like shown in the documentation linked above. I tried to run the application, and I was able to receive the notification. Perfect!
Problem that my team and myself faced is the next: When one of my colleagues pulled the source code to test it, the notification was never received. Even when we install the application from our build server the same problem is faced.
Why does the notification stop working when built from another machine than mine, and how to fix it so that it will keep working when built from any other machine?
The problem turned out to be simple, steps I taken to fix the problem are the next:
After associating the application and reserve it in the windows store, I got a publisher name: CN=********-****-****-****-************, in Visual Studio, I right clicked on the:
UWP Project -> Application -> Package Manifest -> Packaging,
and you can find the publisher name right to the Publisher label, and right next to that there's a Choose Certificate... button. I clicked it and chose Configure Certificate drop down list and clicked on Create Test Certificate.
Three text boxes should be entered, publisher common name, and password and its confirmation. Inside the Publisher Common Name I entered the ********-****-****-****-************ without the CN= and entered my password. After creating the certificate I installed it on others laptops that needs to build the application and notification was working after.

Resources