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
| """ Basic file upload example for Flask | |
| Example provided for spitfiredd on thread | |
| https://www.reddit.com/r/flask/comments/5zen73/help_looking_to_create_a_simple_web_app_where_i/?ref=share&ref_source=link | |
| """ | |
| from flask import Flask, request, render_template, send_file | |
| app = Flask(__name__) | |
| # We need a secret key to work with form data |
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
| ## Makes folders and files for Flask | |
| def make_folders(folder, root_path): | |
| """ | |
| should be -[project name] | |
| |- project | |
| |- instance ## this holds configs, logs etc | |
| |- make_folders called here | |
| |- make_files called here(s) | |
| """ | |
| ##folders = ['static','templates','tests','users',] ## pass in to make it easier, base list, append other blueprints to list |
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
| Function GetEnv() | |
| Dim i As Integer | |
| i = 1 | |
| While Environ(i) <> Empty | |
| Debug.Print Environ(i) | |
| i = i + 1 | |
| Wend | |
| End Function |
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/python | |
| import pip | |
| import subprocess | |
| for package in pip.get_installed_distributions(): | |
| subprocess.call(['pip install --upgrade %s' % package], shell=True) |
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/python | |
| from socket import socket | |
| import time, argparse | |
| parser = argparse.ArgumentParser(description='This is a quick and dirty port scanner') | |
| parser.add_argument('-host','--hosts', help='Host to scan',required=True) | |
| parser.add_argument('-upl','--upls',help='Upper port limit', required=True) | |
| args = parser.parse_args() | |
| HOSTS = [str(args.hosts)] |
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/python | |
| from socket import socket | |
| import time, argparse | |
| parser = argparse.ArgumentParser(description='This is a quick and dirty port scanner') | |
| parser.add_argument('-h','--hosts', help='Host to scan',required=True) | |
| parser.add_argument('-u','--Upper_Port_Limit',help='Upper port limit', required=True) | |
| args = parser.parse_args() | |
| PORT_RANGE = args.Upper_Port_Limit |
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
| # List all files in current directory | |
| for item in glob.glob(os.path.join(".","*")): | |
| ... print item | |
| # Just .py files | |
| for item in glob.glob(os.path.join(".","*.py")): | |
| ... print item | |
| # just .txt files |
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 os | |
| # Works on current directory | |
| # todo, change to accept arg | |
| for item in os.listdir("."): | |
| if os.path.isfile(item): | |
| print item + " is file" | |
| elif os.path.isdir(item): | |
| print item + " is directory" | |
| else: | |
| print item + "what is this?" |
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 | |
| # From https://projecteuler.net/problem=1 | |
| j=0 | |
| for i in range(1, 1000): | |
| if i % 3 == 0 or i % 5 == 0: | |
| j +=i | |
| else: |
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 python2 | |
| import os | |
| import getpass | |
| import urllib2 | |
| from StringIO import StringIO | |
| import time | |
| import datetime | |
| import argparse | |
| import praw | |
| from bs4 import BeautifulSoup |