Skip to content

Instantly share code, notes, and snippets.

Sumit Kumar sumitsaiwal

Block or report user

Report or block sumitsaiwal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sumitsaiwal
sumitsaiwal / vsts_build_retain
Last active Aug 16, 2018
Retain VSTS build indefinitely
View vsts_build_retain
#import-module "Microsoft.TeamFoundation.DistributedTask.Task.Common"
$uri = "$($env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$env:SYSTEM_TEAMPROJECT/_apis/build/builds/$($env:BUILD_BUILDID)?api-version=2.0"
Write-Verbose "URI: $uri"
$body = "{keepForever:true}"
$result = Invoke-RestMethod -Uri $uri -Method Patch -ContentType "application/json" -Headers @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"} -Body $body
Write-Output "RESULT: $result"
View Container to GUI
Driver Support Required:
1. Display
2. 3D hardware acceleration support
3. Audio
4. Webcam
5. Video-game controller
http://somatorio.org/en/post/running-gui-apps-with-docker/
https://blog.qmo.io/the-perfect-media-server-with-docker-plex-and-automatic-bittorrent/
@sumitsaiwal
sumitsaiwal / aws_ebs_volume_k8s
Created Jul 28, 2018
AWS EBS Volumes in Kubernetes
View aws_ebs_volume_k8s
containers:
- name: APP_NAME
image: "DOCKER_IMAGE_NAME"
ports:
- name: http
containerPort: 3000
volumeMounts:
- name: share
mountPath: /var/lib/
volumes:
@sumitsaiwal
sumitsaiwal / Docker for Windows: Shared Drives Issue.md
Last active Jun 26, 2019
Docker for Windows: Shared Drives Issue
View Docker for Windows: Shared Drives Issue.md
Get-NetConnectionProfile
Set-NetConnectionProfile -InterfaceAlias "vEthernet (DockerNAT)" -NetworkCategory Private
##keep this running for Decryption
while ($true)
{
   if ($(Get-SmbServerConfiguration).EncryptData)
View connection_proxy
## ssh connection behind proxy, requires netcat(nc) installed
ssh USER@FINAL_DEST -o "ProxyCommand=nc -X connect -x PROXYHOST:PROXYPORT %h %p"
@sumitsaiwal
sumitsaiwal / introrx.md
Created Feb 5, 2018 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@sumitsaiwal
sumitsaiwal / MoveAzureResouces2diffRG.ps1
Created Feb 2, 2018
Moving Azure resources from one RG to another.
View MoveAzureResouces2diffRG.ps1
#Login
Login-AzureRmAccount
#Variables
$sourceRG = Read-Host 'sourceRG' #Name of source Resource Group
$destinationRG = Read-Host 'destinationRG' #Name of destinatino Resource Group
$Subscription = Read-Host 'SubscriptionName' #Name of Subscription
#Get resources
Select-AzureRmSubscription -SubscriptionName $Subscription
@sumitsaiwal
sumitsaiwal / MoveResourceToDiffAzureSubscription.ps1
Created Feb 1, 2018
Moving Azure resources from one Subscription's resource group to another Subscriptions's resource group
View MoveResourceToDiffAzureSubscription.ps1
#Login
Login-AzureRmAccount
#Variables
$oldSubscription = Read-Host 'oldSubscriptionID' #Name of source susbcription
$newSubscription = Read-Host 'newSubscriptionID' #Name of destination subscription
$sourceRG = Read-Host 'sourceRG' #Name of ource Resource Group
$destinationRG = Read-Host 'destinationRG' #Name of destinatino Resource Group
#Get resources
@sumitsaiwal
sumitsaiwal / openssl cert azure vpn.md
Last active Jan 31, 2018
openssl certs for azure VPN
View openssl cert azure vpn.md

The sole dependency is a build of openssl for your platform. Without further due, our first step is to provide Azure with a certificate that will be used to sign client certificates. We call this the root certificate and by importing it to Azure we trust certificates signed by it. Most of the following commands will ask you to guard the output files with a passphrase, leave them empty until you have a working solution, then follow the guide again and add strong passwords when you’re asked to.

Generate CARoot private key

openssl genrsa -aes256 -out MyAzureVPN.key 2048

Generate a CARoot certificate valid for 10 years

openssl req -x509 -sha256 -new -key MyAzureVPN.key -out MyAzureVPN.cer -days 3650 -subj /CN=”MyAzureVPN”

In Azure portal navigate to “Virtual Networks/Manage Certificates/Upload” and import MyAzureVPN.cer. Next we create client certificates by issuing the bellow

Generate a certificate request

@sumitsaiwal
sumitsaiwal / Install Docker
Last active Oct 8, 2018
Docker installation for Ubuntu 16.04
View Install Docker
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
#sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install -y docker-engine
#sudo apt-cache policy docker-engine
#sudo apt-get install -y docker-engine=1.13.1-0~ubuntu-xenial
sudo service docker start
You can’t perform that action at this time.