Skip to content

Instantly share code, notes, and snippets.

@derwolfe
derwolfe / cryptography-traceback.txt
Created January 5, 2016 14:38
wheel failing to build with pypy-4.0.1+ds
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-v7Avhg/cryptography/setup.py", line 318, in <module>
**keywords_with_side_effects(sys.argv)
File "/usr/lib/pypy/lib-python/2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/pypy/lib-python/2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/pypy/lib-python/2.7/distutils/dist.py", line 972, in run_command
Hi Jeff,
The lead security engineer who raised this issue is keynoting a conference in Europe this week, so we can not accommodate your ask for a video conference. Furthermore, we feel that this issue has already been very extensively and unambiguously documented; with central points being directly refuted.
Chris
@derwolfe
derwolfe / keybase.md
Created August 19, 2015 17:05
keybase.md

Keybase proof

I hereby claim:

  • I am derwolfe on github.
  • I am derwolfe (https://keybase.io/derwolfe) on keybase.
  • I have a public key whose fingerprint is B256 481D 41F3 7AF2 29C2 A3D2 A008 BD38 361C 4770

To claim this, I am signing this object:

@derwolfe
derwolfe / translate.py
Created April 7, 2015 19:26
I love python
import csv
def translate_file(fname):
translated = []
with open(fname, 'rb') as csvfile:
reader = csv.reader(csvfile, delimiter=',')
reader.next()
for row in reader:
translated.append(to_class(row[0], row[1], row[2]))
return to_string_list(translated)
@derwolfe
derwolfe / gist:434ba30127660781730e
Last active July 7, 2018 10:38
Installing twisted on windows
  1. install python 2.7.9 from here https://www.python.org/downloads/; if using a different python, then you may need to install pip using get-pip.py
  2. add the directory located at C:\python27\scripts to the end of your path with ;C:\python27\scipts
  3. upgrade pip to ensure that you have a version that supports installing wheels - pip install -U pip
  4. run pip install virtualenv
  5. run virtualenv venv
  6. if using:
    • cmd run .\venv\activate
    • powershell run .\venv\Scripts\activate.ps1. By default, powershell doesn't allow execution of unsigned scripts. This can be turned off by setting the execution policy to a more permissive setting. This can be done with open powershell and typing: Set-ExecutionPolicy Unrestricted. You will then be prompted about whether or not you'd like to really allow this; to accept type Y and hit enter.
    • git bash prompt run source ./venv/Scripts/activate
import os
import pem
from twisted.application.service import Application
from twisted.application.internet import (
TCPServer,
SSLServer
)
@derwolfe
derwolfe / irclog.txt
Created December 31, 2014 17:15
irclog
12:06 <herrwolfe> is there a configuration option to specify a tox environment to only run on osx? I'm bundling an application and would like go through the long process of getting pyobjc installed, but only when actually necessary
12:11 → Ivo and avanderneut1 joined ⇐ jaraco, Jurko, antocuni, cr3 and avanderneut quit ↔ wirrrbel, maryokhin, dowwie and wirrrbel1 popped in
Wednesday, December 31st, 2014
02:03 → jaraco, wirrrbel and cr3 joined ↔ antocuni and Jurko popped in ↔ bubenkoff and untitaker nipped out
09:30 <ronny> herrwolfe: im not aware of a easy way to do that right now
09:33 ⇐ wirrrbel quit (~Thunderbi@dslb-088-066-055-002.088.066.pools.vodafone-ip.de) Ping timeout: 264 seconds
09:53 <herrwolfe> ronny: thanks - it seems like that is something I should probably handle at a different level anway
10:06 ↔ pf_moore nipped out
10:07 <ronny> herrwolfe: as faras i can tell, platform tags for tox might be a good idea
10:07 <ronny> (solutions on other levels seem uneasonably complex at first thou
# File: data_handlers.py
from models import MyDataObject
class MyDataHandler:
""" responsible for working on the data only."""
def __init__(self, data_object):
self.data_object = data_object
def mult_data_by_two(self):
return self.data_object.numeric_data * 2
@derwolfe
derwolfe / gist:ca5f7e86790e1c2df6ca
Created November 20, 2014 16:41
irc notes about twisted packaging/docs - ticket #3696
09:41 <herrwolfe45> I'm working on ticket #3696 and am a bit stuck on what type of documentation I should write - I'm thinking I should write a how-to describing how one should install twisted and it's various optional dependencies. This how-to would be in the narrative docs for twisted core. Does this sound like a decent idea?
09:41 <glyph> herrwolfe45: That sounds fantastic.
09:42 <herrwolfe45> glyph: excellent, I'll start with that - thanks
09:45 <herrwolfe45> ergh its
09:48 <exarkun> When writing that, don't forget that `pip install Twisted` is the least preferred installation method. When possible people should prefer an OS-supplied package. (But it's certainly not always possible.)
09:49 <exarkun> (Or possibly tailoring different sections of the document to different audiences makes sense - developers working on Twisted have slightly different requirements from developers using Twisted have very different requirements from end-users using an application that depends on Twisted.)
09:50 <glyph> exarkun:
from twisted.internet import reactor
from twisted.web import server, resource
from autobahn.wamp1.protocol import WampClientFactory, WampCraClientProtocol
from autobahn.twisted.websocket import connectWS
class SomeClient(WampCraClientProtocol):
def doSomething(self, something):
return something