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
# 2020-06-23 | |
# this shows creating a Vault instance running integrated storage/raft, | |
# then adding a KV and taking a snapshot | |
# then kill the raft DB files to simulate a storage failure | |
# repeat new Vault instance, restore snapshot, unseal and auth with orig keys | |
# and read some data to show how backup/restore works | |
# not meant to be a live script to run! | |
# this uses the vault_config.hcl from https://gist.github.com/mikegreen/c2df5eea2283f0dbc5f3a5d3650536fd |
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
<script autostart="false" src="_framework/blazor.server.js"></script> | |
<script> | |
async function connectionDown(options) { | |
console.log("Connection Down - you could do some UI here..."); | |
for (let i = 0; i < options.maxRetries; i++) { | |
console.log("Waiting for reconnect attempt #"+(i+1)+" ..."); | |
await this.delay(options.retryIntervalMilliseconds); | |
if (this.isDisposed) { | |
break; | |
} |
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
public RequestDevice = (options: USBRequestDeviceOptions): Promise<DeviceFound> => { | |
function isEmpty(obj) { | |
for (var prop in obj) { | |
if (Object.prototype.hasOwnProperty.call(obj, prop)) { | |
return false; | |
} | |
} | |
return true; | |
} |
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
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
using Orleans; | |
using Orleans.Hosting; | |
using SignalR.Orleans; | |
using System; | |
using System.Collections.Generic; |
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
public static class OrleansExtensions | |
{ | |
private const string SiloBuilderKey = "OrleansSiloBuilderInstance"; | |
public static IHostBuilder AddOrleans(this IHostBuilder hostBuilder, Action<ISiloHostBuilder> configure) | |
{ | |
var siloHostBuilder = GetSiloBuilder(hostBuilder); | |
configure?.Invoke(siloHostBuilder); | |
siloHostBuilder.ConfigureDefaults(); | |
siloHostBuilder.GetApplicationPartManager().ConfigureDefaults(); |
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
public interface IPromiseCallbackHandler | |
{ | |
void SetResult(string json); | |
void SetError(string error); | |
} |
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
public static class Logger | |
{ | |
public static void Log(object message) | |
{ | |
RegisteredFunction.Invoke<bool>( | |
"Logger.Log", | |
JsonUtil.Serialize(message)); | |
} | |
public static void Error(object error) |
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
using Newtonsoft.Json; | |
namespace Migratable { | |
[JsonConverter(typeof(MigratableConverter))] | |
public interface IMigratable { | |
} | |
} |
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
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Data.Common; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
namespace Orleans.SqlUtils | |
{ |
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
try { | |
$OSPlatform = [System.Runtime.InteropServices.OSPlatform] | |
$IsLinux = $Runtime::IsOSPlatform($OSPlatform::Linux) | |
$IsOSX = $Runtime::IsOSPlatform($OSPlatform::OSX) | |
$IsWindows = $Runtime::IsOSPlatform($OSPlatform::Windows) | |
} catch { | |
# If these are already set, then they're read-only and we're done | |
try { | |
$IsLinux = $false |
NewerOlder