APPENGINE_RUNTIME | python27 |
APPLICATION_ID | s~appid |
AUTH_DOMAIN | gmail.com |
CONTENT_LENGTH | 148 |
CONTENT_TYPE | application/x-www-form-urlencoded |
CURRENT_MODULE_ID | default |
CURRENT_VERSION_ID | appid.370290628632119235 |
DATACENTER | us1 |
DEFAULT_VERSION_HOSTNAME | appid.appspot.com |
HTTPS | on |
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 protorpc import messages | |
class MultiMessage(messages.Message): | |
"""Has a field for each basic value type. | |
""" | |
boolean = messages.BooleanField(1) | |
integer = messages.IntegerField(2) | |
float = messages.FloatField(3) | |
string = messages.StringField(4) |
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
# This pipeline sums up a bunch of values. That simple. | |
class SumPipeline(pipeline.Pipeline): | |
def run(self, *values): | |
return sum(values) | |
# This pipeline takes care of computing the score of one specific player | |
class PlayerScorePipeline(pipeline.Pipeline): | |
def run(self, player, level): | |
# Let's call our remote REST API to return the score | |
# of this player on the supplied level. |
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
# -*- coding:utf-8 -*- | |
import logging | |
logger = logging.getLogger(__name__) | |
from datetime import datetime | |
from pyramid.config import Configurator | |
from pyramid.view import view_config | |
from pyramid.httpexceptions import HTTPError | |
from pyramid.response import Response | |
import json | |
import sqlalchemy as sa |
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 wsgiref.simple_server import make_server | |
from pyramid.config import Configurator | |
from pyramid.response import Response | |
from pyramid.compat import text_type | |
from sqlalchemy.orm import scoped_session | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy import create_engine | |
from sqlalchemy.ext.declarative import declarative_base |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: consul | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: S 0 1 6 | |
# Short-Description: Consul service discovery framework | |
# Description: Healthchecks local services and registers | |
# them in a central consul database. |
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
Because of 'Meslo for Powerline' font doens't work with Putty. | |
So we need another patched font to display powerline correctly. | |
Here are the list: | |
- DejaVu Sans Mono for Powerline (https://github.com/powerline/fonts/tree/master/DejaVuSansMono) | |
- Droid Sans Mono for Powerline (https://github.com/powerline/fonts/tree/master/DroidSansMono) | |
To change font: On main window (Putty Configuration) -> Window -> Apearance -> Font settings -> Change | |
To test, enter this in the terminal screen: echo "\ue0b0 \u00b1 \ue0a0 \u27a6 \u2718 \u26a1 \u2699" |
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 argparse | |
import os | |
import shutil | |
import tempfile | |
from zipfile import ZipInfo, ZipFile | |
parser = argparse.ArgumentParser(description="Unzips a password protected .zip by performing a brute-force attack " | |
"using either a word list, password list or a dictionary.", | |
usage="BruteZIP.py -z zip.zip -d dict.txt") | |
parser.add_argument("-z", "--zip", metavar="", required=True, help="Path to the .zip file.") |
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 sqlalchemy as sa | |
import sqlalchemy.orm as orm | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.ext.declarative import declared_attr | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
DBSession = scoped_session(sessionmaker()) | |
class BaseMixin(object): | |
query = DBSession.query_property() | |
id = sa.Column(sa.Integer, primary_key=True) |
OlderNewer