Skip to content

Instantly share code, notes, and snippets.

@gawel
gawel / clientx.py
Last active February 11, 2024 18:02
Locust http2 client
import re
import time
from locust import User
from locust.exception import LocustError
import httpx
from httpx import Request, Response
from requests.auth import HTTPBasicAuth
from httpx import InvalidURL, RequestError
import irc3
from irc3.plugins.command import Commands
class Custom:
def __init__(self, context):
self.context = context
self.command = context.get_plugin(Commands)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Use mycli (http://mycli.net/) through ssh
Usage:
$ mycli-ssh yourhost [extra args passed to mycli]
"""
@gawel
gawel / backup.py
Last active November 24, 2018 14:13
from chut import * # noqa
@console_script(fmt='msg')
def backup(args):
"""
Usage: %prog [options] sync [<server>...]
%prog add <target>
%prog list
" IDE module for vim
# -*- coding: utf-8 -*-
# pip install "requests[socks]"
import requests
proxies = {
"http": "socks5://localhost:9150",
"https": "socks5://localhost:9150"
}
# -*- coding: utf-8 -*-
from tinydb import TinyDB
from tinydb import Query
db = TinyDB('db.json')
def fake():
from faker import Faker
f = Faker()
@gawel
gawel / 11link2sd
Last active December 29, 2015 00:09
#!/system/bin/sh
if [ -f adb ]; then
./adb push 11link2sd /system/etc/init.d/11link2sd
./adb shell chown root:shell /system/etc/init.d/11link2sd
./adb shell chmod +x /system/etc/init.d/11link2sd
exit
fi
LOG=/data/link2sd-11link2sd.log
@gawel
gawel / README.rst
Last active December 27, 2015 05:19

Usage:

$ git clone https://gist.github.com/7273196.git pypy-benches
$ cd pypy-benches
$ python2.7 bootstrap.py
$ bin/buildout

zope.interface bench:

$ python2.7 bin/zope-interface
@gawel
gawel / about_profiling.rst
Last active December 22, 2015 23:49
Profiling middleware. Log wallclock, utime, stime and idle time.

Profiling

This gist contain a set of modules to help you to profile your application