Skip to content

Instantly share code, notes, and snippets.

View ChristopherA's full-sized avatar

Christopher Allen ChristopherA

View GitHub Profile
@ChristopherA
ChristopherA / useful_jekyll_blog_snippets.md
Last active June 12, 2024 21:46
Useful Jekyll Blog Snippets
@ChristopherA
ChristopherA / progressive_trust_links.md
Last active June 13, 2024 05:44
Progressive Trust Links
@ChristopherA
ChristopherA / zsh_opinionated_best_practices.md
Last active June 6, 2024 02:15
Zsh - Opinionated Best Practices

Zsh Opinionated - A Guide to Best Practices

  • Abstract: This guide provides best practices for writing clear, maintainable, and robust Zsh scripts. Aimed at helping developers transition from Bash to Zsh, particularly on macOS, this guide offers practical advice and examples for creating standardized and efficient scripts.

  • Copyright This text of this guide is Copyright ©️2024 by Christopher Allen, and is shared under spdx:CC-BY-SA-4.0 open-source license. All the example code is relenquished to the public domain under spx:CC0-1.0.

  • Tags: #zsh #scripting #cli #opinionated

@ChristopherA
ChristopherA / git_repo_dir_structure.md
Last active May 15, 2024 07:57
Git Repository Directory Structure

Git Repository Directory Structure

First pass of organizing various data and scripts about a repository. One open question is seperation of data about a repository vs scripts that use that data.

Note that much of this doesn't currently work with various Git hosting services (for instance GitHub & GitLab put their files in .github/ .gitlab/ respectively). Instead, this is more of a proposal.

Git itself uses .git/hooks. but you can set git config core.hooksPath /path/to/your/hooks to the path you want.

v0

@ChristopherA
ChristopherA / git_object-format_sha256.md
Last active May 15, 2024 06:22
Support for Git Commits using SHA-256

Support for Git Commits using SHA-256

Git started supporting SHA-256 based commit hashes in version 2.29, officially released on October 19, 2020.

This version included the --object-format=sha256 option for the git init command.

This feature is part of Git's ongoing efforts to enhance security and address potential vulnerabilities related to the use of SHA-1 hash algorithm.

Use of SHA-1 in Git Commits

@ChristopherA
ChristopherA / git-environment-variables.md
Last active May 15, 2024 06:43
Git Environment Variable for Shell Scripts

Git Environment Variable for Shell Scripts

GIT_AUTHOR_IDENT & GIT_COMMITTER_IDENT

The GIT_COMMITTER_IDENT and GIT_AUTHOR_IDENT environment variables allow you to set detailed author and committer information for a git commit in a single environment variable. These variables give you finer control over the identity information attached to commits, which can be particularly useful in automated systems or scripts that manage multiple git operations, or when you need to override both the name, email, and date simultaneously without setting each component individually.

It's worth noting that these variables are less commonly used and are not as well-documented as the individual GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, and GIT_COMMITTER_EMAIL variables.

Format

@ChristopherA
ChristopherA / open_integrity_script_snippets.sh
Last active May 30, 2024 03:23
Open Integrity Inception Script Snippets
# Remove any old git relics — we are creating an empty commit for a new identifier
rm -rf ./.git
git init # --object-format=sha256
# INCEPTION_CREATOR_NICK="any-nickname"
# This gets your your GitHub nick from your `gh` cli files if you have them
@ChristopherA
ChristopherA / self-signed-ssh.sh
Last active May 15, 2024 08:20
Script to self-sign an SSH public key and verify the signature
#!/bin/zsh
# ./self-signed-ssh.sh <path_to_ssh_public_key>
# Script to sign an SSH public key and verify the signature
# Check if the script is called with the necessary public key path argument
# Parameters:
# $1 - Path to the SSH public key.
function check_arguments {
if [[ -z "$1" ]]; then
echo "Usage: $0 <path_to_ssh_public_key>"
@ChristopherA
ChristopherA / git-repo-root-of-trust.md
Last active May 23, 2024 20:44
A Git Repo Root of Trust (A Proof-of-Concept & Work-in-Progress)

A Git Repo Root of Trust (A Proof-of-Concept & Work-in-Progress)

by Christopher Allen, Principal Architect, Blockchain Commons

Purpose of the Repository "Inception" Process

  • Initialization of a Secure Repository: Establishing a new repository with a root of trust ensures all future changes and commits build on a secure and verified foundation.
    • NOTE: This initial commit relies solely on basic git and ssh-keygen tools, without additional code libraries or identity infrastructure.
  • Leverage DIDs: By utilizing Decentralized Identifiers (DIDs) instead of traditional email addresses in the author and committer fields, we enhance privacy and align with decentralized practices.
  • NOTE: The resulting initial commit identifier can serve as a unique identifier for the repository. A future "did:repo:git-commit-id" method could be created that allows a DID resolver to create a temporary DID Document to verify authenticat