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 | |
# run with cron 0 17 * * * | |
# Run the command and capture the output | |
output=$(echo "stats" | nc -q 1 localhost 11211) | |
# Parse the output for desired stats | |
bytes=$(echo "$output" | grep "STAT bytes " | awk '{print $3/1024/1024}') | |
limit_maxbytes=$(echo "$output" | grep "STAT limit_maxbytes " | awk '{print $3/1024/1024}') | |
curr_connections=$(echo "$output" | grep "STAT curr_connections " | awk '{print $3}') |
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 keyboard | |
import time | |
flag = False | |
def execute(): | |
global flag | |
flag = not flag |
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
#this is extremely ugly but I made it in 20 minutes so take it or leave it | |
import textract | |
from collections import Counter | |
text = textract.process("FA2016Unedited.pdf", method='pdfminer') | |
utftext = text.decode('utf8', errors='ignore') | |
ascii_ = utftext.encode('ascii', errors='ignore').lower().replace(',',' ').replace('.','').replace('(','').replace(')','') | |
stopwords = ['what','who','is','you', 'a','at','is','he', 'of', 'and', 'in', 'as', 'to', 'the', 'with', 'a', 'for', 'is', 'A', 'from', 'caused', 'eg', 'image', 'are', 'following', 'have', 'due', 'can', 'this', 'step', 'most', 'makes', 'common', 'and/or', 'work', 'dr.', 'but', 'effect', 'which', 'right', 'left', 'occur', 'clinical', 'review', 'pages', 'it', 'no', 'human', '+', '-', ':', 'that', 'section', 'syndrome', '(eg', 'cell', 'disease', 'may', 'available', 'that', 'under', 'iii','cells', 'associated', 'not', 'ou', 'work', 'derivative', 'work', 'use', 'type', 'adapted', 'source', 'courtesy', 'your', 'effects', 'cause', 'risk', 'been', '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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../paper-input/paper-input.html"> | |
<link rel="import" href="../paper-button/paper-button.html"> |
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 inspect | |
def my_print(var): | |
callers_local_vars = inspect.currentframe().f_back.f_locals.items() | |
print str([var_name for var_name, var_val in callers_local_vars if var_val is var]) + " is " + str(var) |
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
def fetch_url(url, num_of_tries): | |
i = 0 | |
while i < num_of_tries: | |
try: | |
content = requests.get(url, verify=False) | |
if content.status_code != 200: | |
print content.status_code | |
print content.text | |
raise Exception("Not 200") | |
return content |