Skip to content

Instantly share code, notes, and snippets.

View scottharwell's full-sized avatar

Scott Harwell scottharwell

  • Red Hat
  • Greensboro, NC
View GitHub Profile
@scottharwell
scottharwell / aap_azure_deploy.sh
Last active December 14, 2023 15:13
Example deploying Ansible Automation Platform as a Managed Application on Microsoft Azure using Fish shell
#!/usr/bin/env fish
set -x ANSIBLE_ACCESS_MODE "public";
set -x AZURE_DEPLOYMENT_SUBSCRIPTION "changeme";
set -x AZURE_APP_DEPLOYMENT_RESOURCE_GROUP "changeme";
set -x AZURE_APP_NAME "$ANSIBLE_ACCESS_MODE-deployment";
set -x AZURE_MANAGED_APP_RESOURCES_GROUP "mrg-$AZURE_APP_NAME";
set -x AZURE_REGION "eastus";
set -x AZURE_PUBLISHER "redhat";
set -x AZURE_OFFER "rhaapomsa";
set -x AZURE_PLAN "rh-aap-azure50pub-a1";
@scottharwell
scottharwell / VSCode Ansible Devcontainer.js
Created December 23, 2021 23:18
VSCode dev container definition for Ansible development
{
"extensions": [
"redhat.ansible",
"richie5um2.vscode-sort-json",
"zainchen.json"
],
"forwardPorts": [],
"image": "docker-registry.gso.harwell.me/scottharwell/vscode-ansible:latest",
"mounts": [
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind",
@scottharwell
scottharwell / Parallels Running Instance Dynamic Inventory.py
Last active October 16, 2021 13:36
Generates an Ansible dynamic inventory of running virtual machines in Parallels.
#!/usr/bin/env python3
import json
import os
import re
def get_running_instances():
stream = os.popen('prlctl list -o ip --no-header')
output = stream.read()
replaced = re.sub(r"\s.*\n", "\n", output)
@scottharwell
scottharwell / Ansible Project Precommit Hook.sh
Created September 30, 2021 00:10
Hook for Ansible projects that require a `yamllint` and `ansible-lint` check before any commit.
#!/usr/bin/env bash
# Run yamllint first to ensure that code passes checks
yamllint .
YAML_LINT=$?
# Go ahead and stop if yamllint fails since ansible-lint takes a while
if [ $YAML_LINT == 1 ]; then
exit 1
fi
#!/usr/bin/env fish
# Place this file in ~/.config/fish/functions/
# Then, the `avatar` functions will be available from your shell.
function avatar
###################################################
# Function Definitions
###################################################
@scottharwell
scottharwell / Resize App Icon Images.fish
Created August 6, 2020 11:17
Fish script that converts a 1024x1024px 72DPI image to the file sizes required by XCode
#!/usr/bin/env fish
if ! test -e ./AppIcon.png
echo "🚨 App icon file not found"
exit
end
echo "🎬 Creating Icons!"
cp ./AppIcon.png ./[email protected]
@scottharwell
scottharwell / B2C Service TypeScript Definitions.ts
Created August 6, 2020 10:58
Enhanced TS definition that does the following: • Removes global references and forces namespace use in projects • Adds objects and properties that are not published in the standard TS definition • Modernizes some of the naming for ease of use
declare module ORACLE_SERVICE_CLOUD {
var extension_loader: IExtensionLoader;
var extensionLoadPromise: IExtensionPromise<any>;
interface IExtensionLoader extends IExtensionDisposable {
load(appId: string, version?: string, userScriptList?: string[]): IExtensionPromise<IExtensionProvider>;
}
interface IExtensionDisposable {
dispose: () => void;
@scottharwell
scottharwell / VIM Configs
Created December 2, 2019 19:58
Additions to The Ultimate vimrc
set nu
set mouse=a
set guioptions+=a
set clipboard=unnamedplu
@scottharwell
scottharwell / npm_remove_proxy.sh
Created November 25, 2018 21:09
NPM Proxy Server Delete #npm #nodejs
npm config delete http-proxy; npm config delete https-proxy
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=KeeWeb
Exec=/opt/keeweb/KeeWeb
Icon=/opt/keeweb/128x128.png
Categories=Utility
Keywords=password;kee;keepass;key