Skip to content

Instantly share code, notes, and snippets.

View pmarreck's full-sized avatar

Peter Marreck pmarreck

  • formerly senior engineer @ desk.com, chief engineer @ thredup.com, software engineer @ lifebooker.com. Director of Engineering @ addigence.com, currently available
  • Long Island, NY
  • 22:10 (UTC -04:00)
  • X @pmarreck
  • LinkedIn in/petermarreck
View GitHub Profile
@pmarreck
pmarreck / configure_steam_for_many_cores.bash
Created April 28, 2023 14:15
How to make the fossilize_replay Steam processes (which precompile shaders on Linux) use all your cores
# Adjust the core count (or just use nproc) and location to your hardware and steam install location
# This will create the file if it doesn't exist yet
# From: https://www.reddit.com/r/linux_gaming/comments/prsceh/is_there_a_way_to_get_valves_fossilize_replay/hdqfayv/
echo "unShaderBackgroundProcessingThreads $(nproc)" >> ~/.local/share/Steam/steam_dev.cfg
@pmarreck
pmarreck / eat.bash
Last active October 31, 2024 14:14
Estee Lauder application: A TUI function named "eat" that gets you to where the good stuff is.
#!/bin/sh
### EAT.BASH
### USAGE:
# 1) Run this file directly after making it executable and pass in an (optional) filter argument, e.g.,
# ./eat.bash burrito
# If you happen to have Nix installed, it will guarantee (more or less) that it will work,
# but it will download the deps on first run (and cache them).
# You can also run (or call) it with no arguments and just browse all the results
@pmarreck
pmarreck / rule_30.bash
Created April 26, 2023 03:11
Stephen Wolfram's Rule 30 output in Bash, generated (mostly) via ChatGPT4
#!/usr/bin/env bash
# Get the terminal width
width=$(tput cols)
# Set number of output lines
LINES=${LINES:-10000}
# Initialize the first row with a single block character in the middle
row=$(printf "%-$((width / 2))s" " ")
@pmarreck
pmarreck / animated_analog_SVG_clock.svg
Created April 25, 2023 15:35
Animated analog SVG clock, JS-powered
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pmarreck
pmarreck / pmarreck_resume.md
Last active February 6, 2025 15:50
Peter Marreck Resume 2025
@pmarreck
pmarreck / gpt4_is_also_a_zfs_expert.md
Last active April 7, 2023 19:09
Wherein ChatGPT4 acts as an experienced ZFS systems admin and makes recommendations to my config

ZFS Admin: Collect, Configure.

You:

I want you to act as an expert systems administrator specializing in ZFS filesystems. I want you to give me commands to run to collect information about my ZFS drives and configuration, and I will paste the output back to you, and you will then make configuration recommendations (possibly including the commands to run) to increase performance given my use case and priorities (which you can also ask me anything about).

ChatGPT:

Great, I'll be happy to help you with your ZFS configuration. Let's start by gathering some basic information about your current ZFS setup.

Please run the following commands and provide me with the output:

@pmarreck
pmarreck / git_commit_ai_reviewed_by_ai.md
Last active April 7, 2023 18:59
chatgpt4 making good edits to my bash function

Generate Git commit message.

You:

I wrote the following Bash function to use the OpenAI API to automatically come up with a git commit message and put it on the clipboard. Do you have any constructive criticisms or suggestions to make it better?

Here is the entire Bash file contents:

#!/usr/bin/env bash

git_commit_ai() {
@pmarreck
pmarreck / von_neumann_nuke_first.md
Created March 31, 2023 18:53
John von Neumann and his game-theory-based argument for a nuclear first strike: An analysis with GPT-4

Nuclear First Strike Controversy

You:

Did John von Neumann really advocate for a nuclear first strike using game theory to argue for it? Was his game theory argument valid, or did it have flaws?

ChatGPT:

John von Neumann, a brilliant mathematician and one of the founding figures of game theory, was known for his work on the strategic aspects of nuclear war. During the early years of the Cold War, he advocated for a strong deterrence policy against the Soviet Union, including the possibility of a nuclear first strike. However, it's important to note that von Neumann's views on this issue were complex and evolved over time.

Von Neumann's game theory argument for a nuclear first strike was based on the concept of minimax, which suggests that players in a game should minimize their maximum possible loss. In the context of a nuclear conflict between the United States and the Soviet Union, von Neumann believed that a preemptive strike would minimize the potential damage to the United States by elimin

@pmarreck
pmarreck / not_tomorrow_tomorrow_tomorrow.md
Created March 30, 2023 00:52
ChatGPT completely fabricates a book summary without any warning

Tech Book Summary.

You:

Summarize the book “tomorrow, tomorrow, tomorrow”

ChatGPT:

"Tomorrow, Tomorrow, Tomorrow" is a speculative fiction novel by acclaimed author Jane Simmons. Set in a near-future world where technology has advanced rapidly, the story follows protagonist Alex Thompson, a young and ambitious scientist working on a revolutionary project that promises to alter the course of human history: the ability to manipulate time.

Alex's work leads him to develop a time-traveling device, which he believes will solve humanity's most pressing issues, such as climate change, overpopulation, and political strife. However, as he begins to experiment with the device, he soon discovers that meddling with time has unforeseen and far-reaching consequences.

@pmarreck
pmarreck / drandom.bash
Last active March 27, 2023 19:06
Deterministic random number generator in Bash
# deterministic random number generator
# Usage: [DRANDOM_SEED=<whatever>] drandom [-h|--hex|--help]
# Outputs an integer between 0 and 2^256-1 or an equivalent hex string if -h|--hex is specified
drandom() {
needs sha256sum || return 1
# if unset, initialize to hash of nanoseconds since epoch,
# otherwise, set to hash of previous seed
if [ -z $DRANDOM_SEED ]; then
export DRANDOM_SEED="$(date +%s%N | sha256sum | cut -d' ' -f1)"
else