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
| ########### nginx_error_log.sh #################### | |
| #!/bin/bash | |
| logfile="/var/log/nginx/error.log" | |
| posfile="/var/log/nginx/.logpos" | |
| # Function to process new log entries | |
| process_log_entry() { |
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
| # Extract the RSA Key from the PFX file: | |
| openssl pkcs12 -in wildchar_cert.pfx -nocerts -nodes -out file-key-pfx.pem | |
| #Extract the Public Certificate from the PFX file: | |
| openssl pkcs12 -in wildchar_cert.pfx -clcerts -nokeys -out file-cert-pfx.pem | |
| #Extract the CA Chain from the PFX file: | |
| https://whatsmychaincert.com/ | |
| #Export to iis cert |
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
| user www-data; | |
| worker_processes auto; | |
| pid /run/nginx.pid; | |
| include /etc/nginx/modules-enabled/*.conf; | |
| events { | |
| worker_connections 1024; | |
| # multi_accept on; | |
| } |
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 class NetworkConnection : IDisposable | |
| { | |
| string _networkName; | |
| public NetworkConnection(string networkName, | |
| NetworkCredential credentials) | |
| { | |
| _networkName = networkName; | |
| var netResource = new NetResource() |
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
| var client = new RestClient("endpoint"); | |
| client.Timeout = -1; | |
| var request = new RestRequest(Method.POST); | |
| request.AddHeader("Content-Type", "application/json"); | |
| var body = @"{""@t"":""2022-09-29T13:41:57.8532799Z"",""@l"":""Debug"",""@mt"":""Hello, {User}"",""User"":""alice""}"; | |
| request.AddParameter("application/json", body, ParameterType.RequestBody); | |
| IRestResponse response = client.Execute(request); | |
| Console.WriteLine(response.Content); |
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 readonly int[] results = new[] { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }; | |
| private readonly Random random = new Random(); | |
| public string GenerateCardToken() | |
| { | |
| string cardNum = string.Empty; | |
| var random = new Random(); | |
| for (int j = 0; j < random.Next(3) + 13; j++) | |
| { | |
| cardNum += random.Next(0, 10).ToString(); |