This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Documentation: https://docs.brew.sh/Cask-Cookbook | |
# https://docs.brew.sh/Adding-Software-to-Homebrew#cask-stanzas | |
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! | |
cask "python-3-9" do | |
version "3.9.13" | |
sha256 "351fe18f4fb03be7afac5e4012fc0a51345f43202af43ef620cf1eee5ee36578" | |
url "https://www.python.org/ftp/python/#{version}/python-#{version}-macos11.pkg" | |
name "python-3-9" | |
desc "Python 3.9 for Mac via python.org" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted | |
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted | |
## Major bug fix updates produced after the final release of the | |
## distribution. | |
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted | |
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getGoogleSpreadsheetAsExcel() { | |
// Adapted from: | |
// https://stackoverflow.com/questions/39765110/google-script-convert-sheet-to-xlsx | |
let ss = SpreadsheetApp.getActive(); | |
let url = "https://docs.google.com/feeds/download/spreadsheets/Export?key=" + ss.getId() + "&exportFormat=xlsx"; | |
let options = { | |
"method": "get", | |
"headers": {"Authorization": "Bearer " + ScriptApp.getOAuthToken()} | |
}; | |
console.log(`Google API request (${options.method}): ${url}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from: | |
# https://docs.ceph.com/projects/cephadm-ansible/en/latest/index.html#samples | |
- name: Bootstrap cluster | |
hosts: ceph_mon1 | |
tags: cluster | |
become: true | |
gather_facts: false | |
roles: | |
- role: "nickjj.acme_sh" | |
tags: ["acme_sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
tags: ext_net | |
tasks: | |
- name: Check OS_ environment variables are available | |
assert: | |
that: | |
- os_images_auth['auth_url'] != "" | |
# Network and subnet adapted from: | |
# https://github.com/openstack/kolla-ansible/blob/22cc60b21f98bb0ae0b2d78f0465b6fbdf07d5a2/tools/init-runonce#L99-L103 | |
- name: External network in OpenStack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I could not get python-swiftclient to obtain its own auth token from Rackspace directly for a non-default region. | |
# Instead, I obtain one with the swiftly client and then use the `swift` CLI to download the container. | |
pip install -U python-swiftclient swiftly | |
export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/ | |
export OS_USERNAME=... | |
export OS_REGION_NAME=IAD | |
# Set your API Key as the password, not your password... | |
export OS_PASSWORD=... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker run --rm -e POSTGRES_PASSWORD=mysecretpassword -d postgres:13 | |
a9fd95ccfeaeaa94c0a0a39deac52e74f59841607258c6827eabd2b33972f633 | |
$ docker exec -it a9fd95ccfeaeaa94c0a0a39deac52e74f59841607258c6827eabd2b33972f633 bash | |
root@661543604ec8:/# apt-get update && apt-get install -y procps | |
<snip> | |
root@661543604ec8:/# psql -U postgres -c 'SELECT pg_sleep(60)' & | |
[1] 463 | |
root@661543604ec8:/# ps auxww | |
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | |
postgres 1 0.0 0.1 213072 27168 ? Ss 14:45 0:00 postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from: https://unix.stackexchange.com/a/260022/18065 | |
[Unit] | |
Description=Loads kernel module for USB OTG | |
After=iscsi.service | |
DefaultDependencies=false | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/sbin/modprobe g_mass_storage file=/dev/xyx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Disable onboard audio | |
replace: | |
path: /boot/config.txt | |
regexp: '^dtparam=audio=on$' | |
replace: '#dtparam=audio=on' | |
register: disable_onboard | |
when: dac_type is defined | |
- name: Enable DAC ({{ dac_type }}) | |
lineinfile: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
import select | |
import socket | |
import smpplib | |
class ThreadSafeClient(smpplib.client.Client): | |
""" | |
Thread-safe smpplib Client, adapted from: |
NewerOlder