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
  • 09:56 (UTC +01:00)
View GitHub Profile
@adiroiban
adiroiban / setup.py
Created July 16, 2016 03:01
coverage friendly setup.py
#!/usr/bin/env python
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Setuptools installer for Twisted.
"""
import os
#
# Run it on python 2.7 on Linux with
# 1) LANG=C python serverFromString-example.py
# 2) LANG=en_US.UTF-8 python serverFromString-example.py
from twisted.internet import reactor, endpoints
from twisted.internet.protocol import Protocol, Factory
class Echo(Protocol):
@adiroiban
adiroiban / output.txt
Last active May 11, 2016 13:41
SharePoint online error to PUT with Transfer-Encoding: chunked
PUT 200: OK
<HTML><DIV dir="ltr"><H2>Microsoft SharePoint Foundation Error.</H2>
<P>
<B>User:</B> please report details to this Web site's Webmaster.
<P>
<P>
<B>Webmaster:</B> please see the server's application event log for more details.
</P></DIV>
@adiroiban
adiroiban / review-comment.txt
Last active May 3, 2016 07:50
Twisted initial review reply
Many thanks for your contribution.
Can you please define the scope of your patch or update the ticket's description?
DETAILS ABOUT WHY THE SCOPE IS NOT OK.
The patch needs at least one automated test to demonstrate the change and to prevent future regressions.
The patch also needs a NEWS file fragment (release notes fragment)
as described here http://twistedmatrix.com/trac/wiki/ReviewProcess#Newsfiles
@adiroiban
adiroiban / trac.ini
Created March 9, 2016 09:44
Chevah Trac Ticket Workflow
[ticket-workflow]
; no state change default action.
leave = * -> *
leave.default = 1
leave.operations = leave_status
; allow closing from any state.
resolve = * -> closed
resolve.operations = set_resolution
resolve.permissions = TICKET_MODIFY
@adiroiban
adiroiban / osx_useradd.sh
Last active June 8, 2022 19:49
Script to add a service account on OSX.
#!/bin/sh
#
# This is free and unencumbered software released into the public domain.
#
# Created by Nils Kollandsrud and modified by Adi Roiban.
#
# Script for creating a new service account on OSX.
# It will create a dedicated group and username for the service account.
# usage: sh shellname.sh username
@adiroiban
adiroiban / twisted_create_branch.sh
Last active January 18, 2016 00:44
twisted_create_branch
twisted_create_branch () {
branch_name=$1
git sb trunk
mkbranch $branch_name
git fetch origin
git pull origin trunk
git checkout -b $branch_name origin/$branch_name
}
@adiroiban
adiroiban / error.txt
Created December 24, 2015 13:41
conch failure
$ pip install -e .
Obtaining file:///home/adi/chevah/twisted
Running setup.py (path:/home/adi/chevah/twisted/setup.py) egg_info for package from file:///home/adi/chevah/twisted
Requirement already satisfied (use --upgrade to upgrade): zope.interface>=3.6.0 in /usr/lib/python2.7/dist-packages (from Twisted==15.5.0)
Installing collected packages: Twisted
Running setup.py develop for Twisted
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c conftest.c -o conftest.o
building 'twisted.python._sendmsg' extension
@adiroiban
adiroiban / tsf-dec-1-2015.rst
Last active December 15, 2015 19:00
December 2015 first half - TSF Sponsored Development

December 2015 first half - TSF Sponsored Development

This is my report for the work done in the first half of Decemeber as part of the 2015 Twisted Maintainer Fellowship program.

Important changes made in these weeks:

  • The Git migration plan was sent for approval
  • Port of the AMP protocol to Python 3.
@adiroiban
adiroiban / file.py
Created December 15, 2015 11:30
obfuscation
# Backslash-escape errorCode. Python 3.5 can do this natively
# ("backslashescape") but Python 2.7 and Python 3.4 can't.
if _PY3:
errorCodeForMessage = "".join(
"\\x%2x" % c if c >= 0x80 else chr(c)
for c in errorCode)
else:
errorCodeForMessage = "".join(
"\\x%2x" % ord(c) if ord(c) >= 0x80 else c
for c in errorCode)