cat service-2.json | jq '[paths(.)] | .[] | flatten| select ( . | index("CopyTagsToSnapshot") ) '
cat service-2.json | jq '[paths(.)] | .[] | flatten| select ( . | index("CopyTagsToSnapshot") ) | .[1]'
import json | |
import boto3 | |
import argparse | |
class Args(object): | |
import argparse | |
parser = argparse.ArgumentParser( | |
description='Allows user to execute a local script using SSM Run Commands') |
cat service-2.json | jq '[paths(.)] | .[] | flatten| select ( . | index("CopyTagsToSnapshot") ) '
cat service-2.json | jq '[paths(.)] | .[] | flatten| select ( . | index("CopyTagsToSnapshot") ) | .[1]'
# Docker Analysis | |
docker run -it -d --rm python top | |
sudo nsenter -n -t $(pgrep top) perf trace --no-syscalls --event 'net:*' ping 8.8.8.8 -c2 >/tmp/output.txt | |
grep -oP "net:.+:dev=.+? " /tmp/output.txt | |
# Instance Analysis | |
sudo perf trace --no-syscalls --event 'net:*' ping 8.8.8.8 -c2 2>/tmp/output.txt | |
grep -oP "net:.+:dev=.+? " /tmp/output.txt |
# Set default blocksize for ls, df, du | |
# from this: http://hints.macworld.com/comment.php?mode=view&cid=24491 | |
# ------------------------------------------------------------ | |
export BLOCKSIZE=1k | |
# some utils | |
trash () { command mv "$@" ~/.Trash ; } | |
alias lr='ls -R 2>/dev/null| grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less' | |
zipf () { zip -r "$1".zip "$1" ; } # zipf: To create a ZIP archive of a folder | |
qfind () { command find . -name "$@" 2>/dev/null ; } |
#as Reported in: https://github.com/pandas-dev/pandas/issues/38736 | |
import pandas as pd | |
from pandas import Timestamp | |
import matplotlib.pyplot as plt | |
a= {'Argentina': {Timestamp('2020-11-17 00:00:00'): 56.0}, | |
'Brazil': {Timestamp('2020-11-17 00:00:00'): 103.0}, | |
'Guatemala': {Timestamp('2020-11-17 00:00:00'): 99.0}, | |
'Ireland': {Timestamp('2020-11-17 00:00:00'): 53.0}, |
pigsplit
splits the file every 45 lines (general good size for PPT) and reate multiple PNGs - it doesn't respect langage-based line breaks so be careful
pigrtf
will format in RTF format and copy to the clipboard (on MAC) to paste directly into PowerPoint or Word
pig
will create a png with some safe defauls
pygmentize -N file
will try to guess the language formatter supported for this file
i=0 cat Revelation.json.txt| while read a | |
do | |
aws comprehend detect-entities --language-code "en" --text $a >/tmp/rev${i}.json | |
((i=i+1)) | |
done | |
cat /tmp/*.json | jq '.Entities[].Text' | sort -u | cut -d\" -f2 | grep -e '^[A-Z].*' |
REGEX remove blank lines:
FROM: http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/remove_blank_lines.html
FIND:
^(?:[\t ]*(?:\r?\n|\r))+
# This script will update the key CLI tools for managing EKS | |
eksctl version | |
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp | |
sudo mv /tmp/eksctl /usr/local/bin | |
eksctl version | |
kubectl version -o json | jq -r '.clientVersion.major + "." + .clientVersion.minor' | |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" | |
chmod +x ./kubectl |
echo '[filter "strip-notebook-output"]' >>.git/config | |
echo ' clean = "jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR"' >>.git/config | |
echo \*.ipynb filter=strip-notebook-output >.gitattributes |