This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Script to migrate all local devices between balenaCloud environments. Steps: | |
# 1. Scan for devices (Needs balenaCLI to be installed) | |
# 2. SSH into devices and convert all devices to development OS variant | |
# 3. Once complete, migrate devices to new target environement using balena join | |
# 4. Shows migrated devices in the new target fleet | |
# 5. Optionally you can convert all devices back to production OS variant after migration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@1001010:~# balena run --rm -v /var/run/balena.sock:/var/run/docker.sock pipex/balena-supervisor-stateUnable to find image 'pipex/balena-supervisor-state:latest' locally | |
latest: Pulling from pipex/balena-supervisor-state | |
420c7481a3a7: Pull complete | |
6279047160f4: Pull complete | |
538d61d4028e: Pull complete | |
21d08e06a2b7: Pull complete | |
2f745c6a8f20: Pull complete | |
b7958bee29b4: Pull complete | |
78b756b12246: Pull complete | |
5abcbdc58660: Pull complete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@1001010:~# balena run --rm -v /var/run/balena.sock:/var/run/docker.sock pipex/balena-supervisor-state | |
Unable to find image 'pipex/balena-supervisor-state:latest' locally | |
latest: Pulling from pipex/balena-supervisor-state | |
420c7481a3a7: Pull complete | |
6279047160f4: Pull complete | |
538d61d4028e: Pull complete | |
21d08e06a2b7: Pull complete | |
2f745c6a8f20: Pull complete | |
b7958bee29b4: Pull complete | |
78b756b12246: Pull complete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div class="container"><button class="immersive-reader-button" data-button-style="iconAndText data-locale="en"></button> | |
<h1 id="ir-title">Vipul Gupta's Immersive Reader Demo</h1> | |
<div id="ir-content" lang="en-us"> | |
<h2>What is Serverless?</h2> | |
<p> | |
Serverless computing is a cloud computing execution model in which the cloud provider runs the server, and | |
dynamically manages the allocation of machine resources. Pricing is based on the actual amount of resources | |
consumed by an application, rather than on pre-purchased units of capacity or bandwidth. | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8" /> | |
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Vipul's Immersive Reader</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> | |
<!-- A polyfill for Promise is needed for IE11 support.--> | |
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tokenGetOverHereandLaunch() { | |
fetch(tokenURL, { credentials: `include`, cache: "no-store" }) | |
.then(response => response.json()) | |
.then(body => { | |
// https://docs.microsoft.com/en-us/azure/cognitive-services/immersive-reader/reference#chunk | |
const data = { | |
chunks: [{ | |
content: htmlContent, | |
lang: "en-us", | |
mimeType: "text/html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Making a request to get the token with access to the .env file we created back in step 2 | |
// One can wrap this into a route/endpoint for the frontend to query before starting the Immersive Reader resource | |
// router.get('/GetTokenAndSubdomain', function(req, res) { | |
request.post({ | |
headers: { 'content-type': 'application/x-www-form-urlencoded' }, | |
url: `https://login.windows.net/${process.env.TENANT_ID}/oauth2/token`, | |
form: { | |
grant_type: 'client_credentials', | |
client_id: process.env.CLIENT_ID, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create-ImmersiveReaderResource | |
-SubscriptionName 'MyOrganizationSubscriptionName' [1] | |
-ResourceName 'MyOrganizationImmersiveReader' [0] | |
-ResourceSubdomain 'MyOrganizationImmersiveReader' [0] | |
-ResourceSKU 'S0' [0] | |
-ResourceLocation 'westus2' [0] | |
-ResourceGroupName 'MyResourceGroupName' [2] | |
-ResourceGroupLocation 'westus2' [2] | |
-AADAppDisplayName 'MyOrganizationImmersiveReaderAADApp' [3] | |
-AADAppIdentifierUri 'https://MyOrganizationImmersiveReaderAADApp' [3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repoUrl: "https://github.com/balena-io-playground/balena-webdriverio" | |
tarballUrl: "https://github.com/balena-io-playground/balena-webdriverio/archive/master.tar.gz" | |
applicationConfigVariables: | |
- RESIN_HOST_CONFIG_gpu_mem: 128 | |
applicationEnvironmentVariables: | |
- CONFIG_MODE: 0 | |
- CUSTOM_VALUE: my_value | |
defaultDeviceType: 'fincm3' |
NewerOlder