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
#!/usr/bin/env python3 | |
import codecs | |
import sys | |
import time | |
from threading import Thread | |
import six | |
from six.moves.queue import Queue, Empty | |
class APIError(Exception): |
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
swagger: '2.0' | |
info: | |
title: ZONT API | |
description: Управляйте вашими устройствами | |
version: "1.0.0" | |
host: zont-online.ru | |
schemes: | |
- https |
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 | |
device_id = 1580 | |
login = 'demo' | |
password = 'demo' | |
client = 'your@email.com' | |
result = requests.post( | |
'https://zont-online.ru/api/devices', |
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 cython.operator cimport dereference as deref | |
from libcpp.list cimport list as c_list | |
cdef extern from "test.h": | |
c_list[int]* c_create_list "create_list" () | |
def create_list(): | |
l = c_create_list() | |
try: |
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 twisted.internet import defer | |
from klein import Klein | |
from mocked_db import Database | |
def users_aspect(app: Klein, db: Database): | |
@app.route('/') | |
@defer.inlineCallbacks |
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 sys | |
import os | |
import gc | |
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol | |
from twisted.internet.protocol import Protocol, Factory | |
from twisted.internet import ssl, defer, error | |
from twisted.internet.task import react | |
from twisted.protocols.loopback import loopbackAsync | |
import psutil |
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
WriteOp = Union[ | |
InsertOne, | |
UpdateOne, UpdateMany, | |
DeleteOne, DeleteMany, | |
ReplaceOne | |
] | |
class MongoCollectionQueue: | |
# FIXME: |
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
#include <cstdio> | |
class A { | |
public: | |
int x; | |
A(int x): x(x) {} | |
}; | |
class B: public A { |
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
version: '2' | |
## INITIAL SETUP | |
# docker-compose run --rm ovpn ovpn_genconfig -u udp://<IP> | |
# docker-compose run --rm ovpn ovpn_initpki | |
# docker-compose up -d | |
# docker-compose run --rm ovpn easyrsa build-client-full myvpn nopass | |
# docker-compose run --rm ovpn ovpn_getclient myvpn > myvpn.ovpn | |
services: |
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 attr import dataclass | |
from rx import AnonymousObservable, Observable | |
from rx.core import ObservableBase | |
from rx.subjects import Subject | |
from twisted.internet import reactor, defer | |
from twisted.internet.defer import Deferred | |
from twisted.internet.protocol import Protocol, connectionDone, Factory | |
from twisted.python.failure import Failure | |
OlderNewer