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
// Start Redis Server | |
var redisPassword = Guid.NewGuid().ToString("n"); | |
Console.Out.WriteLine($"Redis Password: {redisPassword}"); | |
var options = new GarnetServerOptions() | |
{ | |
Address = "127.0.0.1", | |
Port = 6379, | |
MemorySize = "128m", | |
AuthSettings = new PasswordAuthenticationSettings(redisPassword), | |
}; |
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
<Query Kind="Program"> | |
<Reference><RuntimeDirectory>\System.DirectoryServices.dll</Reference> | |
<Namespace>Microsoft.Win32</Namespace> | |
<Namespace>Microsoft.Win32.SafeHandles</Namespace> | |
<Namespace>System.ComponentModel</Namespace> | |
<Namespace>System.DirectoryServices</Namespace> | |
<Namespace>System.Runtime.InteropServices</Namespace> | |
<Namespace>System.Security.Principal</Namespace> | |
<Namespace>System.Collections.ObjectModel</Namespace> | |
</Query> |
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
// This sample code requires Mono.TextTemplating.Roslyn >= 2.3.1 nuget package | |
using System; | |
using Microsoft.VisualStudio.TextTemplating; | |
using Mono.TextTemplating; | |
using System.CodeDom.Compiler; | |
using System.Threading; | |
using System.Threading.Tasks; | |
internal static class Program |
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
/* | |
After running as administrator | |
- Entering the "winrm quickconfig" command if this is your first time setting up winrm | |
- If you get an error message that says it failed because your network profile is set to public, that's okay. | |
- To allow all external connections, run "winrm s winrm/config/client @{TrustedHosts="*"}" command | |
- After you're done testing, run the "winrm s winrm/config/client @{TrustedHosts=""}" command | |
*/ | |
var credential = default(TokenCredential); |
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.Security.Cryptography; | |
// Original Source Code: https://github.com/RedAndBlueEraser/rdp-file-password-encryptor | |
// System.Security.dll required | |
public static class Program | |
{ | |
public static void Main() | |
{ |
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.Globalization; | |
public static class Program | |
{ | |
private static void Main() | |
{ | |
var prompt = string.Empty; | |
prompt = Prompt |
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
@echo off | |
pushd "%~dp0" | |
%windir%\Microsoft.NET\Framework64\v4.0.30319\csc.exe /nologo /target:exe /r:System.ServiceProcess.dll /out:ServiceMain.exe ServiceMain.cs | |
%windir%\Microsoft.NET\Framework64\v4.0.30319\csc.exe /nologo /target:exe /out:SimpleMain.exe SimpleMain.cs | |
:exit | |
popd | |
@echo on |
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
// Require unsafe configuration. | |
using System.Runtime.InteropServices; | |
using System.Text; | |
namespace HelloWorld; | |
internal partial class NativeMethods | |
{ | |
// https://github.com/mono/mono/issues/9362 |
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
# for bash (macOS) | |
POSH_THEMES_PATH=$(brew --prefix oh-my-posh)/themes | |
eval "$(oh-my-posh completion bash)" | |
eval "$(oh-my-posh init bash --config "$POSH_THEMES_PATH"/clean-detailed.omp.json | sed 's|\[\[ -v MC_SID \]\]|[[ -n "$MC_SID" ]]|')" |
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
# Apply this code to the path pointed to by the $PROFILE variable. | |
# Introduction | |
# This code includes asdf and oh-my-posh support in addition to brew. | |
# Requirements | |
# You must have the latest version of the PSReadLine module installed. Use the Install-Module -Name PSReadLine -AllowClobber -Force command. | |
# Also, you need to go to Nerd Font (https://www.nerdfonts.com/) and change the font to display the oh-my-posh prompt normally. | |
# Troubleshooting |
NewerOlder