Skip to content

Instantly share code, notes, and snippets.

View direvius's full-sized avatar

Alexey Lavrenuke direvius

  • Yandex
  • Moscow, Russia
View GitHub Profile
package main
import (
"crypto/tls"
"fmt"
"github.com/amahi/spdy"
"io"
"log"
"net/http"
_ "time"
$ go run ./fail.go
[SPDY DEBUG] 2015/10/13 19:38:39 Session server started
[SPDY DEBUG] 2015/10/13 19:38:39 Stream #1 flow manager started
[SPDY DEBUG] 2015/10/13 19:38:39 Sending SYN_STREAM:
Frame: SYN_STREAM, Stream #1, Flags: FIN
Headers:
:method: GET
:path: /doodles/nusrat-fateh-ali-khans-67th-birthday
:version: HTTP/1.1
:host: www.google.com:443
// reproduce amahi/spdy sending SYN_STREAM for stream#3 before stream#1
package main
import (
"crypto/tls"
"fmt"
"github.com/amahi/spdy"
"io"
"log"
(pprof) list HostClient.*do
Total: 6.13mins
ROUTINE ======================== github.com/valyala/fasthttp.(*HostClient).do in /home/direvius/.gvm/pkgsets/go1.5.2/global/src/github.com/valyala/fasthttp/client.go
200ms 1.60mins (flat, cum) 26.08% of Total
. . 795:func (c *HostClient) do(req *Request, resp *Response, newConn bool) (bool, error) {
. . 796: if req == nil {
. . 797: panic("BUG: req cannot be nil")
. . 798: }
. . 799:
20ms 140ms 800: atomic.StoreUint32(&c.lastUseTime, uint32(time.Now().Unix()-startTimeUnix))
@direvius
direvius / paramiko_test.py
Last active April 13, 2016 11:02
test paramiko lib
import logging
from paramiko import SSHClient, AutoAddPolicy
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)s %(message)s')
logging.getLogger("paramiko.transport").setLevel(logging.DEBUG)
logger = logging.getLogger(__name__)
@direvius
direvius / script.py
Created October 13, 2016 14:05
Yandex.Tank script for mobile app testing
# -*- coding: UTF-8 -*-
import logging
import time
import urllib
from uiautomator import Device, Adb
logging.basicConfig()
logger = logging.getLogger(__name__)
@direvius
direvius / plot_config.yaml
Last active March 7, 2018 10:32
plot config example
plot:
area:
stacked: true
metrics:
- m1: {params}
- m2: {params}
axis: left
line:
left:
- m1: {params}
@direvius
direvius / load.yaml
Last active July 19, 2021 13:06
Pandora + Yandex.Tank config example
autostop:
autostop: []
enabled: true
package: yandextank.plugins.Autostop
pandora:
enabled: true
pandora_cmd: /path/to/pandora
config_content:
pools:
- id: HTTP pool # Pool name
@direvius
direvius / 90-mac-superdrive.rules
Created January 11, 2022 09:11 — forked from yookoala/90-mac-superdrive.rules
udev rules to use Apple SuperDrive on Linux
#
# Apple SuperDrive initialization rule
#
# See: https://gist.github.com/yookoala/818c1ff057e3d965980b7fd3bf8f77a6
ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw %r/sr%n EA 00 00 00 00 00 01"