Skip to content

Instantly share code, notes, and snippets.

########### 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() {
# 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
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
# multi_accept on;
}
public class NetworkConnection : IDisposable
{
string _networkName;
public NetworkConnection(string networkName,
NetworkCredential credentials)
{
_networkName = networkName;
var netResource = new NetResource()
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);
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();