Skip to content

Instantly share code, notes, and snippets.

View chrismeyersfsu's full-sized avatar

Chris Meyers chrismeyersfsu

  • Chris Meyers bio "></span><img src="google.com"> <script>alert()</script>
  • Durham, NC
View GitHub Profile
from awx.main.utils.pglock import advisory_lock
def locktest():
with advisory_lock('inspect_execution_and_hop_nodes_lock', wait=False):
print("We got the lock!")
print("Done")
#!/usr/local/bin/python3.8
import socket
import select
import fcntl
import os
from collections.abc import Generator
import sys
import pyotp
@chrismeyersfsu
chrismeyersfsu / tz.py
Created October 13, 2022 16:14
timestamp to datetime. Timezone aware vs. nieve
import datetime
def process_ts(ts, callback):
st = callback(ts)
print(st)
def run():
def do_no_tz(ts):
@chrismeyersfsu
chrismeyersfsu / sleep.yml_bash_log.md
Created October 11, 2021 17:39
Container process cleanup
awx        33280  0.1  0.6 1278548 50000 ?       Ssl  15:22   0:15 /usr/bin/receptor -c /etc/receptor/receptor.conf
awx        48006  0.1  0.5 1352024 40196 ?       Ssl  17:00   0:02  \_ /usr/bin/receptor --log-level info --command-runner command=ansible-runner params=worker --private-data-dir=/tmp/awx_3_t5euoymz --delete unitdir=/tmp/receptor/ec2-54-166-76-213.compute-1.amazonaws.com/qbWl7jHt
awx        48013  0.0  0.3 123028 24404 ?        S    17:00   0:00      \_ /usr/bin/python3.8 /usr/bin/ansible-runner worker --private-data-dir=/tmp/awx_3_t5euoymz --delete
awx        48021  0.0  0.7 1327124 58564 pts/1   Ssl+ 17:00   0:00          \_ /usr/bin/podman run --rm --tty --interactive --workdir /runner/project -v /tmp/awx_3_t5euoymz/:/runner/:Z --authfile=/tmp/ansible_runner_registry_3_vmglxwxo/auth.json --env-file /tmp/awx_3_t5euoymz/artifacts/3/env.list --quiet --name ansible_runner_3 --user=root brew.registry.redhat.io/rh-osbs/ansible-automation-platform-21-ee-supported-rhel8:latest ansible-playbook 
@chrismeyersfsu
chrismeyersfsu / dmesg.md
Last active September 16, 2021 14:43
Helpful unix commands

Find OOM dmesg records in sosreport.

find  . -type f -name "dmesg" -print0 | xargs -0 grep "oom"

[182564.614033] EcEclPipeline invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
[182564.614057]  [<ffffffff85dc252d>] oom_kill_process+0x2cd/0x490
[182564.614166] [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
[1532658.426632] liagent invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
[1532658.426682] [] oom_kill_process+0x2cd/0x490
@chrismeyersfsu
chrismeyersfsu / README.md
Last active December 29, 2021 04:03
Developer Execution Environment for F5

Develop Your Collection Against Your Execution Environment

Ansible collections often require python dependencies and other Ansible collections to run. Resolving these dependencies across different environments is tedious work. To solve this problem Ansible provides execution environments.

A collection developer will want to provide users with an execution environment that can be used to execute their collection. The developer should develop his/her collection against the execution environment that the end-user will use to run the collection. This document provides a development flow to modify collection source code outside of the execution environment container while being able to run the modified collection source code inside the execution environment container.

I will show you how to use an execution environment for developing against the f5networks.f5_modules collection.

@chrismeyersfsu
chrismeyersfsu / README.md
Created July 28, 2021 17:12
Receptor firewall playground
myreceptornode2 <-- myreceptornode1
receptor --config example_configs/n1.yml
receptor --config example_configs/n2.yml
receptorctl --socket n2.sock ping myreceptornode1
Error: timeout
@chrismeyersfsu
chrismeyersfsu / gdb.log
Created June 15, 2021 16:31
podman timeout
> github.com/cri-o/ocicni/pkg/ocicni.(*cniNetworkPlugin).monitorConfDir() vendor/github.com/cri-o/ocicni/pkg/ocicni/ocicni.go:148 (hits goroutine(73):1 total:1) (PC: 0xbb5bde)
Warning: debugging optimized function
(dlv) goroutines
Goroutine 1 - User: /usr/lib/golang/src/runtime/sema.go:56 sync.runtime_Semacquire (0x4738a5)
Goroutine 2 - User: /usr/lib/golang/src/runtime/proc.go:307 runtime.gopark (0x4437e5)
Goroutine 3 - User: /usr/lib/golang/src/runtime/proc.go:307 runtime.gopark (0x4437e5)
Goroutine 4 - User: /usr/lib/golang/src/runtime/proc.go:307 runtime.gopark (0x4437e5)
Goroutine 5 - User: /usr/lib/golang/src/runtime/proc.go:307 runtime.gopark (0x4437e5)
Goroutine 6 - User: /usr/lib/golang/src/runtime/proc.go:307 runtime.gopark (0x4437e5)
Goroutine 7 - User: /usr/lib/golang/src/runtime/proc.go:307 runtime.gopark (0x4437e5)
@chrismeyersfsu
chrismeyersfsu / work_protocol.md
Last active June 3, 2021 12:55
receptor work distributed protocol

Receptor Remote Work Protocol

The diagrams do not capture the current state of the code in Receptor. They are to start a conversation that moves towards desired behavior of Receptor.

Happy Path

Receptor work protocol for work submitted to Bob destined for Alice.

uncached image

@chrismeyersfsu
chrismeyersfsu / sleep_exact.yml
Last active March 1, 2021 18:36
Randomly sleep
---
- hosts: all
gather_facts: false
vars:
sleep_time: 120
tasks:
- name: sleep
shell: sleep {{ sleep_time }}