diff --git a/Axiom/Axiom.Core/Axiom.Core.sln b/Axiom/Axiom.Core/Axiom.Core.sln new file mode 100644 index 0000000..bd409ce --- /dev/null +++ b/Axiom/Axiom.Core/Axiom.Core.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Axiom.Core", "Axiom.Core.csproj", "{379CF069-D825-5068-77C8-E340F5D2FC2D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {379CF069-D825-5068-77C8-E340F5D2FC2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {379CF069-D825-5068-77C8-E340F5D2FC2D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {379CF069-D825-5068-77C8-E340F5D2FC2D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {379CF069-D825-5068-77C8-E340F5D2FC2D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7DE04B9E-BE44-48A3-9B4D-C40BA39CC963} + EndGlobalSection +EndGlobal diff --git a/MarketData/MarketDataLib/Security/Encryption.cs b/MarketData/MarketDataLib/Security/Encryption.cs index 6a179f8..55bd81d 100755 --- a/MarketData/MarketDataLib/Security/Encryption.cs +++ b/MarketData/MarketDataLib/Security/Encryption.cs @@ -16,21 +16,36 @@ namespace MarketData.Security } } + // public static (string Salt, string Hash) HashPasswordWithSalt(string password) + // { + // using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider()) + // { + // byte[] salt = new byte[16]; + // rng.GetBytes(salt); + // using (SHA256 sha256 = SHA256.Create()) + // { + // byte[] passwordBytes = Encoding.UTF8.GetBytes(password); + // byte[] saltedPassword = new byte[passwordBytes.Length + salt.Length]; + // Buffer.BlockCopy(passwordBytes, 0, saltedPassword, 0, passwordBytes.Length); + // Buffer.BlockCopy(salt, 0, saltedPassword, passwordBytes.Length, salt.Length); + // byte[] hashBytes = sha256.ComputeHash(saltedPassword); + // return (Convert.ToBase64String(salt), Convert.ToBase64String(hashBytes)); + // } + // } + // } + public static (string Salt, string Hash) HashPasswordWithSalt(string password) { - using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider()) + byte[] salt = new byte[16]; + RandomNumberGenerator.Fill(salt); + using (SHA256 sha256 = SHA256.Create()) { - byte[] salt = new byte[16]; - rng.GetBytes(salt); - using (SHA256 sha256 = SHA256.Create()) - { - byte[] passwordBytes = Encoding.UTF8.GetBytes(password); - byte[] saltedPassword = new byte[passwordBytes.Length + salt.Length]; - Buffer.BlockCopy(passwordBytes, 0, saltedPassword, 0, passwordBytes.Length); - Buffer.BlockCopy(salt, 0, saltedPassword, passwordBytes.Length, salt.Length); - byte[] hashBytes = sha256.ComputeHash(saltedPassword); - return (Convert.ToBase64String(salt), Convert.ToBase64String(hashBytes)); - } + byte[] passwordBytes = Encoding.UTF8.GetBytes(password); + byte[] saltedPassword = new byte[passwordBytes.Length + salt.Length]; + Buffer.BlockCopy(passwordBytes, 0, saltedPassword, 0, passwordBytes.Length); + Buffer.BlockCopy(salt, 0, saltedPassword, passwordBytes.Length, salt.Length); + byte[] hashBytes = sha256.ComputeHash(saltedPassword); + return (Convert.ToBase64String(salt), Convert.ToBase64String(hashBytes)); } } diff --git a/README.md b/README.md index b4a7535..7964580 100644 --- a/README.md +++ b/README.md @@ -234,3 +234,11 @@ Also note that 1>/dev/null is synonymous to, but more explicit than >/dev/null # Financial 1) Economic Indicators - https://docs.tradingeconomics.com/ + + +# DOTNET related notes +Slow builds and C# Dev Kit Errors +ps -u $USER -o pid,cmd | grep -E 'csdevkit|visualstudio-projectsystem-buildhost|vstest.console' | grep dotnet | awk '#{print $1}' | xargs -r kill -9 || true + +This shows where dotnet performance is +dotnet build /clp:PerformanceSummary \ No newline at end of file diff --git a/Scripts/deploy_mk.sh b/Scripts/deploy_mk.sh index ee3ce1f..cdeec81 100755 --- a/Scripts/deploy_mk.sh +++ b/Scripts/deploy_mk.sh @@ -11,8 +11,10 @@ # set xtrace if you want to see trace level #set -o xtrace -sudo service cron stop -sudo service cron status +# use systemctl so we can bypass the pager +sudo systemctl --no-pager stop cron +sudo systemctl --no-pager status cron + # The name of the MK process that we will need to ensure is not running during the deployment PROCESS_NAME="mk" @@ -74,7 +76,8 @@ done # Check if source directory exists if [ ! -d "$SOURCE_DIR" ]; then echo "Error: Source directory '$SOURCE_DIR' not found." - sudo service cron restart +# use systemctl so we can bypass the pager prompts + sudo systemctl --no-pager restart cron exit 1 fi @@ -122,8 +125,9 @@ echo "" echo "Files copied from '$SOURCE_DIR' to '$DEST_DIR'." -sudo service cron restart -sudo service cron status +# use systemctl so we can bypass the pager prompts +sudo systemctl --no-pager restart cron +sudo systemctl --no-pager status cron echo "Done."