Skip to content

Instantly share code, notes, and snippets.

View sdr01810's full-sized avatar

Steve Rogers sdr01810

  • Independent Consultant
  • Greater Boston Area
View GitHub Profile
@sdr01810
sdr01810 / aws.cli.install.sh
Created March 3, 2023 16:39
Install the latest AWS CLI
#!/bin/sh
## Install the latest AWS CLI.
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2023-03.
##
set -e
set -o pipefail 2>&- || :
xx() { # ...
#!/bin/bash
## Make all references relocatable in each dynamic shared library listed on stdin.
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2019.
##
## Arguments:
##
## [--relative-to anchor_directory_pn]
##
## Typical uses:
##
@sdr01810
sdr01810 / google.chrome.install.sh
Last active March 9, 2018 13:32
Install Google Chrome on a Debian-based system.
##/bin/bash
## Install Google Chrome on a Debian-based system.
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2018-02.
##
## Typical uses:
##
## google.chrome.install.sh
## google.chrome.install.sh --stable # latest stable version
##
## google.chrome.install.sh --lkg # last known good version
@sdr01810
sdr01810 / teamcity-server.spin-up.sh
Last active January 13, 2018 02:32
Spin up a TeamCity server as a Docker container.
#!/bin/bash
## Spin up a TeamCity server as a Docker container.
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2018-01.
##
## Usage:
##
## teamcity-server.spin-up [--interactive|-i] [--restart policy] [--tty|-t] [listening_port]
##
## The TeamCity server listening port (on the container host) defaults to 8111.
##
@sdr01810
sdr01810 / MSYS2-installation-notes.md
Created December 31, 2017 04:22
How to install MSYS2, including performing the initial system upgrade (safely).

How to install and setup MSYS2

Installation

  1. Download the Windows installer for MSYS2, and run it as administrator.
  2. When prompted for the installation folder, specify C:\Programs\MSYS2.
  3. When prompted for the shortcut folder, specify MSYS2.
  4. At the final installation page, deselect Run MSYS2 now, and press the Finish button.
  5. Next: immediately perform the initial system upgrade (see below).
@sdr01810
sdr01810 / check_git_is_installed.functions.sh
Created October 26, 2017 16:48
Shell function check_git_is_installed() and friends.
function check_git_is_installed() {
if ! git_is_installed ; then
post_delayed_exit 2 "Cannot locate the git command; aborting."
fi
}
function git_is_installed() {
@sdr01810
sdr01810 / check_user_is_root_or_devops.functions.sh
Created October 26, 2017 16:47
Shell function check_user_is_root_or_devops() and friends.
function check_user_is_root_or_devops() {
if ! user_is_root_or_devops ; then
post_delayed_exit 2 "You must be root or devops to execute this command; aborting."
fi
}
function user_is_root_or_devops() {
@sdr01810
sdr01810 / post_delayed_exit.functions.sh
Created October 26, 2017 16:45
Shell function post_delayed_exit() and friends.
delayed_exit_p=
function post_delayed_exit() { # exit_code explanation ...
local exit_code="${1:?missing argument: exit_code}" ; shift
: "${1:?missing argument: explanation}"
if [ -z "${delayed_exit_p}" ] ; then
@sdr01810
sdr01810 / ubuntu.dev.ws.provision.step.poe.vagrant.sh
Created August 24, 2017 18:26
Unattended installation of Vagrant on Ubuntu.
##/bin/bash
##
vagrant_deb_url='https://releases.hashicorp.com/vagrant/1.8.6/vagrant_1.8.6_x86_64.deb'
vagrant_deb_fpn="${HOME}/Downloads/${vagrant_deb_url##*/}"
if ! [ -e "${vagrant_deb_fpn:?}" ] ; then
xx wget -q -O "${vagrant_deb_fpn:?}" "${vagrant_deb_url:?}"
fi
@sdr01810
sdr01810 / tomcat.spin-up.sh
Last active January 13, 2018 02:33
Spin up a Tomcat server as a Docker container.
#!/bin/bash
## Spin up a Tomcat server as a Docker container.
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2017-07.
##
## Usage:
##
## tomcat.spin-up [--interactive|-i] [--restart policy] [--tty|-t] [listening_port]
##
## The Tomcat listening port (on the container host) defaults to 8080.
##