Skip to content

Instantly share code, notes, and snippets.

Avatar

Larry Smith Jr. mrlesmithjr

View GitHub Profile
@mrlesmithjr
mrlesmithjr / ansible-macos-homebrew-packages.yml
Last active Sep 14, 2022
Install MacOS Homebrew Packages With Ansible
View ansible-macos-homebrew-packages.yml
---
- name: Install MacOS Packages
hosts: localhost
become: false
vars:
brew_cask_packages:
- atom
- docker
- dropbox
- firefox
@mrlesmithjr
mrlesmithjr / duplicati_excludes.txt
Last active Sep 3, 2022
Duplicati backup exclude list for Linux, macOS, and Windows
View duplicati_excludes.txt
-[.*/.*/?packer_cache/]
-[.*\.DS_Store]
-[.*\.tmp]
-[/home/.*/.ansible_async/]
-[/home/.*/.ansible/]
-[/home/.*/.atom/]
-[/home/.*/.cache/]
-[/home/.*/.config/Duplicati/]
-[/home/.*/.cups/]
-[/home/.*/.docker/]
@mrlesmithjr
mrlesmithjr / gist:72e23d0a0cceefef553b83b4fce5d06f
Created Sep 18, 2020
Example GitLab CI Pipeline using Terraform, etc.
View gist:72e23d0a0cceefef553b83b4fce5d06f
---
# Most pre-req tooling, etc. is installed using jumphosts.yml playbook
variables:
ADMIN_EMAIL: mrlesmithjr@gmail.com
CLOUD_PROVIDER: Azure # Define Supported Cloud Provider (Azure)
GIT_CRYPT_ENABLED: "true" # Must be lowercase (true|false)
GIT_SUBMODULE_STRATEGY: recursive
ORGANIZATION: example_org
PROJECT_NAME: example_project
TERRAFORM_VERSION: 0.12.28
View haproxy.cfg
# Ansible managed
global
# Remote syslog servers
log 10.0.102.102:514 local0
#log-send-hostname
daemon
chroot /var/lib/haproxy
group haproxy
maxconn 40000
View flush_dns.py
#!/usr/bin/env python
# flush_dns.py
'''A handy script to flush dns cache for Linux/macOS/Windows.'''
import logging
from subprocess import Popen
from sys import platform
import psutil
@mrlesmithjr
mrlesmithjr / logstash_cisco_asa
Created Dec 12, 2014
Logstash parsing for Cisco ASA
View logstash_cisco_asa
# Cisco ASA
filter {
if "syslog" in [tags] and "pre-processed" not in [tags] {
if "%ASA-" in [message] {
mutate {
add_tag => [ "pre-processed", "Firewall", "ASA" ]
}
grok {
match => [
"message", "<%{POSINT:syslog_pri}>%{CISCOTIMESTAMP:timestamp} %{SYSLOGHOST:sysloghost} %%{CISCOTAG:cisco_tag}: %{GREEDYDATA:cisco_message}"
View maas_management.yml
---
- hosts: kvm_hosts
remote_user: remote
become: true
vars:
roles:
tasks:
- name: Capturing VM(s)
virt:
command: "list_vms"
@mrlesmithjr
mrlesmithjr / dig2JSON
Last active Feb 22, 2022
dig results to parsable json
View dig2JSON
foo=$(dig google.com +nocomments +noquestion +noauthority +noadditional +nostats | awk '{if (NR>3){print}}'| jq -R 'split("\t") |{Name:.[0],TTL:.[2],Class:.[3],Type:.[4],IpAddress:.[5]}' | jq --slurp .) | jq -n --argjson v $foo '{"foo": $v}'
View logstash.conf
input {
file {
path => "/var/log/nginx/access.log"
type => "nginx-access"
sincedb_path => "/var/log/.nginxaccesssincedb"
}
}
input {
file {
path => "/var/log/nginx/error.log"
View bro-ids_logstash.conf
# Bro-IDS Logstash parser
# Parts of this taken from http://www.appliednsm.com/wp-content/uploads/logstash-SObro22-parse.conf_.txt
#Logs being parsed:
#app_stats.log
#conn.log
#dns.log
#dpd.log
#files.log
#http.log