16 Sep 2014 The error message looks like this:
{ u ' status ' : { u ' http_code ' : 200 }, u ' contents ' : { u ' error ' : { u ' error_type ' : u ' Application Key Error ' , u ' error_message ' : u ' Please provide your Application Key in the URL as " ?app_key=<APP_KEY> " . ' }}}
After a few hours of trying to get past the Eventbrite API’s “Application Key Error”. I finally figured out that I needed to switch my request URL from:
"https://developer.eventbrite.com/json/event_new"
to:
"https://www.eventbrite.com/json/event_new"
14 Sep 2014 dc.js
13 Sep 2014 10 Sep 2014 This will change the results in a flask-admin index view based on GET parameters. In most cases, using filters to do this is probably a better idea.
from application import db
from application.views.modelview import ModelView
from application.models import Things # has an attribute called thing_type
class MyModelView(ModelView):
def get_query(self):
thing_type = request.args.get('type', None) # pretending we have a GET parameter called "type"
if thing_type == "type1":
return super(ModelView, self).get_query().filter(Things.thing_type.like('type1 %'))
elif thing_type == "type2":
return super(ModelView, self).get_query().filter(Things.thing_type.like('type2 %'))
else:
return super(ModelView, self).get_query()
# note, you can't define get_query inside of def index_view(self) 10 Sep 2014 from application import app
from flask import request, url_for, redirect
@app.route('/')
def index():
modified_args = dict(request.args)
modified_args['key'] = 'modified_value'
return redirect(url_for('my_view', **modified_args)) 03 Sep 2014 Mobify: SQLAlchemy memory magic
“If you can process the results of database queries iteratively (and very often you can), stream the results”
“Since the data needs to travel over the network from the database whether it’s streamed or not, this doesn’t add a huge overhead, but we’ll see that it reduces memory requirements.”
Example (using Flask-SQLAlchemy):
db . engine . execution_options ( stream_results = True ). execute ( query )
However, that’s not the full story when it comes to MySQLdb (MySQL-python). http://stackoverflow.com/a/3699677
If you’re going to do this with mysql, I recommend using oursql: https://pypi.python.org/pypi/oursql
03 Sep 2014 http://stackoverflow.com/a/14823968/1364191
If you’re going to be expecting more than one user on your flask server, you need to enable threading like this: app.run(host='0.0.0.0', port=5000, threaded=True)
Unfortunately, the threading makes Ctrl+C not work sometimes and I’ll have to kill the thread manually.
For better solutions for production, check out these WSGI solutions: Deploying Flask with a standalone WSGI server
01 Sep 2014 https://mosh.mit.edu/
Warning: As of 10/17/2014, it’s still in development and they haven’t implemented scrollback yet. However, you can use screen and view the scrollback with Ctrl+A then Esc.
31 Aug 2014 Pentoo - Linux distro for pen testing. VMware fusion - Most of the presenters were using a Macbook with VMware fusion managing their VMs. Chinavasion - One of the presentations mentioned this in the context of dealextreme, I’m assuming this site is similar. Kali linux - Another distro for pen testing. Open bts Sqlmap (SQLi injection) - Python tool used to tell if php pages were vulnerable to SQLi injection. C99 shell - PHP interface for shell level system functions. b374k shell - Another shell which allows an user to run file system, database, and shell commands from a web interface. Accunetix (xss) Business logic flaws in mobile operators Doskey /history - Will show you all the previous commands typed into command prompt. Maria DB - When oracle took over MySQL, it forked and maria db is still run by the previous developers. Firefox imacro - A presenter said he uses this for all of his bots. Burp repeater - Looks similar to fiddler, allows repeating http packets. Maybe only for Mac. Fritzing Groupie and Geocouch (couch dB) - This was used in combination with the unity engine to display clusters of map points in a video game. Steganography - The word for hiding data inside of other files. A presenter showed how histograms could be used. Femtocells - A personal cell tower. One of the presentations talked about how to use a femtocell to intercept text messages to a Verizon (CDMA) phone. Shark - Has something to do with a hadoop, good for storing large amounts of data. SuperTimeline 27 Aug 2014 alembic revision --autogenerate -m "<your message>"
alembic upgrade head
Problem: FAILED: Target database is not up to date. Solution: alembic upgrade head
Problem: No such revision '5000106def16' Solution:
sqlite3 db.sqlite3drop table alembic_version; (and exit, ctrl+d)alembic upgrade head