This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# quick script to make using inotifwatch easier for simple cases, | |
# such as when you are editiing files and you want to scp them to another | |
# system as soon as you make save changes. | |
# | |
# Brian Dowling | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# Script to help find cgroup cpu throttling in a k8s cluster | |
# | |
# Brian Dowling | |
# | |
import subprocess | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script helps you find something if you have tons of open panes... | |
# | |
# | |
# $0 '[a]bcdef' | |
notthispane=$TMUX_PANE | |
if [ "$1" = "-a" ]; then | |
notthispane='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from nats.aio.client import Client as NATS | |
import json | |
import asyncio | |
import logging | |
import argparse | |
import gzip | |
import glob | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Simple script to watch a source folder for changes and run rsync on demand as changes occur | |
# | |
SRC=$1 | |
DEST=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TASK [Filter data structures more easily] ********************************************************************************************************************************************************************************************** | |
task path: /home/bdowling/src/plays/kiss.yaml:14 | |
ok: [localhost] => { | |
"ansible_facts": { | |
"filtered": [ | |
{ | |
"age": 35, | |
"birthday": 1, | |
"id": 1, | |
"name": "Bob", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import argparse | |
import csv | |
import re | |
import os | |
import sys | |
def warn(*args, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/bash | |
# Step 1. Install pyenv | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc | |
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc | |
# Step 2. Install missing headers for all the Python modules to be built |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yes, there are many ways to simpify this, but it's just a quick hack... | |
getsship() { fgrep $( fgrep "$1" ~/.ssh/known_hosts |head -1| awk '{print $3}') ~/.ssh/known_hosts | egrep -o '(^[0-9\.]+)'; } | |
sshbyip() { name=$1; shift; ssh $(getsship "$name") "$@"; } | |
# and if you want tab completion (assuming _ssh tab completion loaded) | |
# this test doesn't work, not sure yet what best way to copy the complete from 'ssh' comand is yet given how it is dynamically loaded. | |
# and not avaialble at .bashrc loading.. if type _ssh >/dev/null; then | |
if shopt -q progcomp && [ -n "$BASH_COMPLETION_COMPAT_DIR" ]; then | |
complete -F _ssh sshbyip | |
complete -F _ssh getsship |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script to start or restart a left and right tmux session | |
# Can be called multiple times and does the right thing(tm) | |
# | |
# Makes use of swind and xdotool to arrange windows on screen | |
# https://gist.github.com/bdowling/ad87c58362af7c28806bb2292436222d | |
# | |
# by Brian Dowling | |
# |
NewerOlder