Skip to content

Instantly share code, notes, and snippets.

View christopher-hopper's full-sized avatar
:octocat:
contributing

Christopher Hopper christopher-hopper

:octocat:
contributing
View GitHub Profile
@christopher-hopper
christopher-hopper / README.md
Created July 19, 2023 03:12
Stop Apple Music launching when bluetooth headset connects

Question

How do I stop Apple Music from launching whenever I connect a Bluetooth headset to my MacBook?

Background

I use a bluetooth headset for video calls using video conferencing software on macOS.

@christopher-hopper
christopher-hopper / README.md
Last active January 18, 2022 03:50
macOS Amazee.io Drupal example Docker Compose override

macOS Amazee.io Drupal example Docker Compose override

Override Docker Compose volumes in an Amazee.io Drupal example to use NFS mounts.

This can substantially improve the disk I/O performance when running disk heavy operations inside Docker containers. Specifically, we're looking to improve performance for operations like php composer install and composer update.

@christopher-hopper
christopher-hopper / README.md
Last active March 6, 2024 22:41
Stop Zscaler Netskope or Cylance services on macOS

Disable macOS Cylance Zscaler or Netskope

The following scripts can be used to disable common security compliance software that blocks access to the Internet on corporate managed macOS computers. These scripts will not uninstall the software.

You may be asked to enter a password for command operations that require elevated privileges via sudo. If you do not have permission to run commands as a root user with sudo then these scripts will not work for you.

@christopher-hopper
christopher-hopper / README.md
Created November 8, 2019 00:20
SSH config file

SSH Config

This is an example ~/.ssh/config file showing a common set-up with the following features:

  1. SSH Agent key forwarding into local virtual machines
  2. SSH Agent key forwarding into remote Acquia servers
  3. SSH alias for a personal bitbucket.org account (uses a different SSH key)
  4. Keychain Access configuration for macOS
@christopher-hopper
christopher-hopper / valid-jira-ticket-match-regex.md
Last active July 16, 2019 01:40
Perl-compatible regular expression to find valid JIRA ticket id in a commit message.

Yet another commit message check

Check a Git commit message, for a valid JIRA ticket, using a Perl compatible regular expression match.

  • Anywhere in the message
  • Looks like MSG-100 EG_MSG-100 MESG-100
  • Doesn't look like MSG-000 MSG-01 MSG-1234

NOTE: Will not work with valid ticket id ending in '-123'

@christopher-hopper
christopher-hopper / git-remote-merged.sh
Created June 7, 2019 08:31
Delete remote branches that have been merged to master.
#!/usr/bin/env bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
# Delete remote branches that have been merged to master.
#
# Usage:
#
# git-remote-merged.sh -f
#
# vagrant-hostmanager https://github.com/devopsgroup-io/vagrant-hostmanager
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp /home/*/.vagrant.d/tmp/hosts.local /etc/hosts
%admin ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
# See https://github.com/cogitatio/vagrant-hostsupdater#readme
# vagrant plugin vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
@christopher-hopper
christopher-hopper / macos-desktop-finder-toggle.sh
Last active November 21, 2018 05:23
macOS Desktop Finder Files Toggle
#!/bin/bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
#
# macOS Desktop Finder Files Toggle
#
# Toggle the use of Finder to display the contents of the Desktop folder as
# icons on the macOS desktop. Hides or Shows all Finder files icons on the
# Desktop.
#
# https://ss64.com/osx/defaults.html
@christopher-hopper
christopher-hopper / domains-test.sh
Last active November 16, 2018 03:40
Read domains from a file and follow each using an HTTP GET request
#!/usr/bin/env bash
# -----
# Read domains from a file and test HTTP GET request.
#
set -o errtrace
set -o pipefail
set -o errexit
set -o nounset
@christopher-hopper
christopher-hopper / wget-curl-response-headers.sh
Last active November 13, 2019 23:24
RESTful API testing response headers using wget or curl
# RESTful API testing
# wget
# - method: GET
# - output: response headers only
wget --server-response --quiet \
--output-document=/dev/null --output-file=- \
https://example.com/api/endpoint