Skip to content

Instantly share code, notes, and snippets.

View techiesathya's full-sized avatar

Sathya Prakash.G techiesathya

View GitHub Profile
@techiesathya
techiesathya / xamarin.mac.authentication.cs
Created March 5, 2020 11:54
Code snippet for xamarin.mac AAD authentication.
public async System.Threading.Tasks.Task authenticateAsync()
{
string[] scopes = new string[] { "user.read" };
var app = PublicClientApplicationBuilder.Create("ClientID")
.WithRedirectUri("redirect url")
.WithAuthority(AzureCloudInstance.AzurePublic, "tenant id")
.Build();
var accounts = await app.GetAccountsAsync();
AuthenticationResult result;
@techiesathya
techiesathya / ask.bash
Last active February 29, 2020 11:40
Commands for Creating and managing the AKS and ACS
#Command to tag the docker image. This is required before pushing the image into the ACS
docker tag mongodbcore:latest acskubesg.azurecr.io/mongodbcore:v1.2
#This is for loging into the ACS. This is required before pushing the images into the ACR
az acr login --name "ACSKUBESG"
#This is for getting the service principle set up for the AKS
az aks get-crediantials --resource-group RG_KUBE_SG --name AKSKUBESG
#Command to push an image into acs
import requests
import json
url = "http://xx.xx.xx.xx/occm/api"
email=raw_input("email: ")
password=raw_input("password: ")
headers = {
'content-type': "application/json",
@techiesathya
techiesathya / gist:35050d52e31f25540641bdba8b74b619
Created January 14, 2019 12:06
Resetting system password in Oracle xe
set ORACLE_SIT=XE
sqlplus / as sysdba
alter user <username> identified by <password>;
@techiesathya
techiesathya / ubuntu_docker.sh
Created June 17, 2017 16:29
Installing docker in Ubuntu
# Command to add GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Command to add docker repository to APT source
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# Update package database
sudo apt-get update
# Command to install from Docker repo instead of Ubuntu repo
@techiesathya
techiesathya / elk_docker.sh
Last active June 17, 2017 16:06
Commands for setting up ELK stack in docker
# Command to pull elastic search docker container.
docker pull elastic search
# Create a directory esdata
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -v /esdata:/usr/share/elasticsearch/data elasticsearch
@techiesathya
techiesathya / docker
Last active June 10, 2017 22:37
Docker commands
sudo docker ps
sudo docker ps -a
sudo docker pull <<image name>>:<<versionname>>
sudo docker commit <<oldcontainername>> <<newcontainername>>