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";
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Apache Directory Studio
Exec=/opt/ApacheDirectoryStudio/ApacheDirectoryStudio
Icon=/opt/ApacheDirectoryStudio/features/org.apache.directory.studio.nls.feature_2.0.0.v20170904-M13/studio.png
Categories=Network;Development
Keywords=ldap;
@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
@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 ./AppIcon@1024x1.png
@scottharwell
scottharwell / Postman.desktop
Created October 27, 2017 12:59
Gnome Shell Desktop File for Postman Native App
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Postman
Exec=/opt/Postman/Postman
Icon=/opt/Postman/resources/app/assets/icon.png
Categories=Network;Development
Keywords=rest;api;
@scottharwell
scottharwell / start_jenkins_docker.sh
Created September 27, 2017 13:57
Docker start script for Jenkins.
#!/usr/bin/sh
docker pull jenkins/jenkins && \
docker run -d --name myjenkins \
-p 8083:8083 \
-p 50000:50000 \
-v /etc/timezone:/etc/timezone \
-v /var/jenkins_home/:/var/jenkins_home/ \
-v /var/lib/jenkins/cert:/var/lib/jenkins/cert \
-v /var/lib/jenkins/pk:/var/lib/jenkins/pk \
--env JENKINS_OPTS="--httpPort=-1 --httpsPort=8083 --httpsCertificate=/var/lib/jenkins/cert --httpsPrivateKey=/var/lib/jenkins/pk" \
#!/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 / 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;