This file contains hidden or 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
using KafkaNet; | |
using KafkaNet.Model; | |
using KafkaNet.Protocol; | |
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Web.Http; |
This file contains hidden or 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
//LinqPad | |
File.Delete("c:\\md5-list.txt"); | |
var hashes = new List<string>(); | |
var bytes = new byte[16]; | |
using (var rng = new RNGCryptoServiceProvider()) | |
{ | |
for (int i=0; i<500000; i++) | |
{ |
This file contains hidden or 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
namespace System | |
{ | |
/// <summary> | |
/// Extensions to <see cref="DateTimeOffset"/> | |
/// </summary> | |
public static class DateTimeOffsetExtensions | |
{ | |
/// <summary> | |
/// Returns the localised date-time as GMT formatted for HTTP headers, e.g. | |
/// Thu, 09 Oct 2014 10:31:33 GMT |
This file contains hidden or 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
<UsingTask TaskName="ExecAsync" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" > | |
<ParameterGroup> | |
<exePath ParameterType="System.String" Required="true" /> | |
<arguments ParameterType="System.String" Required="true" /> | |
<waitMilliseconds ParameterType="System.Int32" Required="true" /> | |
</ParameterGroup> | |
<Task> | |
<Using Namespace="System.Diagnostics"/> | |
<Using Namespace="System.Threading"/> |
This file contains hidden or 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
TopologyBuilder topologyBuilder = new TopologyBuilder("MyEventProcessorRealTimeStorm"); |
This file contains hidden or 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
using Microsoft.SCP; | |
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
namespace My.Storm.App.Tests | |
{ | |
/// <summary> | |
/// Simple stub for emitting Event Hub-style tuples to Storm context. | |
/// </summary> |
This file contains hidden or 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
# Upgrades an existing Docker installation on Windows Server 2016 | |
# Assumes you have Docker already installed by following the steps in https://blog.sixeyed.com/1-2-3-iis-running-in-nano-server-in-docker-on-windows-server-2016/ | |
Stop-Service docker | |
dockerd.exe --unregister-service | |
Invoke-WebRequest "https://download.docker.com/components/engine/windows-server/cs-1.12/docker.zip" -OutFile "$env:TEMP\docker.zip" -UseBasicParsing |
This file contains hidden or 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
#docker rm $(docker ps -a -q) | |
function Remove-StoppedContainers { | |
foreach ($id in & docker ps -a -q) { | |
& docker rm $id } | |
} | |
#docker rmi $(docker images -f "dangling=true" -q) | |
function Remove-DanglingImages { | |
foreach ($id in & docker images -q -f 'dangling=true') { | |
& docker rmi $id } |
This file contains hidden or 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
$ip = '127.0.0.1' | |
docker swarm init --listen-addr $ip --advertise-addr $ip | |
docker network create --driver overlay test | |
docker service create ` | |
--network test ` | |
--endpoint-mode dnsrr ` | |
--publish mode=host,target=80,published=80 ` |
This file contains hidden or 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
$serverName = 'my.server.region.cloudapp.azure.com' | |
$externalIP = '1.2.3.4' | |
$internalIP = '10.0.0.4' | |
mkdir -p C:\certs\vm\client | |
docker run --rm ` | |
-e SERVER_NAME= $serverName ` | |
-e IP_ADDRESSES=127.0.0.1,$externalIP,$internalIP ` | |
-v 'C:\ProgramData\docker:C:\ProgramData\docker' ` |