Skip to content

Instantly share code, notes, and snippets.

GOTO EndComment
This batch file will install a pre-made RSA machine key file onto a machine.
Things to note:
MyCustomKeys is an container I have specified and you can specfify whatever you want hen you create & export the keys.
The applicaton is presuming that .NET 4 is installed. For other versions please see my post:
https://mywebanecdotes.com/2016/09/17/encrypting-credentials-in-app-config-for-multiple-machines/
:EndComment
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis -pi MyCustomKeys keys.xml
@garfbradaz
garfbradaz / example.sql
Created April 27, 2018 15:02
Example query to CosmosDB
SELECT DISTINCT CAST(edt.[EditionID] AS varchar) AS editionId
,edt.[CoverTitle] AS coverTitle
,edt.[ISBN13] AS isbn13
,edt.[SubTitle] AS subTitle
,edt.[CoverAuthors] AS coverAuthors
,edt.[WorkReference] AS workReference
,edt.[Binding] AS binding
,edt.[Division] AS division
,edt.[Format] AS format
,edt.[SortTitle] AS sortTitle
execve("/usr/bin/ssh", ["ssh", "-v", "pi@bosspi1"], [/* 14 vars */]) = 0
brk(NULL) = 0x7fffdcd55000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=20599, ...}) = 0
mmap(NULL, 20599, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb86baf4000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
@garfbradaz
garfbradaz / JsonProduct.cs
Created October 10, 2018 10:12
Our Product object represented in JSON.
public partial class JsonProduct
{
[JsonProperty("record")]
public Record[] Record { get; set; }
}
public partial class Record
{
[JsonProperty("editionID")]
public double EditionId { get; set; }
@garfbradaz
garfbradaz / TestToDo.cs
Created October 10, 2018 10:21
Simple JSON Object for Azure Function Demo
[Serializable]
public partial class TestToDo
{
[JsonProperty("userId")]
public long UserId { get; set; }
[JsonProperty("id")]
public long Id { get; set; }
[JsonProperty("title")]
@garfbradaz
garfbradaz / exception_.cs
Last active October 10, 2018 10:48
Exception thrown from Durable Function
Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HLHEIEB48VMD", Request id "0HLHEIEB48VMD:00000001": An unhandled exception
was thrown by the application.
Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: HttpSyncStart ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Azure.WebJobs.Extensions.DurableTask.HttpApiHandler.GetClient(HttpRequestMessage
request)
at Microsoft.Azure.WebJobs.Extensions.DurableTask.HttpApiHandler.WaitForCompletionOrCreateCheckStatusResponseAsync(HttpRequestMessage request, String instanceId, OrchestrationClientAttribute
attribute, TimeSpan timeout, TimeSpan retryInterval)
at Microsoft.Azure.WebJobs.Extensions.DurableTask.DurableTaskExtension.WaitForCompletionOrCreateCheckStatusResponseAsync(HttpRequestMessage request, String instanceId, OrchestrationClientAttribute attribute, TimeSpan timeout, TimeSpan retryInterval)
at Microsoft.Azure.WebJobs.DurableOrchestrationCl
@garfbradaz
garfbradaz / cloudSettings
Created January 14, 2019 09:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-14T09:55:37.893Z","extensionVersion":"v3.2.4"}
@garfbradaz
garfbradaz / gist:3ea71037bc625eaf30d397c7f016d6e0
Created July 19, 2019 12:55
Crash dump from Mac - using dotnet core EF Spatials.
Process: dotnet [8672]
Path: /usr/local/share/dotnet/dotnet
Identifier: dotnet
Version: 0
Code Type: X86-64 (Native)
Parent Process: dotnet [8670]
Responsible: iTerm2 [449]
User ID: 501
Date/Time: 2019-07-19 13:24:27.997 +0100
@garfbradaz
garfbradaz / stack.dump
Created August 2, 2019 09:14
New Stacks dump Spatialite
Process: dotnet [20788]
Path: /usr/local/share/dotnet/dotnet
Identifier: dotnet
Version: 0
Code Type: X86-64 (Native)
Parent Process: dotnet [20783]
Responsible: Electron [19781]
User ID: 501
Date/Time: 2019-08-02 09:56:19.985 +0100
@garfbradaz
garfbradaz / error.txt
Last active August 12, 2019 14:27
Errors from dotnet build
​ Failed to download package 'Stratum.Util.201908.6.2' from 'https://pkgs.dev.azure.com/stratumfive/_packaging/9c301f7b-5cd6-4352-bff6-a4a1666f6569@f8ecd5e5-96ea-4d83-90eb-5e7cee6e175b/nuget/v3/flat2/stratum.util/201908.6.2/stratum.util.201908.6.2.nupkg'. An error occurred while sending the request. Received an unexpected EOF or 0 bytes from the transport stream. Failed to download package 'Serilog.Formatting.Elasticsearch.7.1.0' from 'https://pkgs.dev.azure.com/stratumfive/_packaging/9c301f7b-5cd6-4352-bff6-a4a1666f6569@f8ecd5e5-96ea-4d83-90eb-5e7cee6e175b/nuget/v3/flat2/serilog.formatting.elasticsearch/7.1.0/serilog.formatting.elasticsearch.7.1.0.nupkg'.
Connection refused Restore completed in 25.59 sec for /app/src/Aviso.Ports.Common/Aviso.Ports.Common.csproj. Restore completed in 18.18 sec for /app/src/Aviso.Ports.Dal/Aviso.Ports.Dal.csproj. Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore.sqlite.core/index.json'. The downl