Skip to content

Instantly share code, notes, and snippets.

View phdye's full-sized avatar
🏠
Working from home

phdye

🏠
Working from home
View GitHub Profile

Run a Windows .bat File As Administrator and Capture Its Output (Windows 11)

Aeveral ways to run a batch file with elevated (Administrator) rights and log everything it prints (stdout and stderr) to a text file. Methods range from quick one-offs to reusable PowerShell wrappers and scheduled, unattended runs.

Tested With: Windows 11 (should also work on Windows 10). Adjust paths as needed.


Table of Contents

@phdye
phdye / Codex-Container-Lifecycle.md
Last active June 14, 2025 02:32
Container Lifecycle in Codex

🔍 Expanded Explanation: Container Lifecycle in Codex

The lifecycle of a typical Codex container execution looks like this:

1. Repo Cloning (done first)

  • The code (e.g. from GitHub) is cloned into the container's working directory.
  • This includes all files: source, scripts, .gitmodules, etc.

2. Setup Script Execution

@phdye
phdye / analyze-project.md
Created April 6, 2025 20:21
AI shortcut !analyze-project, a language-agnostic, whole project analyzer with flexible options

Shortcut Name: !analyze-project

Purpose: To automatically perform a full, structured analysis of all source files, configuration, documentation, and test logic across the entire project context — not just the most recent archive. This includes analysis of layout, extensibility, runtime behavior, and usage guidance. The methodology is language-agnostic and reusable across ecosystems.


🔁 Behavior

When the !analyze-project shortcut is invoked, it should:

@phdye
phdye / analyze-archive.md
Last active April 6, 2025 20:20
AI shortcut !analyze-archive, a language-agnostic, archive focused deep project analyzer with flexible options

📦 Shortcut Definition: !analyze-archive

🎯 Purpose

This shortcut performs a full, structured analysis of the most recently uploaded source archive (e.g., .zip, .tar.gz). It uses a language-agnostic methodology to analyze the archive's contents — including its code, configuration, command-line interface, test strategy, and extensibility — with the assumption that the archive is the sole source of truth.


🔁 Behavior

@phdye
phdye / ChatGPT Reseting Every Three Seconds.md
Last active December 1, 2024 15:43
Remediation Steps for ChatGPT Resetting Every Three Seconds
@phdye
phdye / find-perm.md
Last active December 1, 2024 11:37
find -perm <expr> behavior table vs their equivalent st_mode C operation

find -perm behavior

-perm Syntax Description Equivalent C Operation
-perm u=x Exact user bits: User execute (o100), no other user bits. (st_mode & o700) == o100
-perm -u=x All user execute bit: At least user execute (o100). (st_mode & o100) == o100
-perm /u=x Any user execute bit: User execute (o100) is set. (st_mode & o100) != 0
-perm =100 Exact permissions: Entire mode matches o100. (st_mode == o100)
-perm !u=x Not exact user execute: User permissions not exactly o100. (st_mode & o700) != o100
-perm !/u=x No user execute bit: User execute (o100) is not set. (st_mode &amp; o100) == 0
@phdye
phdye / chatgpt--just-the-facts.md
Last active September 9, 2024 15:55
Making an Honest AI out of ChatGPT

Per Query

To concisely request that ChatGPT avoid speculation and only provide well-supported information, you can phrase your query with a focus on specific evidence and certainty :

  1. "Please provide a definitive answer based on documented sources (PEPs, commits, official docs)."
  2. "I need a fact-based response. If any part is speculative, please label it clearly."
  3. "Can you confirm the version and source of this information, avoiding assumptions?"
  4. "Provide concrete evidence or documentation, and state explicitly if there is any uncertainty."
@phdye
phdye / ChatGPT-4--Five-Question-Answering-Modes.md
Last active September 23, 2024 08:37
ChatGPT-4's Five Question Answering Modes

ChatGPT-4's Five Question Answering Modes

It seems that you sometimes give quick, off the cuff, answers and sometimes very full and complete answers. Please characterize the various modes you operate in and how to request which one you should use.

You're right that I switch between different modes when answering questions. These modes reflect the level of depth or brevity I use, based on context, complexity of the question, and how I interpret your preferences. Here’s how I characterize the main modes I operate in:

1. Concise Mode

  • Nature: Short, direct answers with minimal explanation.
  • When Used: For straightforward questions, routine tasks, or when you seem to prefer brevity.
  • How to Request: "Can you give me a short answer?" or "Keep it brief."

Docker Creating Directories Owned by Root: A Common Occurrence

Here's why it happens and how to handle it:

Why Does It Happen?

Default User:

  • By default, Docker containers run as the root user. When the container creates files or directories on a mounted volume, those files/directories are owned by root on the host system.

Security: