- 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 hidden or 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 | |
''' | |
This gist is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. | |
''' |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 = [email protected] | |
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 hidden or 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 hidden or 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