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
>>> ba = bytearray('AAAA') | |
>>> ba[3] = 'B' | |
>>> ba | |
bytearray(b'AAAB') |
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
#!/bin/bash | |
OPENSSL_VERSION="1.0.1g" | |
curl -O http://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz | |
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz | |
mv openssl-$OPENSSL_VERSION openssl_i386 | |
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz | |
mv openssl-$OPENSSL_VERSION openssl_x86_64 | |
cd openssl_i386 |
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
@ changeset: 93656:20d99d0d30e2 | |
| bookmark: issue21793 | |
| tag: tip | |
| parent: 93654:bd97eab25c70 | |
| user: Demian Brecht <demianbrecht@xxx.com> | |
| date: Fri Dec 05 08:35:27 2014 -0800 | |
| summary: issue21793 | |
| | |
| o changeset: 93655:51d37306c28a | |
|/ bookmark: issue22931 |
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
hg heads --topo | |
changeset: 93656:20d99d0d30e2 | |
bookmark: issue21793 | |
tag: tip | |
parent: 93654:bd97eab25c70 | |
user: Demian Brecht <demianbrecht@gmail.com> | |
date: Fri Dec 05 08:35:27 2014 -0800 | |
summary: issue21793 | |
changeset: 93655:51d37306c28a |
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
tcpdump: listening on lo0, link-type NULL (BSD loopback), capture size 1514 bytes | |
09:05:27.922494 IP (tos 0x0, ttl 64, id 40658, offset 0, flags [DF], proto TCP (6), length 64, bad cksum 0 (->9de3)!) | |
127.0.0.1.61438 > 127.0.0.1.61437: Flags [S], cksum 0xfe34 (incorrect -> 0xc750), seq 1921818310, win 65535, options [mss 16344,nop,wscale 4,nop,nop,TS val 915214250 ecr 0,sackOK,eol], length 0 | |
0x0000: 4500 0040 9ed2 4000 4006 0000 7f00 0001 E..@..@.@....... | |
0x0010: 7f00 0001 effe effd 728c 9ec6 0000 0000 ........r....... | |
0x0020: b002 ffff fe34 0000 0204 3fd8 0103 0304 .....4....?..... | |
0x0030: 0101 080a 368d 0faa 0000 0000 0402 0000 ....6........... | |
09:05:27.922543 IP (tos 0x0, ttl 64, id 41949, offset 0, flags [DF], proto TCP (6), length 64, bad cksum 0 (->98d8)!) | |
127.0.0.1.61437 > 127.0.0.1.61438: Flags [S.], cksum 0xfe34 (incorrect -> 0x8e38), seq 3187291349, ack 1921818311, win 65535, options [mss 16344,nop,wscale 4,nop,nop,TS val 915214250 ecr 915214250,sackOK,eol], length 0 | |
0x0000: 450 |
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 python | |
import cherrypy | |
from pprint import pprint | |
class Root: | |
@cherrypy.expose | |
def index(self): | |
pprint(cherrypy.request.headers) | |
print(cherrypy.request.body.read()) | |
return '' |
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
def _get_content_length(body, method): | |
# Get the content-length based on the body. If the body is "empty", we | |
# set Content-Length: 0 for methods that expect a body (RFC 7230, | |
# Section 3.3.2). If the body is set for other methods, we set the | |
# header provided we can figure out what the length is. | |
if not body: | |
# do an explicit check for not None here to distinguish between unset | |
# and set but empty | |
if method.upper() in _METHODS_EXPECTING_BODY or body is not None: | |
return 0 |
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 abc | |
def _new(mcls, name, bases, dct): | |
cls = type.__new__(mcls, name, bases, dct) | |
abstracts = set() | |
for k, v in filter(lambda o: not o[0].startswith('__'), | |
mcls.__looks_like__.__dict__.items()): |
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
#!/bin/sh | |
docker rm $(docker ps -aqf status=exited) | |
docker-machine ssh default docker volume rm $(docker-machine ssh default docker volume ls -qf dangling=true) |
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
### Keybase proof | |
I hereby claim: | |
* I am demianbrecht on github. | |
* I am demianbrecht (https://keybase.io/demianbrecht) on keybase. | |
* I have a public key ASAjnGMDvetEdQG2Y1LqHHKt95oUkYpz6AMU0Hg6-AwDjwo | |
To claim this, I am signing this object: |
OlderNewer