Skip to content

Instantly share code, notes, and snippets.

View CodeMan99's full-sized avatar

Cody A. Taylor CodeMan99

View GitHub Profile
@CodeMan99
CodeMan99 / shasum256.ps1
Created May 16, 2024 17:51
Validating a SHA256 Checksum in PowerShell
PS E:\Images> $rocky_hash = Get-FileHash -Path .\Rocky-9-Container-Base-9.3-20231119.0.x86_64.tar.xz -Algorithm sha256 | % {$_.Hash}
PS E:\Images> Get-Content -Path .\Rocky-9-Container-Base-9.3-20231119.0.x86_64.tar.xz.CHECKSUM
# Rocky-9-Container-Base-9.3-20231119.0.x86_64.tar.xz: 44455204 bytes
SHA256 (Rocky-9-Container-Base-9.3-20231119.0.x86_64.tar.xz) = 1fbec9bfd250752325106e1a3fefc022067731f3b19129cbeb8907ff606fe0e2
PS E:\Images> $rocky_hash -eq "1fbec9bfd250752325106e1a3fefc022067731f3b19129cbeb8907ff606fe0e2"
True
@CodeMan99
CodeMan99 / 001-server.bash
Created May 15, 2024 01:43 — forked from leandronsp/001-server.bash
A complete yet simple Web server (with login & logout system) written in Shell Script
#!/bin/bash
## Create the response FIFO
rm -f response
mkfifo response
function handle_GET_home() {
RESPONSE=$(cat home.html | \
sed "s/{{$COOKIE_NAME}}/$COOKIE_VALUE/")
}
SELECT *
FROM information_schema.table_constraints
WHERE table_name = 'recipes'
@CodeMan99
CodeMan99 / create-pgadmin4.sh
Last active April 6, 2024 16:51
Create pgadmin container for Shuttle cch23
#!/usr/bin/env bash
set -e
CCH23_PORT="${1:?port argument is required}"
NAMESPACE="cch23-codeman99"
LOGIN_EMAIL="codemister99@yahoo.com"
LOGIN_PASSWORD="cch23"
SERVER_JSON_TMP="$(mktemp server-XXX.json)"
@CodeMan99
CodeMan99 / Makefile
Created June 27, 2023 22:00
Assembly HelloWorld, binary size 392 bytes
hello: hello.o
ld hello.o -o hello -s -n
hello.o: hello.s
as hello.s -o hello.o
#!/usr/bin/env node
const [n, u] = process.argv.slice(2);
const t = parseFloat(n);
function kelvin(value) {
const sunK = 5778.0;
const sunCodys = 1_000_000_000.0;
return (value / sunK) * sunCodys;
@CodeMan99
CodeMan99 / .gitignore
Last active April 7, 2024 20:11
Chimera Linux via Docker
chimera-*.pub
chimera-linux-*.tar.gz
sha256sums.txt
sha256sums.txt.minisig
@CodeMan99
CodeMan99 / devopen.sh
Created February 13, 2023 15:08
Open devcontainer in VSCode (bash function)
function devopen() {
local workspace_folder="$(readlink -f "$1")"
if [ -d "$workspace_folder" ]; then
local wsl_path="$(wslpath -w "$workspace_folder")"
local path_id=$(printf "%s" "$wsl_path" | xxd -ps -c 256)
code --folder-uri "vscode-remote://dev-container%2B${path_id}/workspaces/$(basename "$workspace_folder")"
else
echo "Usage: devopen <directory>" 1>&2
@CodeMan99
CodeMan99 / .gitconfig
Last active February 6, 2024 04:47
My git config --global --list
[alias]
can = commit --amend --no-edit --no-verify
l = branch -vv
s = status --short --branch
u = remote update
whatadded = log --diff-filter=A
m = merge
[am]
threeway = true
[color]
@CodeMan99
CodeMan99 / getnode
Last active December 20, 2022 21:09
Tiny scripts for getting & installing node.
#!/usr/bin/env bash
set -e
VERSION="$1"
OS="linux"
ARCH="x64"
# ARCH="armv7l"
URL="https://nodejs.org/dist/v${VERSION}/node-v${VERSION}-${OS}-${ARCH}.tar.xz"