Skip to content

Instantly share code, notes, and snippets.

View todgru's full-sized avatar

todgru

  • Portland, OR
View GitHub Profile
@todgru
todgru / slack-github-preview-unfurl.md
Created November 10, 2025 17:31
disable github slack preview unfurl
  1. in channel type /github settings,
  2. select "mute" url preview
  3. in channel type /github settings,
  4. select "disable" pr preview
@todgru
todgru / launchd.md
Last active October 18, 2025 20:44
Launchd and plist, replace cron in Mac OS X

#launchd Usage

I have a bash script called foo.sh that takes one command line argument, bar. I want it to run every 60 seconds and load at startup.

  • an XML plist is Apple Property List
  • com.mydomain.foo.plist Name of launchd plist file should be a reverse fqdn, like (this may not be required, but convention)
  • com.mydomain.foo.plist lives in $HOME/Library/LaunchAgents and is ran as that user.
  • com.mydomain.foo.plist can also live /Library/LaunchDaemons or /Library/LaunchAgents, have requirements, ran as root
  • Load plist with launchctl load com.mydomain.foo.plist
  • Unload plist with lauchctl unload com.mydomain.foo.plist
@todgru
todgru / aws-ec2-redis-cli.md
Created June 12, 2014 23:01
AWS redis-cli on EC2
@todgru
todgru / elasticsearch-setup-apple-macbook-pro-m1.md
Created February 9, 2023 23:52
Install Elasticsearch 7.x on Apple Macbook Pro M1 Ventura 13.2

Elasticsearch Setup Apple MacBook Pro M1

Apple MacBook Pro M1, 32 GB, Ventura 13.2

Documentation based on comments in this Github Elasticsearch issue.

Install Homebrew

ERR_REQUIRE_ASYNC_MODULE

Node 20.18.0 vs 20.19.0

Error [ERR_REQUIRE_ASYNC_MODULE]: require() cannot be used on an ESM graph with top-level await. 
Use import() instead. To see where the top-level await comes from, use --experimental-print-required-tla.

This error is due to a Node.js updating the name of the error with a special "backport" of the require(esm) feature.

@todgru
todgru / rebase.md
Last active May 20, 2025 15:42
git rebase interactive remove commit

#git rebase -i <sha>

List of commits from git log

F--E--D--C--B--A

Lets say you want to remove commit D from the commits.

git rebase -i E

@todgru
todgru / python-virtual-env.md
Last active February 17, 2025 22:20
python virtual environments with autoload version

Mac OS X python virtual environments setup for new or existing projects

install pyenv

# install pyenv
curl https://pyenv.run | bash

# set env vars to support pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
@todgru
todgru / git-rebase-interactive.md
Last active February 13, 2025 19:33
git interactive rebase

#Git Interactive Rebase

Scenario: We have a topic branch we've been working on. We want to combine the last few commits into one single commit. Our intention is to merge this topic branch, with one clean commit, into our main dev branch.

Solution: Git Rebase Interactive

Checkout your topic branch and look at your commit history:

$ git checkout topic-branch
@todgru
todgru / gist:48b1482e64d1318a4dc429545ace43ce
Created February 23, 2017 18:38 — forked from ilguzin/gist:6606011
How to convert Java Key Store file to pem/key for nginx
1. Convert our ".jks" file to ".p12" (PKCS12 key store format):
keytool -importkeystore -srckeystore oldkeystore.jks -destkeystore newkeystore.p12 -deststoretype PKCS12
1.1. List new keystore file contents:
keytool -deststoretype PKCS12 -keystore newkeystore.p12 -list
2. Extract pem (certificate) from ".p12" keysotre file:
@todgru
todgru / conventional-commits-cheatsheet.md
Created January 31, 2025 16:17 — forked from qoomon/conventional-commits-cheatsheet.md
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default