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
""" | |
Proxy protocol support. | |
Code based on https://github.com/icgood/proxy-protocol | |
http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt | |
""" | |
from __future__ import unicode_literals | |
import socket | |
import struct |
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
13:15 $ git alias | |
ae = !/opt/sublime_text/sublime_text ~/.gitconfig | |
b = branch | |
st = status -s | |
ci = commit -a | |
ca = commit -a --amend --no-edit | |
push = push --tags | |
db = branch -d | |
dr = push origin --delete | |
rb = branch -m |
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
https://github.com/twisted/twisted/runs/2372418216#step:9:18222 | |
FAIL] | |
Traceback (most recent call last): | |
File "/home/runner/work/twisted/twisted/.tox/alldeps-nocov-posix/site-packages/twisted/words/test/test_irc.py", line 940, in test_ERRMSG | |
self.assertEqualBufferValue(reply, errReply) | |
File "/home/runner/work/twisted/twisted/.tox/alldeps-nocov-posix/site-packages/twisted/words/test/test_irc.py", line 38, in assertEqualBufferValue | |
self.assertEqual(bufferValue, val) | |
File "/home/runner/work/twisted/twisted/.tox/alldeps-nocov-posix/site-packages/twisted/trial/_synctest.py", line 424, in assertEqual |
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 IResourceRunnable(IRunnable): | |
""" | |
A resource which acts as a client to provide the end-user functionality. | |
""" | |
avatar = Attribute('The client/credentials for this resource.') | |
def heartbeat(): | |
""" | |
Called to signal that a command was requested for the location. |
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 ChevahRadius(radius.Radius): | |
""" | |
Patched version while the upstream project is re-enabled. | |
""" | |
def send_message(self, message): | |
""" | |
Raise VerificationError if we got a response but couldn't be validated, | |
instead of raising the same error as timeout. | |
""" |
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
# Code extracted from my private project, but released here as public code. | |
@classmethod | |
def _fromString_PRIVATE_PUTTY(cls, data, passphrase): | |
""" | |
Read a private Putty key. | |
Format is: | |
PuTTY-User-Key-File-2: ssh-rsa | |
Encryption: aes256-cbc | none | |
Comment: SINGLE_LINE_COMMENT |
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
# Copyright (c) 2012 Adi Roiban. | |
# See LICENSE for details. | |
""" | |
Protocol to help with tests. | |
This comes in addition to standard twisted.test.proto_helpers | |
""" | |
from io import BytesIO | |
from StringIO import StringIO |
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
""" | |
In one terminal | |
$ $ python3 twisted_fail_http_proxy_request.py | |
In another terminal test it with: | |
$ curl -v -x http://localhost:8000 http://httpforever.com/ | |
""" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<title>_trial_temp.test : API documentation</title> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" /> | |
<link rel="stylesheet" type="text/css" href="apidocs.css" /> |
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
""" | |
Run a simple LDAP client query. | |
Usage: | |
client-query [options] | |
-h --help Show this help. | |
Connection options: | |
--host=127.0.0.1 Connect to a specific host. [default: 127.0.0.1] |