Skip to content

Instantly share code, notes, and snippets.

View YidingZhou's full-sized avatar

Yiding Zhou YidingZhou

  • Microsoft Corporation
  • Redmond, WA
View GitHub Profile
<!DOCTYPE html>
<html>
<body onload="myFunction()">
Bing loader...
<div id='log'></div>
<script>
function myFunction() {
var urls = [
"http://www.bing.com/news?q=Midwest+US+News",
"http://www.bing.com/news?q=West+US+News",
[config]
BaseVmVhd=https://mdcsimageeastus2762.blob.core.windows.net/system/Microsoft.Compute/Images/mytemplate/t-osDisk.44acc251-d165-47f9-9d04-c3b37f537a9e.vhd
ClusterVmVhdContainer=https://mdcsimageeastus2762.blob.core.windows.net/mdcspip5vhdcontainers/
Region=eastus
ClusterName=mdcspip5
NumberWorkers=3
ClientVmSize=Standard_D2
MJSVmSize=Standard_D2
WorkerVmSize=Standard_D2
VmUsername=azureuser
function Select-TextItem($options)
{
[int]$optionPrefix = 1
# Create menu list
foreach ($option in $options)
{
Write-Host ("{0,3}: {2} - {1}" -f $optionPrefix,$option.SubscriptionName, $option.SubscriptionId)
$optionPrefix++
}
Write-Host ("{0,3}: {1}" -f 0,"To cancel")
cd $TEMP
PATH=/root/bin:$PATH
fullname=$1
inputsaskey=$2
resourcesaskey=$3
outputsaskey=$4
extension="${fullname##*.}"
filename="${fullname%.*}"
python /root/blobxfer.py --saskey $inputsaskey --download tr22batch input . --remoteresource $fullname
python /root/blobxfer.py --saskey $resourcesaskey --download tr22batch resource . --remoteresource microsoft.png
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
bash -c 'echo deb https://apt.dockerproject.org/repo ubuntu-trusty main >> /etc/apt/sources.list.d/docker.list'
apt-get update -y
apt-get purge -y lxc-docker
apt-cache policy docker-engine
apt-get update -y
apt-get install -y linux-image-extra-$(uname -r)
apt-get install -y docker-engine
$rg = Get-AzureRmResourceGroup -ResourceGroupName $Args[0]
$scriptblock = {
Param($profile, $rgname, $name)
echo ("launch starting job for - " + $name)
Select-AzureRMProfile -Path $profile
Start-AzureRmVM -ResourceGroupName $rgname -Name $name
}
if($rg -eq $null) {
$rg = Get-AzureRmResourceGroup -ResourceGroupName $Args[0]
$scriptblock = {
Param($profile, $rgname, $name)
echo ("launch stopping job for - " + $name)
Select-AzureRMProfile -Path $profile
Stop-AzureRmVM -ResourceGroupName $rgname -Name $name -Force
}
if($rg -eq $null) {
function SetContext() {
# Test azurerm moduel
if((get-module -ListAvailable -Name azurerm).count -eq 0) {
echo "installing azurerm module"
install-module -Force -Name azurerm
install-azurerm
} else {
echo "azurerm module ready"
}
function SetContext() {
# Test azurerm moduel
if((get-module -ListAvailable -Name azurerm).count -eq 0) {
echo "installing azurerm module"
install-module -Force -Name azurerm
install-azurerm
} else {
echo "azurerm module ready"
}
@YidingZhou
YidingZhou / slurmdemo.setup.sh
Last active August 29, 2015 14:23
slurm demo setup script
#!/bin/bash
# This script can be downloaded from https://aka.ms/slurmdemo
#
# About this demo
#
# This demo shows how to run parametric sweep job in a SLURM cluster,
# install software, scan storage container for input, submit job/task,
# and run image conversion tasks on compute nodes.
#
# Pre-requisite