- command line values (for example, -u my_user, these are not variables)
- role defaults (defined in role/defaults/main.yml)
- inventory file or script group vars
- inventory group_vars/all
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 boto3 | |
def get_paginated_results(product, action, key, credentials=None, args=None): | |
args = {} if args is None else args | |
credentials = {} if credentials is None else credentials | |
return [y for sublist in [x[key] for x in boto3.client( | |
product, **credentials).get_paginator(action).paginate(**args)] | |
for y in sublist] |
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
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
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 | |
import sys | |
def read_smaps(pidlist): | |
try: | |
print("PID\tRSS\tSHARED\t\tNONE_SHARED") | |
mem = lambda t, f: int(f[1]) if f[0] == '%s:' % t else 0.0 | |
for pid in pidlist: | |
filename = "/proc/%s/smaps" % pid |
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
class AndroidXMLDecompress(): | |
endDocTag = 0x00100101 | |
startTag = 0x00100102 | |
endTag = 0x00100103 | |
def decompressXML(self, xml: bytearray) -> str: | |
finalXml = str() | |
numbStrings = self.LEW(xml, 4*4) |
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
""" | |
Convert YouTube subtitles(vtt) to human readable text. | |
Download only subtitles from YouTube with youtube-dl: | |
youtube-dl --skip-download --convert-subs vtt <video_url> | |
Note that default subtitle format provided by YouTube is ass, which is hard | |
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which | |
is easier to process. |
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
[user] | |
name = Brad Wilson | |
email = dotnetguy@gmail.com | |
signingkey = 0B7BD15AD1EC5FDE | |
[alias] | |
a = add -A | |
abort = rebase --abort | |
amend = commit --amend -C HEAD | |
bclean = "!f() { git switch ${1-main} && git branch --merged ${1-main} | grep -v ${1-main}$ | xargs git branch -d; }; f" | |
bdone = "!f() { git switch ${1-main} && git up && git bclean ${1-main}; }; f" |
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
// host will be passed in the groovy bindings for extended choice plugin. | |
def getVersion = { host, path -> | |
try { | |
def version = new groovy.json.JsonSlurper().parse(new URL("https://${host}${path}")).version | |
return version | |
} catch(Exception e) { | |
return null | |
} | |
} |
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
from keras.models import load_model | |
from keras.layers import Input, Dense | |
from tensorflow import Tensor | |
from keras import backend as K | |
from keras.engine import InputLayer | |
model = load_model('MyModel.h5') | |
for layer in model.layers: | |
print layer |
This tutorial leverages the Google Cloud Platform to streamline provisioning of the compute infrastructure required to bootstrap a Kubernetes cluster from the ground up. Sign up for $300 in free credits.
Estimated cost to run this tutorial: $0.22 per hour ($5.39 per day).
NewerOlder