Random recipes of JMESPath for the AWS CLI tools that I might have written or stumbled upon.
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
sequence: | |
- if: | |
- condition: template | |
value_template: >- | |
{{ | |
int(states('sensor.openweathermap_humidity')|regex_replace(find='%', | |
replace='', ignorecase=False)) > 25}} | |
- condition: template | |
value_template: >- | |
{{ |
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 | |
OWNER=org | |
REPO=therepo | |
#GET DAT SHIZ | |
WORKFLOW_ID=$(gh workflow list|rev|cut -f 1|rev) | |
#DELETE DAT SHIZ | |
for i in ${WORKFLOW_ID[@]}; do | |
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$i/runs | jq '.workflow_runs[] | .id' | |
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$i/runs | jq '.workflow_runs[] | .id' | xargs -I{} gh api -X DELETE /repos/$OWNER/$REPO/actions/runs/{} |
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
# Install Time Machine service on CentOS 7 | |
# http://netatalk.sourceforge.net/wiki/index.php/Netatalk_3.1.7_SRPM_for_Fedora_and_CentOS | |
# http://confoundedtech.blogspot.com/2011/07/draft-draft-ubuntu-as-apple-time.html | |
yum install -y rpm-build gcc make wget | |
# install netatalk | |
yum install -y avahi-devel cracklib-devel dbus-devel dbus-glib-devel libacl-devel libattr-devel libdb-devel libevent-devel libgcrypt-devel krb5-devel mysql-devel openldap-devel openssl-devel pam-devel quota-devel systemtap-sdt-devel tcp_wrappers-devel libtdb-devel tracker-devel | |
yum install -y bison docbook-style-xsl flex dconf |
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 | |
import os | |
import re | |
import sys | |
import time | |
import math | |
import json | |
import boto | |
import boto3 | |
import random |
I hereby claim:
- I am gyoza on github.
- I am realdh (https://keybase.io/realdh) on keybase.
- I have a public key ASA3c4oQ_Ej8YFCkHXB-ODUb59bF8gkbV53bUzODgymwTAo
To claim this, I am signing this object:
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.7 | |
import iterm2 | |
import re | |
import os | |
import socket | |
import pprint | |
import asyncio | |
def sshToProccesTextRedux(lines): |
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.6 | |
import os | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By as by | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as expect | |
CHROME_PATH = '/usr/bin/google-chrome' |
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
import sqlite3 | |
db = sqlite3.connect('yomomma.db') | |
tables = { | |
"table1" : { | |
"stuff" : "INTEGER unique PRIMARY KEY", | |
"stuff2" : "INTEGER", | |
"stuff3" : "INTEGER", | |
}, |
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
{{/* get unix times for systems in service group */}} | |
{{range ls "mykv/myservice"}} | |
{{ $int := .Value | parseInt}} | |
{{ scratch.MapSetX "nodetimes" .Key $int}}{{ end }} | |
{{/* create map of names */}} | |
{{ range service "myservice|passing" }} | |
{{ $node := .Node }} | |
{{ scratch.MapSetX "names" $node $node }}{{ end }} | |
{{/* create map of time differences from "now" for each server */}} | |
{{ range $hkey, $hval := scratch.Get "nodetimes" }} |
NewerOlder