Consumes an API that uses OAuth.
Copy the file example.service.cnf
to service.cnf
and change the configuration variables to your liking, then:
$> python2 oauth-consumer.py [http method] [uri] [data]
For example:
#!/bin/bash -e | |
# | |
# GUNICORN DEPLOY SCRIPT | |
# ---------------------- | |
# Script to deploy your application with Gunicorn. It can be called by your | |
# process manager (eg. supervisor). Your application should use a virtual | |
# environment in a subdirectory. | |
# | |
# Copyright (c) 2013-2014, T. Zengerink | |
# Licensed under MIT License. |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
BROWSER | |
------- | |
Get internet pages, send post requests, inspect HTML using BeautifulSoup | |
or simply check response codes of an URL. | |
Example usage: |
#!/bin/bash -e | |
# | |
# IPTABLES FIREWALL | |
# ----------------- | |
# Script for setting your iptables firewall. Configure the variables to your | |
# liking and start the firewall. Copy the file to `/usr/local/sbin` or the | |
# directory of your choice. | |
# | |
# Usage: `./firewall.sh [restart|start|stop|status]` | |
# |
#!/usr/bin/env python | |
""" | |
IP | |
~~ | |
Return visitors public IP address. | |
Copyright (c) 2014 Teun Zengerink | |
Permission is hereby granted, free of charge, to any person obtaining a | |
copy of this software and associated documentation files (the "Software"), |
deploy: | |
git checkout master | |
aws s3 sync . s3://pace.zengerink.com --cache-control "public, max-age=604800" --exclude ".git/*" --exclude "Makefile" |
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route('/') | |
def ip(): | |
return request.environ['REMOTE_ADDR'] + '\n' | |
if __name__ == '__main__': | |
app.run() |
#!/usr/bin/env python | |
''' | |
REORGANIZE | |
---------- | |
When your directory looks something like this: | |
/path/to/dir/photo-1.jpg | |
/path/to/dir/photo-2.JPG | |
/path/to/dir/video-1.mp4 |