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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: Template to deploy funding-arbitrage futures instance | |
Metadata: | |
cfn-lint:AWSTemplateFormatVersion: "2010-09-09" | |
Description: Template to deploy funding-arbitrage futures instance | |
Metadata: |
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
function Execute-NonQuery([psobject[]]$sqlCommands, $connectionString) { | |
$connection = new-object system.data.SqlClient.SQLConnection($connectionString) | |
$connection.Open() | |
$command = $connection.CreateCommand() | |
$transaction = $connection.BeginTransaction() | |
$command.Connection = $connection | |
$command.Transaction = $transaction | |
try { |
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
function Get-DataSet($sqlCommand, $parameters, $connectionString) { | |
$connection = new-object system.data.SqlClient.SQLConnection($connectionString) | |
$command = new-object system.data.sqlclient.sqlcommand($sqlCommand,$connection) | |
$dataset = New-Object System.Data.DataSet | |
$parameters | Select-Object -ExpandProperty Keys | %{ | |
$command.Parameters.Add($_, $parameters[$_]) | |
} | |
try{ |
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
FallbackCredentialsFactory.CredentialsGenerators.Insert(0, () => | |
{ | |
var profileName = Environment.GetEnvironmentVariable("AWS_PROFILE"); | |
if (string.IsNullOrWhiteSpace(profileName)) return null; | |
var chain = new CredentialProfileStoreChain(); | |
return !chain.TryGetProfile(profileName, out var profile) ? null : new BasicAWSCredentials(profile.Options.AccessKey, profile.Options.SecretKey); | |
}); |
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 StaticAsyncMediator | |
{ | |
private static readonly IDictionary<string, object> | |
CompletionSources = new ConcurrentDictionary<string, object>(); | |
private static TaskCompletionSource<T> GetCreateSource<T>(string key) | |
{ | |
var fullKey = $"{typeof(T).FullName}:{key}"; | |
if (CompletionSources.ContainsKey(fullKey) && CompletionSources.TryGetValue(fullKey, out var returnValue)) | |
return (TaskCompletionSource<T>) returnValue; |
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
namespace Auto_Invest; | |
public static class EventAwaiter | |
{ | |
public class EventArg<T> | |
{ | |
public T? Args { get; set; } | |
public object? Sender { get; set; } | |
} |
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
cat <<'EOF' > $IBEAM_GATEWAY_DIR/san.tmpl | |
[req] | |
default_bits = 2048 | |
distinguished_name = req_distinguished_name | |
req_extensions = req_ext | |
x509_extensions = v3_req | |
prompt = no | |
[req_distinguished_name] |
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
cat <<'EOF' > /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent-schema.tmpl | |
{ | |
"agent": { | |
"run_as_user": "root" | |
}, | |
"logs": { | |
"logs_collected": { | |
"files": { | |
"collect_list": [ | |
{ |
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
$images=$(docker ps);$imageid=$images[1].Split(' ')[0];docker kill $imageid |
NewerOlder