The content from this article has been moved to a happier home on our official documentation site - please update your bookmarks.
# Based on https://github.com/PrakashTrove/AWS-CodeBuild-NetCore/blob/master/buildspec.yml | |
# AWS CodeBuild spec to run Entity Framework migrations before a deployment | |
# In order to AWS CodeBuild has access to RDS, I had to manually setup a Inbound rule: | |
# https://ctoasaservice.org/2019/01/23/aws-codebuild-and-access-to-rds/ | |
version: 0.2 | |
phases: | |
install: | |
runtime-versions: | |
dotnet: latest |
const { CredentialProviderChain } = require('aws-sdk'); | |
const AWS = require('aws-sdk'); | |
const accountProvider = require('./account-provider'); | |
let getEnv = function(accountId) { | |
// TODO: insert logic to get your desired profile name | |
return profileName; | |
}; | |
let getProvider = async (accountId, mode) => { |
public static class DapperExtensions | |
{ | |
private static readonly IEnumerable<TimeSpan> RetryTimes = new[] | |
{ | |
TimeSpan.FromSeconds(1), | |
TimeSpan.FromSeconds(2), | |
TimeSpan.FromSeconds(3) | |
}; | |
private static readonly AsyncRetryPolicy RetryPolicy = Policy |
// Note: The official .net SDK is in progress. It doesn't support streaming Speech to Text at the time of writing, | |
// but it will soon. Please check it out before using this code. | |
// | |
// https://github.com/watson-developer-cloud/dotnet-standard-sdk | |
using System; | |
using System.Net.WebSockets; | |
using System.Net; | |
using System.Runtime.Serialization.Json; | |
using System.Threading; |
The content from this GIST has been moved to official Azure Cache for Redis Documentation. The new location is https://docs.microsoft.com/azure/azure-cache-for-redis/cache-troubleshoot-client
Please update your bookmarks.
The CLR ThreadPool has two types of threads - "Worker" and "I/O Completion Port" (aka IOCP) threads.
- Worker threads are used when for things like processing
Task.Run(…)
orThreadPool.QueueUserWorkItem(…)
methods. These threads are also used by various components in the CLR when work needs to happen on a background thread. - IOCP threads are used when asynchronous IO happens (e.g. reading from the network).
The thread pool provides new worker threads or I/O completion threads on demand (without any throttling) until it reaches the "Minimum" setting for each type of thread. By default, the minimum number of threads is set to the number of processors on a system.
Once the number of existing (busy) threads hits the "minimum" number of threads, the ThreadPool will throttle the rate at which is injects new threads to one thread per 500 milliseconds. This means that if your system gets a burst of work needing an IOCP thread, it will proces
namespace OrleansHostingUtilities | |
open System | |
open Orleans.Runtime.Configuration | |
open Orleans.Runtime | |
open System.Reflection | |
open System.Globalization | |
open System.Threading | |
open System.Net |
server { | |
listen 443; | |
server_name example.com; | |
error_log /var/log/nginx/example_com_error.log warn; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/your.crt; #certificate chains | |
ssl_certificate_key /etc/nginx/ssl/your.key; #private key | |
$subnetName = $OctopusParameters["Azure Subnet Name"] | |
$virtualNetworkName = $OctopusParameters["Azure Virtual Network Name"] | |
$sslCert = $OctopusParameters["Azure SSLCertificate Thumbprint"] | |
$caCert = $OctopusParameters["Azure CACertificate Thumbprint"] | |
$vmName = $OctopusParameters["Azure Vm Name"] | |
$pathToCSCFG = [System.IO.Path]::Combine($OctopusOriginalPackageDirectoryPath, "ServiceConfiguration.Cloud.cscfg") | |
$xml = [xml](Get-Content $pathToCSCFG) | |
if (![string]::IsNullOrEmpty($virtualNetworkName)){ |