code Mature Sustainable Operations From Toward a Maturity Model for Observability [https://www.honeycomb.io/blog/toward-a-maturity-model-for-observability/] * Quality Code * Predictable release * Managed debt * Operational Resiliency * User insight
code SQL Server UTC Date Functions Ran across some SQL statements that were using the expression SYSUTCDATETIME() [https://docs.microsoft.com/en-us/sql/t-sql/functions/sysutcdatetime-transact-sql?view=sql-server-2017] which is a statement I have not used and wanted to know the difference between this and my common go to statement of GETUTCDATE() [https://docs.microsoft.com/
code Every Nth item in a list Today I was asked a straightforward question on how would you get every 4th element from an array of numbers starting at 1 - 11 I immediately thought oh I can do this in a functional fluent manner, but then I flubbed it up because I tried to do a
code Set X11 Forwarding for all Users Setting the X Windows [https://token2shell.com/x410/] forwarding for your own personal user is usually set in the .profile file, but most of the time you really want to enable X Window [https://token2shell.com/x410/] forwarding for all users of the system. I mean you already went through
code List where Environment Variables are set Wanted to know where shell [https://en.wikipedia.org/wiki/Bash_(Unix_shell)] environment variables are being set on linux [https://www.debian.org/] and came across this helpful piece of scripting PS4='+$BASH_SOURCE> ' BASH_XTRACEFD=7 bash -xl 7>&2 Originally from StackOverflow
jQuery and Handler i.e. Legacy Code Working on a legacy code component so the current codebase is using HttpHandlers [https://support.microsoft.com/en-us/help/308001/how-to-create-an-asp-net-http-handler-by-using-visual-c-net] (yes this is and old pre .NET 2.0 application) and the task is to expand this functionality to allow for a Google reCAPTCHA v3 [https://www.google.com/
code Using Artillery to load test Doing user load testing with Artillery [https://artillery.io/] and finding it to be clean, useful, and fully featured [https://artillery.io/docs/cli-reference/] Install Artillery npm install artillery@latest -g Sample configuration file The following is a simple load test with the following parameters * Only 1 phase [https://artillery.
code Elevated Command Line Prompt Shortcut Use PowerShell to launch an elevated classic command line prompt Target C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command "Start-Process cmd -Verb RunAs" Start in C:\WINDOWS\System32\WindowsPowerShell\v1.0
code Lightning Talk - WSL in 5 minutes Windows Subsystem for Linux (WSL) A short and happy guide -------------------------------------------------------------------------------- What is Windows Subsystem for Linux? WSL is a collection of components that enables native Linux ELF64 [https://en.wikipedia.org/wiki/Executable_and_Linkable_Format] binaries to run on Windows. It contains both user mode and kernel mode
code Lightning Talk - .NET CLI in 5 Minutes Wrote this up after reading through Jeremy Miller' [https://jeremydmiller.com/]s article on .NET CLI [https://www.infoq.com/articles/netcore-cli] as a 5 minute lightning talk. -------------------------------------------------------------------------------- .NET Core Command Line Interface Can we be friends with it? -------------------------------------------------------------------------------- Test Setup * .NET Core installed 2.2 * Windows
code .NET HTTPS RESTful API call Because .NET Core 2.2 has switched over to serving from https [https://docs.microsoft.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-2.2&tabs=visual-studio] by default on port 5001 which can be a problem when you are debugging locally use cURL [https://curl.haxx.se/] and jq
code Enable Developer Mode Windows 10 Command Line To sideload applications without Microsoft approval (on application signatures for example when installing) and seems like still need to do this to use Windows Subsystem for Linux [https://docs.microsoft.com/en-us/windows/wsl/faq] still you will need to enabled Developer Mode on Windows 10 run this command under
code Bash cURL, arrays, date formatting with CSV In celebration of daylight savings time and all the misery it causes with timezones. The Solcast API [https://solcast.com.au/solar-data-api/api/]delivers forecast results in CSV format along with others (JSON/XML), but I wanted to load the data into a bash array and convert it to my
code Bash Sum values from file or stream Messing around with a way to sum data values from a plain text file like so: 1 5 19 22 -9 0 -05 4 Notice that the data file has empty lines cat <FILENAME> | grep . | paste -sd+ - | bc Breaking this down it is the following steps * cat
code XLaunch Configuration File First install XServer/XMing/XLaunch [http://www.straightrunning.com/XmingNotes/] Create a configuration file to place in your Documents folder that instructs the Display forwarding <?xml version="1.0"?> <XLaunch xmlns="http://www.straightrunning.com/XmingNotes" xmlns:xsi="http://www.w3.org/
code GeoJSON formatting with jq Having to format some GeoJSON data like so { "type": "FeatureCollection", "name": "My Places", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [{ "
code Bash loop cURL+ wget API extraction Script to automate a set of sequential downloads from bounded list of Ids. Use cURL to get the JSON data from the API and then extract the relevant fields to create a nice CSV download and finally remove the unnecessary quote characters in the output. Linux commands used * cURL [https:
code Bash Add extension to all files Having to add an extension to a series of files as they were produced by a splitting function and not in expected format Here all files in the directory are read in as loop and then moved with the new file name by using the linux command basename [http://man7.
code Web Scraping with lynx + cURL Wanted to grab data from a webpage and process the results. In this case the results are a csv file dump Get the utilities to be used here sudo apt-get install curl lynx cargo cargo install xsv; Setup XSV with Cargo export PATH="$HOME/.cargo/bin:$PATH" Copy
code Bash script to unzip files in directory This link [https://stackoverflow.com/a/29248777/194333]for a script to unzip all files within a directory works flawlessly in bash with only the use of zip [https://linux.die.net/man/1/zip] and sed [https://www.gnu.org/software/sed/manual/sed.html] In case link ever
code Bash Rename Specific File to Directory Name This is helpful when you have many different directories say something like -dir1 --metafile.txt -dir2 --metafile.txt In this case the directory names are different, but the underlying filenames are the same because in actuality you want to join them all together most likely or they were produced by
code Bash Rename Spaces in Files Spaces in files are not easy to work with on linux/unix system architectures. Easiest solution is to replace the space character with underscores. for f in *\ *; do mv "$f" "${f// /_}"; done
code Georeference an image A popular format for storing geographic information onto a raster image is the TIF [https://en.wikipedia.org/wiki/TIFF] format which allows the raster image to be tagged with the boundaries it represents. This makes the file able to reference and modify coordinate systems/transform. However from time to
code PostGIS - Temp table for query comparison Had to do a ETL [https://en.wikipedia.org/wiki/Extract,_transform,_load] task of creating a set of points in 4326 lat/lng projection to compare against the current table data in the same 4326 lat/lng projection and find all points that are unique and not within a
PostGIS - Buffer a Polygon Needed to buffer a polygon (rectangle) that was listed in lat/lng (4326) projection to world mercator (3857) by a defined limit 10KM. Problem is that 4326 is expecting decimal degrees 3857 is expecting meters. However PostGIS understands both and has functions to convert between the two. In this case