Skip to content

Instantly share code, notes, and snippets.

View adiroiban's full-sized avatar
🇺🇦
Slava Ukraini!

Adi Roiban adiroiban

🇺🇦
Slava Ukraini!
  • VGR, La Gomera
  • 03:19 (UTC +01:00)
View GitHub Profile
@adiroiban
adiroiban / result.html
Created October 23, 2020 21:28
pydoctor private deprecations
<?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" />
@adiroiban
adiroiban / form.py
Last active October 21, 2020 13:42
Twisted support for parsing multipart/form-data POST requests
# Copyright (c) 2014 Adi Roiban.
# See LICENSE for details.
"""
Code for handling data submitted via HTTP form.
We should try to keep this code independent of Chevah project as we plan
to send it upstream in Twisted.
"""
from StringIO import StringIO
@adiroiban
adiroiban / ldaptor-client-query.py
Created October 4, 2020 11:49
Simple ldaptor example to connect to a LDAP server, bind and dump the result.
"""
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]
@adiroiban
adiroiban / aescrypt_sans_io.py
Created March 2, 2020 02:06
AES Crypt Sans I/O
"""
Implementation of AES Crypt witout any I/O operations.
"""
_AES_BLOCK_SIZE = 16
_AES_BUFFER_SIZE = 16 * 1024
_IV_SIZE = 16
_KEY_SIZE = 32
@adiroiban
adiroiban / dropzone_selenium.py
Last active June 29, 2019 10:19
Script to add a file to dropzone via Selenium... from Python
def addFileToDropzone(self, driver, css_selector, name, content):
"""
Trigger a file add with `name` and `content` to Dropzone element at `css_selector`.
"""
script = """
var dropzone_instance = Dropzone.forElement(css_selector)
var new_file = new File(['%s'], '%s', {type: 'application/octet-binary'})
dropzone_instance.addFile(new_file)
""" % (content, name)
driver.execute_script(script)
@adiroiban
adiroiban / child_process.py
Last active February 13, 2019 17:37
Ampoule Example from main thread
"""
This code is launched in the child process.
It is also loaded/imported in the main process for AMP protocol to know the
available command, arguments and results.
Each process will use about 30MB of ram, as this is how much Twisted uses.
Having more imports here, will increase the size of the process.
"""
@adiroiban
adiroiban / example run
Last active January 31, 2019 11:51
Persistent pool not closed in Twisted
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
>>> import cryptography
>>> import OpenSSL
>>> cryptography.__version__
'1.7.2'
>>> OpenSSL.__version__
'16.2.0'
>>>
@adiroiban
adiroiban / testing_twisted_http_client.py
Created October 31, 2018 09:36
Code to help writing tests for Twisted HTTP client
# Copyright (c) 2014 Adi Roiban.
# See LICENSE for details.
"""
Helpers for testing code related to HTTP protocol.
"""
from __future__ import absolute_import
from httplib import HTTPConnection, HTTPSConnection
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from select import error as SelectError
diff --git a/chevah/server/static/documentation/operation-client/transfers.rst b/chevah/server/static/documentation/operation-client/transfers.rst
index 5605264..0322b10 100644
--- a/chevah/server/static/documentation/operation-client/transfers.rst
+++ b/chevah/server/static/documentation/operation-client/transfers.rst
@@ -310,6 +310,10 @@ The `lowercase` is a simple transformation which will transfer the file
using destination file path and file name all in lower case.
It takes no options.
+.. note::
+ If the remote filesystem is case insensitive and a file with the same
-----BEGIN CERTIFICATE-----
MIICTDCCAbWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJHQjEP
MA0GA1UEChMGQ2hldmFoMRIwEAYDVQQLEwlDaGV2YWggQ0ExEjAQBgNVBAMTCUNo
ZXZhaCBDQTAeFw0xNjA2MTAyMzA1MDBaFw0zNzA2MTAyMzA1MDBaMEYxCzAJBgNV
BAYTAkdCMQ8wDQYDVQQKEwZDaGV2YWgxEjAQBgNVBAsTCUNoZXZhaCBDQTESMBAG
A1UEAxMJQ2hldmFoIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKhnaV
43T6EcAc45RYV9/FKk3SxI4tAWw/HGpu02JLvs7BiLz4B8YUyf4IDqw/BtyLKKCx
zGw55UWIIokk5zkjp6Y9n3wmbHtJHd9Rwgm4pMibVrxjhY/Idf/3zeSakQBIrXpQ
eg53iVmn6bClaiUB1aB4wlskchmT496gZStfBQIDAQABo0owSDAMBgNVHRMEBTAD
AQH/MDgGA1UdHwQxMC8wLaAroCmGJ2h0dHA6Ly9sb2NhbGhvc3Q6ODA4MC9zb21l