Pythonのプログラムを配布可能なアプリケーションを作成する方法について扱います。
コンピュータが理解できるのは突き詰めると、0と1だけです。そのため、プログラムを実行するには「プログラミング言語で書かれたテキストのプログラム」を0と1に変換する必要があります。そのやり方には2つあり、ひとつはコンパイラを使うもので、もうひとつはインタプリタを使うものです。
以下に両者の違いについて記載します。
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
フレームワークとして Flask(http://flask.pocoo.org/) を、OAuth ライブラリとして oauth2(http://pypi.python.org/pypi/oauth2/) を利用したサンプルプログラムです。 | |
下のコードを保存して (oauth_consumer.py とします)、YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET となっている部分を自分の consumer_key, consumer_secret で置き換えます。 | |
$ python oauth_consumer.py | |
... で起動してから http://localhost:5000 に Web ブラウザでアクセスして下さい。 |
from selenium import webdriver | |
from multiprocessing import Pool | |
def browser(url): | |
browser = webdriver.Firefox() | |
browser.get(url) | |
browser.close() | |
p = Pool(10) | |
p.map(browser, [ |
Taken from: https://hackerlists.com/hacking-sites/ | |
22 Hacking Sites, CTFs and Wargames To Practice Your Hacking Skills | |
InfoSec skills are in such high demand right now. As the world continues to turn everything into an app and connect even the most basic devices to the internet, the demand is only going to grow, so it’s no surprise everyone wants to learn hacking these days. | |
However, almost every day I come across a forum post where someone is asking where they should begin to learn hacking or how to practice hacking. I’ve compiled this list of some of the best hacking sites to hopefully be a valuable resource for those wondering how they can build and practice their hacking skill set. I hope you find this list helpful, and if you know of any other quality hacking sites, please let me know in the comments, so I can add them to the list. | |
1. CTF365 https://ctf365.com/ |
基本は、PythonでGoogle Drive API v3を利用して画像のアップロード の準備のトコとGoogle APIのAccess Tokenをお手軽に取得する、の合せ技
やること
の 6.
でリフレッシュトークンが貰えれば、あとは 8.
を繰替えすだけで良い。(1.
〜7.
は一回だけやればいいハズ)
ただ、 リフレッシュトークンがあると、Google Drive に対してやりたいほうだいになるので、リフレッシュトークンをクライアントに配るようは運用は考えづらい。善意で成り立っているなら、専用のアカウント作って運用、みたいなのはあるのか?
やるならファイルのアップロードを受けてるような中継用のサーバアプリを用意して、こいつで送信する、とか?(それならコマンドなんか使わずに、いろんな言語でSDKが出てるのでそれを使うから、やっぱ緊急用か、これは。)
https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Classes
class Polygon {
constructor(height, width) {
this.height = height;
#!/bin/sh | |
sudo tee -a /etc/hosts << EOF | |
# Block Google Chrome auto-update | |
0.0.0.0 tools.google.com | |
EOF |
2020/5/31追記:
自分用のメモに書いていたつもりだったのですが、たくさんのスターを頂けてとても嬉しいです。
と同時に、書きかけで中途半端な状態のドキュメントをご覧いただくことになっており、大変心苦しく思っています。
このドキュメントを完成させるために、今後以下のような更新を予定しています。
2021/1/22追記:
This is another piece of code I've extrapolated from a Ruby on Rails project I'm currently working on. The code implmenets social login with a RoR API-based application, targeted at API clients.
The setup does not involve any browser-redirects or sessions as you would have to use working with Omniauth.
Instead, what it does is takes an access_token generated on client-side SDKs, retireves user info from the access token
and creates a new user and Identity
in the database.
This setup works with native applications as described in the Google iOS Sign In Docs (see Authenticating with a backend server)