Skip to content

Instantly share code, notes, and snippets.

@jpeyret
jpeyret / parseansiblelog.py
Last active October 24, 2021 22:54
jq-based script to parse an Ansible json logfile obtained with `ANSIBLE_STDOUT_CALLBACK=json`
#!/usr/bin/env python
"""
Usage: parseansiblelog.py [OPTIONS] [HOSTNAME] LOGFILE
parse an Ansible json formatted log
required parameters: - HOSTNAME : hostname/IP as it appears in log i.e.
`192.169.1.70` to address task results from `"hosts": {"192.169.1.70":
{"_ansible_no_log": false`... - LOGFILE : log file
@jpeyret
jpeyret / A_way_to_filter_big_pycallgraphs.txt
Last active May 4, 2023 09:24
filtering a big pycallgraph svg
see readme.md
@jpeyret
jpeyret / test_with_debugger.py
Last active September 5, 2017 17:48
conditional debugging on unitttests
import unittest
import sys
import pdb
####################################
def ppdb(e=None):
"""conditional debugging
use with: `if ppdb(): pdb.set_trace()`
"""
return ppdb.enabled
@jpeyret
jpeyret / pushIpad.sh
Last active October 7, 2015 02:47
Small script to move a git repo onto Textastic text editor on iPad
#!/bin/bash
# **********************************
# configuration
# **********************************
#param 1 value - if nothing is specified, which git branch to export
default_gitbranch='master'
@jpeyret
jpeyret / diag.py
Last active September 29, 2015 22:04
small Python script to diagnose vagrant chef installations. plop in some things you want to check for and it'll export them in directory /vagrant/diag.out, as seen from the guest.
#!/usr/bin/env python
import os
import subprocess
import shutil
import pdb
import pprint
from subprocess import Popen, PIPE
from shlex import split