Advanced Search
Search Results
156 total results found
Raspberry Pi - DotNet Setup
Here’s a short article for setting up a Raspberry PI to run DotNet. Reference Articles We are following this article series: Page #1: RP #01: Setup your Raspberry Pi with Raspberry Pi OS Page 2: RP #02: Install .NET and develop your first .NET application ...
NET Core Func Variables
Here are some use cases for a Func. Func as Method Callback If you want to have a lambda that you pass to a method, like a callback or completion handler, here is an example. Declare the Func, like this: Func<int, int, Task<int>> sigcallback = async (callb...
Regex Notes
Good site for testing Regex matching strings: https://regex101.com/r/iY5hU9/1
C# Unit Tests with Async Task Signature
When writing unit tests, it’s good to standardize as much as possible.This includes the method signature for each test cases, such as this: // Test_1_1_1 Describe the test... [TestMethod] public async Task Test_1_1_1() { // Do some testing... ... ...
HowTo Retrieve Key and Cert from PFX
Here’s a good article on how to export SSL certificates, extract the key and certificate, and import it into AWS. How To Convert Windows PFX Certificate Files Into PEM Format On Linux The above article uses openSSL, which can be found for Windows, here: Win...
Jenkins References
Jenkins Tutorial — Part 5 — When Conditions Conditionals in a Declarative Pipeline Jenkinsfile Jenkins Declarative Pipeline Tutorial Declarative Pipeline With Jenkins - DZone Refcards
Linux Disk Usage
Linux has a few means to analyze a disk for space usage. One way, is a package called, ncdu. It can be downloaded with: sudo apt install ncdu You execute it, like this: sudo ncdu -x / NOTE: -x forces it to stay within the same filesystem, and not travers...
Creating SSH Keys in Linux
Creating an SSH key is straightforward on a linux client, using this command: ssh-keygen By default recent versions of ssh-keygen will create a 3072-bit RSA key pair, which is secure enough for most use cases (you may optionally pass in the -b 4096 flag to c...
Process Logging Behavior
Here’s my current conventions for logging in application processes. Logging features, here are implemented by the Logging class in OGA.Common.Lib. Logging Phases We use three distinct logging phases for an application, each with a distinct purpose. Ear...
Dotnet Dev on Linux
To create a new project at the current folder: dotnet new console --framework net6.0 --use-program-main To run the app: dotnet run
NET Core Error Responses
Here’s a decent mechanism for returning useful errors from a WEB API. Aside: We have a standing test API (OGA.RESTAPI_Testing.Service) that will return examples of this, here: http://192.168.1.201:4250/swagger/index.html We can compose an instance of the Pro...
NET Core Test API
We have a standing REST API with various endpoints for simulating different method types, return errors, and such. It’s Swagger page is, here: http://192.168.1.201:4250/swagger/index.html
Kali in VMWare
Here are some things for installing Kali in a VMWare VM. Adapted from here: https://www.kali.org/docs/virtualization/install-vmware-guest-vm/ Choose the latest Workstation Hardware version. 16.x is current as of this writing. Kali is debian based, so use...
Six Ways to Multi-Thread
Six ways to initiate tasks on another thread in .NET
Create PFX Cert File (for IIS)
Windows IIS requires a pfx file when importing an SSL certificate. This can be created from a crt and a key file using openssl and the following steps. Locate the openssl.exe on your system. It is usually installed as part of git, and located, here:C:\Progra...
Return Multiple Values from Async Method
Async method cannot have Ref or an Out parameters. So, we cannot pass back data from them through typical syntax. This requires us to be a little creative. One way around this CLR limitation is to use tuples.Specifically, we can use an implicit tuple, that wi...
Strongly Typed Constant Parameters
You will eventually run into the need for a function to accept a restricted set of value for a parameter.One way to solve this is with an enum. But, enums can be cast and overrode, without concern.So, here’s a more type-safe method. This technique uses stron...
PostgreSQL Permissions
Here are three major points you need to understand about object ownership: Only a superuser or the owner of an object (table, function, procedure, sequence, etc.) can ALTER/DROP the object. Only a superuser or the owner of an object can ALTER the own...
PostGreSQL .NET DateTime Usage
.NET EF Core 6 made a breaking change to how DateTime is stored in PostGreSQL. This article explains some of it and the workaround: https://github.com/npgsql/efcore.pg/issues/2000 To enable the workaround, add this to the Configure method of your Startup....
Docker Space Full
Here are some things to check on when the disk on a docker host gets full sudo docker system prune -a -f This will cleanup other resource types: docker system prune -a This command will remove older logs from the container logs folder: sudo find /projec...