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 Auto_Invest; | |
| public static class EventAwaiter | |
| { | |
| public class EventArg<T> | |
| { | |
| public T? Args { get; set; } | |
| public object? Sender { get; set; } | |
| } |
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
| 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 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
| 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 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
| $images=$(docker ps);$imageid=$images[1].Split(' ')[0];docker kill $imageid |
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
| // ==UserScript== | |
| // @name | |
| // @version 1.0 | |
| // @description Makes AWS automatically do a push on DUO | |
| // @match https://domain/console/ | |
| // @grant GM_addStyle | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
| // @require http://static-file-cdn.s3-website.us-east-2.amazonaws.com/js/waitForKeyElements.js | |
| // ==/UserScript== | |
| waitForKeyElements ("#wdc_mfa", actionFunction); |
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
| private static Type GetCallingType() | |
| { | |
| var stack = new StackTrace(); | |
| var currentType = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType; | |
| var callingType = currentType; | |
| var frames = stack.GetFrames() ?? new StackFrame[] { }; | |
| foreach (var frame in frames) | |
| { | |
| var method = frame.GetMethod(); |
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 System; | |
| using System.Reflection; | |
| using System.Reflection.Emit; | |
| namespace TypeBuilderNamespace | |
| { | |
| public static class MyTypeBuilder | |
| { | |
| public static void CreateNewObject() | |
| { |
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
| public void InitializeDatabase(YourDbContext context) | |
| { | |
| if (!context.Database.Exists() || !context.Database.CompatibleWithModel(false)) | |
| { | |
| var configuration = new DbMigrationsConfiguration(); | |
| var migrator = new DbMigrator(configuration); | |
| migrator.Configuration.TargetDatabase = new DbConnectionInfo(context.Database.Connection.ConnectionString, "System.Data.SqlClient"); | |
| var migrations = migrator.GetPendingMigrations(); | |
| if (migrations.Any()) | |
| { |
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
| openssl s_client -connect 13.226.49.64:443 -servername api-help.rendrneuro.com |