Thursday, May 28, 2020

Running chrome with CORS disabled

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp

Thursday, May 14, 2020

Example of dockerfile and how to bake in locally.

FROM mcr.microsoft.com/dotnet/core/sdk:3.1

Add bin/Debug/netcoreapp3.1/publish /var/foo/bin
WORKDIR /var/foo/bin

EXPOSE 5000/tcp
ENV ASPNETCORE_URLS http://*:5000

ENTRYPOINT ["dotnet", "Company.Project.dll"]

To bake in solution file folder run

dotnet publish

In *.csproj folder run

docker build -t testingdocker .
docker run -lt testingdocker --entrypoint bin/bash


Notice that there is a dot (.)

Monday, May 11, 2020

AZ and kubectl commands to save a day

kubectl commands run in a context of Azure account. On a fresh machine, one needs to first install az command line and login to azure, with an azure username (in many companies it is a sys account).

az login

when you run

az account show

You should see something similar to:

{ "environmentName": "AzureCloud", "homeTenantId": "ced47777-d73a-4514-a74d-63af7885ff7d", "id": "a75c7777-66c1-4373-a0f3-859abaefcccc", "isDefault": true, "managedByTenants": [], "name": "Company - Development - DEV", "state": "Enabled", "tenantId": "ccc47db0-d73a-4514-a74d-63af7885ff7d", "user": { "name": "ME@mycompany.com", "type": "user" } }

name property is important because it is an active subscription against which kubectl commands will run. You can change it by running:

az account set --subscription "Company - Production - LIVE"

you can pull resource group to be able to manage it, by running:

az aks get-credentials --name platform-aks-dev-ne --resource-group platform-aks-dev-rg-ne

now you are able to manage all pods, by running:

kubectl get pods

or

kubectl get pods -n foo-dev

where foo-dev is a namespace. To get all events you can run

kubectl get events --namespace foo-dev