Skip to content

Instantly share code, notes, and snippets.

View ChristopherA's full-sized avatar

Christopher Allen ChristopherA

View GitHub Profile
@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
Created May 15, 2024 02:53
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
@ChristopherA
ChristopherA / macos_time_machine_tips.md
Created April 4, 2024 06:18
macOS Time Machine Tips

macOS Time Machines Tips

Speed up

To give priority to Time Machine:

sudo sysctl debug.lowpri_throttle_enabled=0
@ChristopherA
ChristopherA / cargo_new_tip.md
Created January 25, 2024 21:02
Rust & Cargo Tips:

Rust & Cargo Tips

cargo new with no git

cargo new --vcs=none simple_cli
@ChristopherA
ChristopherA / bc_gordian_nfc_links.md
Last active January 24, 2024 06:47
Blockchain Commons Gordian NFC Project & JavaCard Links