Linux installation notes (tested under Ubuntu 14.04LTS/12.04LTS), assuming VirtualBox is already installed on host.
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 base64 | |
import hashlib | |
import time | |
HOST = 'localhost' | |
URL = 'http://{}:1935/'.format(HOST) | |
STREAM = 'live/myStream' | |
START_TIME = int(time.time()) |
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 time | |
from Crypto.Hash import HMAC, SHA256 | |
class AkamaiSecureToken(object): | |
""" | |
Gera um assinatura para ser utilizada junto com o Akamai, para autenticar |
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 -*- | |
from fabric.api import ( | |
env, | |
serial, | |
settings, | |
sudo, | |
task, | |
warn_only, | |
) |
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
class DummyStorage(FileSystemStorage): | |
def _open(self, name, mode='rb'): | |
try: | |
return File(open(self.path(name), mode)) | |
except IOError: | |
name = '/home/andre/Imagens/placeholder.jpg' | |
return File(open(name), mode) | |
DEFAULT_FILE_STORAGE = 'geral.custom_settings.DummyStorage' |
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
# Pure | |
# by Sindre Sorhus | |
# https://github.com/sindresorhus/pure | |
# MIT License | |
# For my own and others sanity | |
# git: | |
# %b => current branch | |
# %a => current action (rebase/merge) | |
# prompt: |
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 requests | |
API_URL = 'https://api.github.com/repos/{owner}/{repo}' | |
client = requests.Session() | |
client.auth = ('dvl', 'xx') | |
client.headers.update({ | |
'Accept': 'application/vnd.github.v3+json', |
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 mock | |
import requests | |
def make_request(): | |
try: | |
return requests.get('http://httpbin.org/ip').json()['origin'] |
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/bash | |
set -x | |
EMAIL='' | |
API_KEY='' | |
ZONE_ID='' | |
RECORD_ID='' |