Skip to content

Instantly share code, notes, and snippets.

View jabenninghoff's full-sized avatar

John Benninghoff jabenninghoff

View GitHub Profile
@jabenninghoff
jabenninghoff / update-docker-images.sh
Created September 1, 2023 21:42
Update Docker Images
docker images | awk '/^[a-z]/ { print $1}' | sed 's/.*/docker pull &/' | sh
@jabenninghoff
jabenninghoff / .zshrc
Last active June 26, 2023 19:56
Add homebrew to environment if installed (arm or intel)
# remove /usr/local/bin from /etc/paths
export PATH="$PATH:s/\/usr\/local\/bin://"
# add homebrew to environment
if [ -x /usr/local/bin/brew ]
then
eval "$(/usr/local/bin/brew shellenv)"
elif [ -x /opt/homebrew/bin/brew ]
then
export PATH="/usr/local/bin:/usr/local/sbin${PATH+:$PATH}"
@jabenninghoff
jabenninghoff / mac-open-man-as-pdf.md
Created August 31, 2020 04:13
Open a man page as a PDF on macOS

macOS: open a man page as a PDF

From the command line:

man -t <manpage> | open -f -a Preview.app

-t outputs as postscript, which Preview automatically converts to PDF.

@jabenninghoff
jabenninghoff / disable-catalina-upgrade.md
Last active March 24, 2021 00:22
Disable Catalina upgrade notifications and
patch file to implement workaround from https://github.com/oracle/vagrant-boxes/issues/178
--- /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/meta.rb.orig 2019-10-14 12:01:06.000000000 -0500
+++ /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/meta.rb 2020-01-18 14:17:54.000000000 -0600
@@ -64,6 +64,7 @@
"5.1" => Version_5_1,
"5.2" => Version_5_2,
"6.0" => Version_6_0,
+ "6.1" => Version_6_1,
}
@jabenninghoff
jabenninghoff / graylog-mongo.md
Last active December 10, 2017 15:14
Instructions for upgrading the graylog MongoDB database

Graylog uses mongo:3 in its docker-compose image, which automatically pulls the latest production version of MongoDB, but does not set the feature compatibility version. This will cause databases created in 3.2 or earlier to fail to start in 3.6.

Per https://docs.mongodb.com/manual/reference/command/setFeatureCompatibilityVersion/, this will show the current running compatibility version and upgrade from 3.4 to 3.6:

docker exec -it mongo_container /bin/bash
mongo
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )
exit
exit
@jabenninghoff
jabenninghoff / fix-osx-vnc-black-screen.md
Created August 30, 2017 12:21
Fix the VNC "Black Screen" on older versions of OS X

Occasionally on older versions of OS X, connecting to a remote system via VNC will result in a "Black Screen" that is non-responsive. To fix this, kill the loginwindow process:

$ ps ax | grep loginwindow
   83   ??  Ss     0:00.89 /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow console
$ sudo kill 83

loginwindow will automatically restart and the login screen will appear.

Thanks to Mac Mini World!

@jabenninghoff
jabenninghoff / homebrew-formula-pr-checklist.md
Last active February 13, 2017 04:38
Homebrew formula pull request checklist
  • Have you followed the guidelines for contributing?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install <formula>)?

@jabenninghoff
jabenninghoff / repro-5346.sh
Created January 22, 2017 14:50
Script to reproduce bundler issue #5436
#!/bin/sh
set -ex
mkdir -p /tmp/repro-5346
cd /tmp/repro-5346
cat > Gemfile <<EOF
source 'https://rubygems.org'
require 'json'
@jabenninghoff
jabenninghoff / osx-vnc-hidden-options.md
Last active March 15, 2024 11:40
RemoteManagement "hidden" options

macOS Sierra (and possibly earlier) has some "hidden" screen sharing options:

If you're connecting to VNC using ssh tunneling, you can force macOS to listen only on localhost:

sudo defaults write /Library/Preferences/com.apple.RemoteManagement.plist VNCOnlyLocalConnections -bool yes

In newer versions of macOS, screen sharing will automatically re-lock the screen when you disconnect if it was locked when you first connected. To change this behavior, use:

sudo defaults write /Library/Preferences/com.apple.RemoteManagement RestoreMachineState -bool NO