Skip to content

Instantly share code, notes, and snippets.

David Norman deekayen

Block or report user

Report or block deekayen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@deekayen
deekayen / custom.css
Last active Dec 2, 2018
Mastodon admin site settings with scouting colors
View custom.css
@import url('https://fonts.googleapis.com/css?family=Roboto|Roboto+Slab');
body { font-family: 'Roboto', sans-serif }
.drawer__header, .column-header, .column-header__button, .column-header__back-button, .tabs-bar__link, .landing-page #mastodon-timeline .column-header { font-family: 'Roboto Slab', sans-serif; background: #003f87; color: #ffffff }
.tabs-bar__link.active { font-family: 'Roboto Slab', sans-serif; color: #e9e9e4; border-bottom: 2px solid #cd1126 }
.drawer__tab { font-family: 'Roboto Slab', sans-serif; color: #ffffff }
.button, .simple_form button, .simple_form .button, .simple_form .block-button { background-color: #ce1126 }
.flash-message.notice { background: #006b3f; color: #ffffff }
@deekayen
deekayen / Jenkinsfile
Last active Sep 19, 2018
Download and build amazon-efs-utils in a Jenkins pipeline
View Jenkinsfile
node() {
stage ('pre-clean') {
cleanWs()
}
stage ('clone scm') {
git 'https://github.com/aws/efs-utils.git'
}
stage ('build') {
sh '''#!/bin/bash
@deekayen
deekayen / main.yml
Created Aug 7, 2018
Ansible: loop through a string list. Could be useful for creating lots of EC2 instances passed from a textarea in Ansible Tower.
View main.yml
---
- hosts: all
connection: local
vars:
stuff: "asdf
asdfasdf
asdfasdfasdf
asdfasdfasdf
@deekayen
deekayen / runonce.bat
Created Jul 20, 2018
Run Once: Start WinRM for Ansible to connect to Windows
View runonce.bat
powershell.exe -Command "& {[Net.ServicePointManager]::SecurityProtocol = 'tls12'; Invoke-WebRequest -Uri https://raw.githubusercontent.com/ansible/ansible/7963279fc2c3a8cfa6affb70307bac6fa669679c/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile C:\Windows\Temp\ConfigureRemotingForAnsible.ps1}"
powershell.exe -ExecutionPolicy Bypass -File C:\Windows\Temp\ConfigureRemotingForAnsible.ps1 -SkipNetworkProfile -EnableCredSSP -ForceNewSSLCert -CertValidityDays 3650
@deekayen
deekayen / vault.sh
Last active Jul 18, 2018
Configure a default vault password file for Ansible AWX
View vault.sh
docker exec -it awx_task_containerid bash
vi /var/lib/awx/.vault_pass.txt
vi /etc/ansible/ansible.cfg
# add /var/lib/awx/.vault_pass.txt to ansible.cfg
exit
@deekayen
deekayen / upgrade.sh
Last active Jul 18, 2018
Upgrade Ansible AWX containers
View upgrade.sh
docker stop awx_task
docker rm awx_task
docker rmi ansible/awx_task:latest
docker stop awx_web
docker rm awx_web
docker rmi ansible/aws_web:latest
git pull
cd installer
@deekayen
deekayen / substr.yml
Created Mar 21, 2018
Ansible variable substring from regex_replace
View substr.yml
---
# RUN: ansible-playbook -i localhost, substr.yml
- hosts: localhost
vars:
stuff: deekayen@WINDOMAIN.COM
ansible_user: deekayen
tasks:
@deekayen
deekayen / gen_wildcard_csr.sh
Created Mar 13, 2018
Generate a multi subdomain-wildcard CSR.
View gen_wildcard_csr.sh
cat > csr_details.txt <<-EOF
[req]
default_bits = 3072
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
C=US
@deekayen
deekayen / ConfigureRemotingForAnsible.ps1
Last active Apr 16, 2019
Configure WinRM for Ansible powershell using SHA-2 certificate
View ConfigureRemotingForAnsible.ps1
#Requires -Version 3.0
# Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM (PS Remoting) configuration and makes
# the necessary changes to allow Ansible to connect, authenticate and
# execute PowerShell commands.
#
# All events are logged to the Windows EventLog, useful for unattended runs.
@deekayen
deekayen / monitor.ps1
Created Sep 8, 2017
Send an email alert with a list of files in a path older than 5 minutes.
View monitor.ps1
# Set-ExecutionPolicy Unrestricted
$src1="\\processing\files"
$sendmail=$false
Get-ChildItem -path $src1 -Recurse -File |
Foreach-Object {
$dtdiff = New-TimeSpan ($_.CreationTime) $(Get-Date)
if ($dtdiff.minutes -gt 5) {
$strbody=$strbody +$_.fullname+ " - Last Modified Time: " +$_.LastWriteTime +"`r`n"
You can’t perform that action at this time.