Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

David Norman deekayen

🏠
Working from home
View GitHub Profile
@deekayen
deekayen / Preferences.sublime-settings
Created Aug 3, 2020
Sublime Text settings for dnorman-macbook
View Preferences.sublime-settings
{
"color_scheme": "Packages/Theme - Monokai Pro/Monokai Pro (Filter Spectrum).sublime-color-scheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"font_face": "Source Code Pro",
"font_size": 16,
"ignored_packages":
[
"Vintage"
View blacklist.txt
googleads.g.doubleclick.net
fw.adsafeprotected.com
pagead2.googlesyndication.com
tpc.googlesyndication.com
s0.2mdn.net
cooper.logs.roku.com
austin.logs.roku.com
giga.logs.roku.com
scribe.logs.roku.com
adclick.g.doubleclick.net
@deekayen
deekayen / README.md
Last active Mar 5, 2020
Instructions on how to make various TLS certificate file outputs
View README.md
@deekayen
deekayen / prisma_alerts_jenkins.sh
Last active Mar 3, 2020
Jenkins/EL7 version of the Prisma Alerts to Splunk bridge bash script.
View prisma_alerts_jenkins.sh
#!/bin/bash
# For EL7:
# yum install curl jq
######################
# SET VALUES FOR THESE
# Prisma Cloud config
API="api2.prismacloud.io"
@deekayen
deekayen / prisma_alerts.sh
Last active Mar 3, 2020
Curl the Redlock Prism Cloud API to get alerts from last week then POST them into a Splunk HTTP event collector for alternate archival and analysis. Note the date calculation appends 3 digits of milliseconds from microtime for a total 13 digital epoch value.
View prisma_alerts.sh
#!/bin/bash
# For Mac, date is BSD based. We like GNU date parsing,
# which comes with sideloading date as a renamed gdate util.
# Use Homebrew to install some utilities: https://brew.sh
# brew install coreutils jq
######################
# SET VALUES FOR THESE
@deekayen
deekayen / .gitlab-ci.yml
Created Dec 16, 2019
Example Gitlab runner CI configuration file that would do Ansible linting and secret discovery.
View .gitlab-ci.yml
---
ansible-lint:
tags:
- ansible
script:
- ansible-lint --version
- git ls-files | grep yml | xargs ansible-lint --exclude=/home/gitlab-runner/.ansible/roles
ansible-review:
@deekayen
deekayen / smtptest.py
Created Dec 12, 2019
Written by Chris Koning as a demo python script to bootstrap a test scenario for checking ports in Molecule for the outcome of an Ansible playbook.
View smtptest.py
#!/usr/bin/env python3
from smtplib import SMTP
import http.client
print("Testing good SMTP")
try:
goodSmtp = SMTP(host="cioxhealth-com.mail.protection.outlook.com",port=25,timeout=10)
response = goodSmtp.noop()
@deekayen
deekayen / sponsor.yml
Created Dec 10, 2019
Sample block to plug my sponsor page on GitHub for placement at the end of an Ansible role task list
View sponsor.yml
---
- hosts: all
connection: local
tasks:
- debug:
msg:
- "****************************************"
- "| Sponsor deekayen to maintain this |"
@deekayen
deekayen / .gitignore
Last active Nov 28, 2019
Use Ansible to apply operating system routine maintenance and updates for CentOS and Red Hat servers. This example takes advantage of magic groups that are imported using AWS inventories in Ansible Tower for host filtering. Send extra-vars to limit the runtime by availability zone.
View .gitignore
*.keytab
*.retry
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
@deekayen
deekayen / tagging_compliance.yml
Last active Nov 21, 2019
Query AWS to find instances and volumes without Name tags using an Ansible playbook. In Ansible Tower, use a null inventory along with an AWS cloud credential. Extend this with another task to stop instances with no Name tag.
View tagging_compliance.yml
---
- hosts: 127.0.0.1
connection: local
become: no
vars:
aws_region: us-east-1
tasks: