View Get-AksSupportedVersions
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
$header = @" | |
<style> | |
h1 { | |
font-family: Arial, Helvetica, sans-serif; | |
color: #296940; | |
font-size: 28px; | |
} | |
h2 { | |
font-family: Arial, Helvetica, sans-serif; |
View simplebank-destructible.sol
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
pragma solidity ^0.4.24; | |
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/lifecycle/Destructible.sol"; | |
contract SimpleBank is Destructible { | |
mapping (address => uint) private balances; | |
address public owner; |
View simplebank.sol
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
pragma solidity ^0.4.24; | |
contract SimpleBank { | |
mapping (address => uint) private balances; | |
event LogDepositMade(address accountAddress, uint amount); | |
address public owner; |
View create-bacpac.ps1
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
<# | |
Visual Studio 2015 build creates a dacpac file, but Azure Resource Manager templates can use only bacpac files. | |
This powershell script automates creation of bacpac and publishing to the blob storage. | |
After building the data project, open a command prompt on the folder containing the dacpac file. | |
Copy this script to the same folder. | |
You need : | |
1. Name of the localdb server where the dacpac is published ((localdb)\ProjectsV13) |
View azure-ad-login.js
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
/* | |
Usage : | |
Execute protractor on command line | |
================================== | |
protractor e2e.conf.js --params.url= https://ABCD.azurewebsites.net/ --params.uid=user@ORGANIZATION.onmicrosoft.com --params.pwd=PASSWORD | |
Sample spec file | |
================================== | |
var AzureAdLogin = require('./azure-ad-login'); |
View Search-Splunk-Using-Powershell.ps1
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
$lastDay = ( get-date ).addDays( -1 ).toString( ‘s’ ); | |
$lastHour = ( get-date ).addMinutes( -60 ).toString( ‘s’ ); | |
$searches = @( | |
"ERROR" | |
, "source=""tutorialdata.zip:*"" ERROR" | |
, "CreditDoesNotMatch" | |
,"source=""tutorialdata.zip:.\\www3/access.log"" productId=WC-SH-G04" | |
) |
View transfer_data_between_azure_storage_accounts
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
## Transfer data in Azure Storage Tables from one Azure Storage Account to another | |
## Download and install AzCopy -- https://azure.microsoft.com/en-us/documentation/articles/storage-use-azcopy/ | |
## Get the Preview version of AzCopy in order to access Table Storage. The current stable version works with Blob storage only. | |
## Tables will be created if they don't exist | |
$source_acct = "Source_Azure_Storage_Account_Name" | |
$source_key="Source_Azure_Storage_Account_Key" | |
$destination_acct="Destination_Azure_Storage_Account_Name" | |
$destination_key="Destination_Azure_Storage_Account_Key" |
View ExecuteTwoMethodsOpeningTwoConnections
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
private static void ExecuteTwoMethodsOpeningTwoConnections(string connectionString) | |
{ | |
using(TransactionScope scope = new TransactionScope()) | |
{ | |
ExecuteCommandA(connectionString); | |
ExecuteCommandB(connectionString); | |
Console.WriteLine("Both records are written to database transactionally."); | |
scope.Complete(); | |
} |
View ExecuteSqlTransactionUsingTransactionScope
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
private static void ExecuteSqlTransactionUsingTransactionScope(string connectionString) | |
{ | |
using(TransactionScope scope = new TransactionScope()) | |
{ | |
using (SqlConnection connection = new SqlConnection(connectionString)) | |
{ | |
connection.Open(); | |
SqlCommand command = connection.CreateCommand(); | |
View ExecuteSqlTransaction
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
private static void ExecuteSqlTransaction(string connectionString) | |
{ | |
using (SqlConnection connection = new SqlConnection(connectionString)) | |
{ | |
connection.Open(); | |
SqlCommand command = connection.CreateCommand(); | |
SqlTransaction transaction; | |
NewerOlder