Skip to content

Instantly share code, notes, and snippets.

@globalq
globalq / awsCLIAutomation.sh
Created November 22, 2024 05:12 — forked from rodgtr1/awsCLIAutomation.sh
Script to authenticate with AWS CLI with MFA token
#!/bin/bash
set -e
# specify your MFA_DEVICE_ARN
MFA_DEVICE_ARN=YOURMFAARN
PATH_TO_CREDENTIALS_FILE=/path/to/.aws/credentials
echo $PATH_TO_CREDENTIALS_FILE
#1H = 3600
#2H = 7200
#3H = 10800

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.

@globalq
globalq / Workbook activated event.EXCEL.yaml
Created September 22, 2021 11:01
This sample shows how to register a workbook activated event handler.
name: Workbook activated event
description: This sample shows how to register a workbook activated event handler.
host: EXCEL
api_set: {}
script:
content: |
$("#register-event-handler").click(() => tryCatch(registerEventHandler));
async function workbookActivated(event: Excel.WorkbookActivatedEventArgs) {
await Excel.run(async (context) => {
@globalq
globalq / Blank snippet.EXCEL.yaml
Created September 22, 2021 08:29
Create a new snippet from a blank template.
name: Blank snippet
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@globalq
globalq / Wheel of colors.EXCEL.yaml
Created April 25, 2021 16:08
Uses chart formatting to draw a wheel with changing colors. Contributed by Alexander Zlatkovski.
name: Wheel of colors
description: >-
Uses chart formatting to draw a wheel with changing colors. Contributed by
Alexander Zlatkovski.
host: EXCEL
api_set: {}
script:
content: >
$("#wheel").click(wheelGo);
@globalq
globalq / Remove duplicates.EXCEL.yaml
Created April 25, 2021 15:56
Removes duplicate entries from a range.
name: Remove duplicates
description: Removes duplicate entries from a range.
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#delete-name").click(() => tryCatch(deleteName));
$("#delete-distributor").click(() => tryCatch(deleteDistributor));