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
| ---- Create Pods, Services and Config Maps | |
| kubectl create -f https://gist.github.com/samiriff/6798254d00b7f42592edbb4311b717fb/raw/ea8a318972896074912457de6716d545d91e9a2b/pgdb-config-map.yml | |
| kubectl create -f https://gist.github.com/samiriff/6798254d00b7f42592edbb4311b717fb/raw/ea8a318972896074912457de6716d545d91e9a2b/web-svc.yml | |
| kubectl create -f https://gist.github.com/samiriff/6798254d00b7f42592edbb4311b717fb/raw/ea8a318972896074912457de6716d545d91e9a2b/pgdb-svc.yml | |
| kubectl create -f https://gist.github.com/samiriff/6798254d00b7f42592edbb4311b717fb/raw/ea8a318972896074912457de6716d545d91e9a2b/web-pod.yml | |
| kubectl create -f https://gist.github.com/samiriff/6798254d00b7f42592edbb4311b717fb/raw/ea8a318972896074912457de6716d545d91e9a2b/pgdb-pod.yml | |
| ---- Create default HTTP backend | |
| kubectl create -f https://gist.github.com/samiriff/6798254d00b7f42592edbb4311b717fb/raw/76cb0baddd0fbbea0a82b8dad7bd5e848f0f85bc/default-http-backend |
This file has been truncated, but you can view the full file.
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
| { | |
| "swagger": "2.0", | |
| "schemes": [ | |
| "https", | |
| "http" | |
| ], | |
| "host": "ec2.amazonaws.com", | |
| "basePath": "/", | |
| "x-hasEquivalentPaths": true, | |
| "info": { |
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
| def startsWithDate(s): | |
| pattern = '^([0-2][0-9]|(3)[0-1])(\/)(((0)[0-9])|((1)[0-2]))(\/)(\d{2}|\d{4}), ([0-9][0-9]):([0-9][0-9]) -' | |
| result = re.match(pattern, s) | |
| if result: | |
| return True | |
| return False |
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
| def getDataPoint(line): | |
| # line = 18/06/17, 22:47 - Loki: Why do you have 2 numbers, Banner? | |
| splitLine = line.split(' - ') # splitLine = ['18/06/17, 22:47', 'Loki: Why do you have 2 numbers, Banner?'] | |
| dateTime = splitLine[0] # dateTime = '18/06/17, 22:47' | |
| date, time = dateTime.split(', ') # date = '18/06/17'; time = '22:47' | |
| message = ' '.join(splitLine[1:]) # message = 'Loki: Why do you have 2 numbers, Banner?' |
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
| parsedData = [] # List to keep track of data so it can be used by a Pandas dataframe | |
| conversationPath = './whatsappcollection/whatsapp_avengers.txt' | |
| with open(conversationPath, encoding="utf-8") as fp: | |
| fp.readline() # Skipping first line of the file (usually contains information about end-to-end encryption) | |
| messageBuffer = [] # Buffer to capture intermediate output for multi-line messages | |
| date, time, author = None, None, None # Intermediate variables to keep track of the current message being processed | |
| while True: | |
| line = fp.readline() |
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
| df = pd.DataFrame(parsedData, columns=['Date', 'Time', 'Author', 'Message']) | |
| df.head() |
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
| df.describe() |
OlderNewer