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
  • 17:54 (UTC -04:00)
  • X @pmarreck
  • LinkedIn in/petermarreck
View GitHub Profile
@pmarreck
pmarreck / randompass.js
Created July 5, 2023 20:06
Generate a random password or randomized multiple-word dictionary password using Javascript (NO other dependencies!)
const CHARSET_LOWER = "abcdefghijklmnopqrstuvwxyz";
const CHARSET_UPPER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const CHARSET_NUM = "0123456789";
const CHARSET_ALPHA = CHARSET_LOWER + CHARSET_UPPER;
const CHARSET_ALNUM = CHARSET_ALPHA + CHARSET_NUM;
const CHARSET_ALNUM_SANE = CHARSET_ALNUM.replace(/O|l|I/g, "");
// const CHARSET_PUNC = "!@#$%^&*-_=+[]{}|;:,.<>/?~";
// I shortened the possible punctuation chars due to incompatibility with various sites:
const CHARSET_PUNC = "!@#$%^&*";
const CHARSET_HEX = CHARSET_NUM + "abcdef";
@pmarreck
pmarreck / grandfather_clock_chime.bash
Last active June 27, 2023 02:29
Bash script to produce a grandfather clock sound on the hour with the number of gongs equal to the hour
This file has been truncated, but you can view the full file.
grandfather_gong() {
function needs() {
local bin=$1;
shift;
command -v $bin > /dev/null 2>&1 || {
echo "I require $bin but it's not installed or in PATH; $*" 1>&2;
return 1
}
}
@pmarreck
pmarreck / kill_steam_proton_pids.bash
Last active January 29, 2024 13:14
Automatically clean up any orphaned Steam or Proton processes on Linux if any didn't exit cleanly
#!/usr/bin/env bash
function kill_steam_proton_pids() {
# This bash one-liner performs the following tasks:
# 1. It sets the PS_PERSONALITY environment variable to 'linux' which standardizes the output format of the 'ps' command.
# 2. Runs the 'ps' command with the following options:
# - 'e' to include processes from all users,
# - 'o pid,args' to only show process ID and command arguments,
# - '--sort=-pid' to sort by process ID in descending order (so it kills the newest processes first),
# - '--no-headers' to not include column headers in the output.
@pmarreck
pmarreck / pmarreck_twitter_personality_profile.md
Last active March 15, 2025 16:54
Peter Marreck personality profile from ChatGPT4 based on Twitter profile

Twitter Account Owner Info

You

What can you tell me about the person who owns this twitter account? https://twitter.com/pmarreck

ChatGPT

The Twitter account @pmarreck is owned by Peter "Not an AI Doomer" Marreck. According to the description on his Twitter profile, Peter is a secular-humanist technologist. His interests include tech, Elixir (a dynamic, functional language designed for building scalable and maintainable applications), gaming, open source, Linux, Apple, biking, and sailing. He is also a United States Air Force (USAF) veteran. He uses the handle @[email protected] in addition to his Twitter handle. His professional background appears to be in software development, as he identifies himself as a software developer, programmer, and software engineer. He joined Twitter in August 2008​​.

You

Can you assess his personality from his tweets, replies and likes?

@pmarreck
pmarreck / materialism_incompleteness_with_chatgpt4.md
Created May 25, 2023 14:35
A philosophical debate with ChatGPT4+web browsing about materialism and consciousness

Materialist Model's Potential Incompleteness

pmarreck>

Is there any evidence that the materialist model of the human body is incomplete?

ChatGPT4>

The materialist model of the human body, often referred to as physicalism or materialism in the context of philosophy of mind, is the view that everything that exists is no more than the sum of its physical parts. This includes the human body and mind. According to this view, all phenomena, including thoughts, feelings, and consciousness, are the result of physical processes and can be explained through the laws of physics, chemistry, and biology.

This model has been incredibly useful in scientific understanding and has led to many advances in medicine and psychology. However, it is not without its challenges and criticisms, some of which suggest that it may be incomplete:

@pmarreck
pmarreck / split_file.bash
Last active December 5, 2023 02:00
Split a text file into a directory of files each of which contains 1 line from the original file
#!/usr/bin/env bash
# Ensure a file name is provided
if [ -z "$1" ]
then
echo "No file name provided. Usage: ./split_file.bash <filename>"
exit 1
fi
# Extract the directory and base name from the file
@pmarreck
pmarreck / on_the_ridiculon.txt
Created May 9, 2023 01:37
On the Ridiculon particle (taken from a 1997 Usenet post by Gregg E Economou and enhanced by ChatGPT4 in Douglas Adams' style)
Background: It has come to my attention that an abundance of baffling occurrences plague our universe.
Theory: A fundamental force exists, intricately intertwined with the rampant absurdity we witness.
Behold:
Introducing the latest particle, the ridiculon.
The ridiculon is the diligent messenger of the force of Ridiculosity.
Ridiculous things spew them at a rate directly proportional to the sheer ludicrousness or imbecility they possess, and these particles engage with matter through a cosmic dance known as universal ridiculosity thermalization, wherein stupidity yearns to disperse until it reaches an equitable distribution.
Ridiculons themselves are the noble steeds upon which ridiculosity gallantly spreads throughout the cosmos.
The more preposterous a thing, the more ridiculons it emits, and anything that survives the onslaught of nonscattering collisions with ridiculons becomes increasingly ridiculous each time such a collision transpires. Although the ridiculon is weightless whilst stationary, it acqui
@pmarreck
pmarreck / random_taoup_quote_awk_assistance.md
Created May 8, 2023 18:44
ChatGPT4 helps with `awk` script to alter output of `taoup` to get a single categorized quote

AWK Script for Quotes

You

I have a text file with a list of quotes (example excerpt below). Some of the lines are header lines for the section of quotes following, which begin with 3 or more hyphens. I want an awk script that selects a random non-header line, determines its header (the nearest line above it that starts with 3 or more hyphens), and then outputs the header and the line.

---- Characteristics of Innovative People ----
Iterate between abstract and concrete thinking.
Acknowledge the limits of your knowledge.
Step out of your comfort zone.
@pmarreck
pmarreck / shell_types_explained.md
Created May 3, 2023 14:42
Linux Shell and Login Types (and relevant configs read) Explained by ChatGPT-4

Shell Types Explained

You

In a Linux and shell context, what is the difference between a "login shell", an "interactive shell" and any other kind of logged-in mode?

ChatGPT

In the context of Linux and shell, there are several types of shells that can be opened, including login shells, interactive shells, and non-interactive shells. Here's a brief explanation of these types:

  1. Login Shell: A login shell is the first shell that is run when you log into a Unix-based system. This shell reads your profile file (like ~/.bash_profile, ~/.bash_login, or ~/.profile) to set environment variables and settings. A login shell typically ends with a shell prompt for user input.
  2. Interactive Shell: An interactive shell is a shell session that is ready to take commands from the user. It's "interactive" because it interacts directly with the user. Both login shells and non-login shells can be interactive. In an interactive shell, command history is kept, and the shell reads and executes the ~/.bashrc file upon
@pmarreck
pmarreck / nix_flakes_explanation_chatgpt4.md
Created April 28, 2023 20:06
Explanation of Nix/Nix Flakes to someone who is unfamiliar with them, courtesy of ChatGPT-4

Nix Flakes Explained

You

explain nix flakes to me like I'm a software developer but new to Nix.

Then explain the difference between "old Nix/NixOS" and Nix Flakes to me.

ChatGPT

Part 1: Introduction to Nix Flakes