Posted on

raspberry: i comandi che non ricordo

Riavvio

sudo shutdown -r now

oppure

sudo reboot

Spegnimento

sudo shutdown -h now

oppure

sudo halt

Lancio di un comando (sh)

Andare nella cartella in cui si trova il file sh (es. comando.sh) e digitare

.\comando.sh

Lancio di un comando da ssh che rimanga in esecuzione dopo la chiusura

Dopo aver lanciato un comando con il metodo precedente, chiudendo ssh, termineremo il comando lanciato. Se si desidera che il comando sia persistente bisogna lanciarlo in questo modo :

.\comando.sh & disown

 

Posted on

Authentication Developing for Azure Media Services

After creation of your Azure Media Service (AMS) Account (Create a Media Services account using the Azure portal) you need to authenticate your application that your are developing , to manage your video and streaming channels.


Developing with .net

In this article we are using .net framework to develop an app, but the information should be valid for all languages.

To develop an application with .net frameeork, you need to install, via nuget , the package windowsazure.mediaservices.extensions with its derived packages.


You can authenticate in one of two ways :

User authentication

Authenticates a person who is using the app to interact with Azure Media Services resources. The interactive application should first prompt the user for credentials.

For this authentication your app needs two strings :

Azure AD tenant  (“tenant” in example) :  In Azure portal, select your AMS and  select, on the left menu, api page. In the table at the bottom of the page one of the fields is “Domain Tenant ADD”.

Endpoint API REST (“endpoint” in example) : you can read this information directly in main page of your AMS on the right at the top of the page. Should be something like this :

https://yourams.restv2.yourlocation.media.azure.net/api/

In your application you have to write this code :

var tokenCredentials = new AzureAdTokenCredentials(tenant, AzureEnvironments.AzureCloudEnvironment);
var tokenProvider = new AzureAdTokenProvider(tokenCredentials);
_context = new CloudMediaContext(new Uri(endpoint), tokenProvider);

Running the application you should automatically see the Microsoft user credentials form

 

Service principal authentication

Authenticates a service, a specific app, without user interaction. To use this authenticaton in your app, you need four strings :

Azure AD tenant  (“tenant” in example) : As above

Endpoint API REST (“endpoint” in example) : As above

Client ID (“clientid” in example) : Enter in azure portal and look for “applications”. Add new application. After creation, in properties, at the top of the page, you can find the “application ID”.

Client Secret (“secretid” in example): in your AMS select the API page. In the middle of page you can find a little form with two fields. In the first field you ha to select the application created before. Use the second field to create the client secret.

In your application you have to write this code :

AzureAdTokenCredentials tokenCredentials =
new AzureAdTokenCredentials(tenant,
new AzureAdClientSymmetricKey(_clientid, _secreteid),
AzureEnvironments.AzureCloudEnvironment);

var tokenProvider = new AzureAdTokenProvider(tokenCredentials);

_context = new CloudMediaContext(new Uri(endpoint), tokenProvider);

 

Posted on

Schermo nero con obs studio

Problema

utilizzate un portatile con Windows 10, tramite obs studio volete catturare lo schermo ma questo è completamente nero.

Soluzione

  • Lanciate il programma Impostazioni. Nella ricerca in alto cercate Impostazioni Grafica (o Grafica).
  • Nella schermata che vi appare, mantenete la configurazione “App Classica”.
  • Spingete “Sfoglia” e cercate l’eseguibile di Obs Studio, che dovrebbe essere in “C:\Program Files\obs-studio\bin\64bit\obs64.exe”
  • Selezionate “Risparmio Energia”
  • Riaprite OBS.