Skip to content

Instantly share code, notes, and snippets.

View jondkelley's full-sized avatar
:octocat:

Jonathan D Kelley jondkelley

:octocat:
View GitHub Profile
@jondkelley
jondkelley / keybase.md
Created May 28, 2019 14:43
keybase.md

Keybase proof

I hereby claim:

  • I am jondkelley on github.
  • I am jondkelley (https://keybase.io/jondkelley) on keybase.
  • I have a public key ASCFZQZREFgmJFVe_RYCwP5WlKXg6FcHspzlIFaeIV3QAQo

To claim this, I am signing this object:

@jondkelley
jondkelley / diagnose_dns.py
Last active March 13, 2019 14:14
diagnose dns with dynect
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pip3 install dnspython3
# pip3 install dnspython
import json
import dns.resolver
import requests
import os
@jondkelley
jondkelley / gist:b2e693e07acfbc3dac97705464edc9bb
Created October 25, 2018 19:44
cat a file in Windows using ansible
---
- name: 'get newrelic-infra config'
win_shell: 'more newrelic-infra.yml'
args:
chdir: 'C:\Program Files\New Relic\newrelic-infra\'
executable: cmd
register: hello
- name: 'show newrelic-infra config'
#!/bin/bash

BASEDIR=$(dirname "$0")
LOGGING_PREFIX="gen_cert.sh >> "

PASSKEY=somekey

rm -f ${BASEDIR}/server.crt
@jondkelley
jondkelley / readme.md
Last active May 23, 2024 13:28
Linux Awesome Gists 1: Sending a file from command line one-liners

Send an attachment via email on bash using...

mailx

Install Debian/Ubuntu

  • apt-get install postfix

Alternatively, without the bloat of postfix

@jondkelley
jondkelley / 1_playbook_best_practices.md
Last active October 20, 2022 16:56
Linux Awesome Gists: Ansible Best Practices

Ansible Playbook Design & Best Practices

The complexity you might consider dictates the style of your environments as you see the examples 'good' 'better' and 'best' below. The best is not always better if it's a waste of time after all.

General best-advice writing root playbooks

Tips

  • Do use hosts: limiters to the least destructive inclusion group for added safety whenever possible.
  • Do use extended block notation if you need additional levels of control around playbook / role execution.
@jondkelley
jondkelley / example.sh
Last active September 23, 2018 21:29
example
#!/bin/bash
ARC="x86_64"
install_driver () {
arg1=$1
arg2=$2
arg3=$3
arg4=$4
echo $arg1 ${arg2} $arg3 $arg4
@jondkelley
jondkelley / smtpserver-python37-2.py
Last active September 19, 2018 02:40
Example of how to overload custom SMTP commands in asyncio smtp server in python3 along with an AMQP client
#!/usr/bin/env python3
# pip3 install aiosmtpd
from aiosmtpd.controller import Controller
from aiosmtpd.handlers import AsyncMessage
from aiosmtpd.smtp import SMTP, syntax
from asyncio import coroutine
import asyncio
import logging
import uuid
import logging
@jondkelley
jondkelley / smtpserver-python37-2.py
Created September 19, 2018 02:04
Example of how to overload custom SMTP commands in asyncio smtp server in python3 (no proxy or mailbox capability shown)
#!/usr/bin/env python3
# pip3 install aiosmtpd
from aiosmtpd.controller import Controller
from aiosmtpd.handlers import AsyncMessage
from aiosmtpd.smtp import SMTP, syntax
from asyncio import coroutine
import asyncio
import logging
import uuid
import logging