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 fileinput | |
x = "" | |
for line in fileinput.input(): | |
x += line | |
s = "" | |
i = 1 | |
while i < len(x): | |
if x[i] == '"': | |
i += 1 |
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 | |
# usage ./verify_splunk_coverage.py <log_file> | |
# set these from splunk-apps/apps/<service-name>/default/props.conf | |
BREAK_ONLY_BEFORE_REGEX=r'^\d\d:\d\d:\d\d\s\[[^\]]+\]' | |
EXTRACT_REGEX=r'^\d?\d:\d\d:\d\d\s\[(?P<thread>[^\]]+)\]\s\[(?P<loglevel>\w+)\]\s\[(?P<class>[^\]]+)\]\s\[(?P<username>[^\]]*)\](?P<message>.*)$' | |
import re,sys | |
f = open(sys.argv[1]) |
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
# Normal person mode | |
def next_server_number(l): | |
if len(l) < 1: | |
return 1 | |
for i in xrange(1, max(l)): | |
if i not in l: | |
return i | |
return max(l) + 1 | |
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
CACHES = { | |
‘default’: { | |
‘BACKEND’: ‘redis_cache.RedisCache’, | |
‘LOCATION’: [ | |
‘%s:%s’ % (os.getenv(‘REDIS_MASTER_SERVICE_HOST’, ‘127.0.0.1’), |
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
<section> | |
<section id="a-modular-workshop-series-for-learning-kubernetes"> | |
<h2><code>k8s-workshops</code></h2> | |
<p><a href="http://kubernetes.io/"><img src="https://pbs.twimg.com/profile_images/511909265720614913/21_d3cvM.png" alt="kubernetes" style='width:30%;'></a><br/>a modular workshop series for <a href="http://kubernetes.io/">Kubernetes</a></p> | |
<h3 class='fragment grow'><a href="http://bit.ly/k8s-workshops"><code>bit.ly/k8s-workshops</code></a></h3> | |
</section> | |
<section id='presented-by' data-markdown> | |
presented by | |
[](https://coreos.com) |
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
<section> | |
<section id="kubernetes-cli-basics-with-kubectl"> | |
<h2>Google Container Engine (GKE) Basics</h2> | |
<p><a href="http://kubernetes.io/"><img src="https://pbs.twimg.com/profile_images/511909265720614913/21_d3cvM.png" alt="kubernetes" style='width:30%;'></a><br/>with <a href="https://kubernetes.io/docs/user-guide/kubectl/"><code>kubectl</code></a></p> | |
<h4 class='fragment grow'><a href="http://bit.ly/k8s-kubectl"><code>bit.ly/k8s-kubectl</code></a></h4> | |
</section> | |
<section id='presented-by' data-markdown> | |
presented by | |
[](https://coreos.com) |
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 json | |
import time | |
import requests | |
input_file = open('liquid_matches.json') | |
matches = json.load(input_file) | |
input_file.close() | |
print('Loading {} matches\n'.format(len(matches))) | |
f = open('liquid_match_data.txt', 'w') |
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 Match: | |
def __init__(self, match, liquid_win): | |
self.match = match | |
self.liquid_win=liquid_win | |
self.liquid_picks = [] | |
self.liquid_bans = [] | |
self.opponent_picks = [] | |
self.opponent_bans = [] |
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
won_matches = list(filter(lambda m : m.liquid_win, processed_matches)) | |
print('Liquid won {} of the games.'.format(len(won_matches))) | |
wisp_banned = list(filter(lambda m: 'Io'in m.opponent_bans, processed_matches)) | |
wisp_matches = list(filter(lambda m: 'Io' in m.liquid_picks, processed_matches)) | |
print('Found {} out of {} games where Liquid picked Io.'.format(len(wisp_matches), len(processed_matches))) | |
print('Io was banned in {} matches.', len(wisp_banned)) |
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 Match: | |
def __init__(self, match, liquid_win): | |
self.match = match | |
self.liquid_win=liquid_win | |
self.liquid_picks = [] | |
self.liquid_bans = [] | |
self.opponent_picks = [] | |
self.opponent_bans = [] | |
OlderNewer