Last active
December 19, 2015 04:09
-
-
Save Drvanon/5894772 to your computer and use it in GitHub Desktop.
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
#With mod_rewrite | |
RewriteEngine on | |
RewriteRule ^/docs/(.+) http://localhost:5000$1 [R,L] |
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
* cd change directory | |
* ls list files | |
* rm remove | |
* rm -Rf remove directory | |
* mkdir make directory | |
* cp copy file | |
* copy -r copy directory |
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
from flask import Flask, render_template, request | |
from jemail import send | |
import json | |
app = Flask(__name__) | |
@app.route("/", methods=["GET", "POST"]) | |
def home(): | |
if request.method == "GET": | |
return render_template("home.html") | |
name = request.form['name'] | |
email = request.form['email'] | |
content = request.form['content'] | |
send('wachtwoord', content + '\n From: <' + email + '> ' + name) | |
return json.dumps({ | |
"name": name, | |
"email": email, | |
"content": content | |
}) | |
if __name__ == "__main__": | |
app.run(debug=True) |
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
-- download and install mod_rewrite for apache | |
-- append append_this_to_appache.txt to current apache server file | |
-- Download and install python3.3 and flask | |
-- Change wachtwoord in flask_server.py | |
-- Run flask_server.py | |
-- Be happy :) |
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 smtplib | |
def send(password, msg): | |
fromaddr = 'jejodoremi@gmail.com' | |
toaddrs = 'jejodoremi@gmail.com' | |
# Credentials (if needed) | |
username = 'jejodoremi' | |
# The actual mail send | |
server = smtplib.SMTP('smtp.gmail.com:587') | |
server.starttls() | |
server.login(username, password) | |
server.sendmail(fromaddr, toaddrs, msg) | |
server.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment