Skip to content

Instantly share code, notes, and snippets.

View estin's full-sized avatar

Evgeniy Tatarkin estin

  • Russia
View GitHub Profile
// ### Usage
// $ cargo run
// open develop consonle on opened browser
// and execute in consle myPostMessage("it works").then(r => console.log("Result is:", r));
// ### Cargo.toml
//
// [package]
// name = "reddit-ex"
// version = "0.1.0"
@estin
estin / Intro.md
Last active January 22, 2020 06:19
RA eats all system memory

Try analyze https://github.com/estin/cywad

RA version

$ git log -n 1
commit de2409702ba639f06cf340f5e3f3b7e671021d1b (HEAD -> master, tag: 2020-01-20, origin/staging, origin/release, origin/master, origin/HEAD)
Merge: 648241ee 72792f6b
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date: Mon Jan 20 10:16:06 2020 +0000
import os
import asyncio
if int(os.environ.get("USE_UVLOOP", 0)):
print("with uvloop")
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
import aiohttp
@estin
estin / gist:1477337
Created December 14, 2011 16:36
force fiscalization for concrete terminal
Index: device.py
===================================================================
--- device.py (revision 1790)
+++ device.py (working copy)
@@ -256,7 +256,7 @@
def _fiscalize(self, summ, toprint):
self._log('Printing text:\n', toprint)
- if self.fake:
+ if self.fake and self._terminal_id not in (1, 2, 3):
@estin
estin / gist:1044504
Created June 24, 2011 09:41
Python async http "hello" server (Python 3.x)
# -*- coding: utf-8 -*-
import asyncore
import socket
ANSWER = 'HTTP/1.0 200 OK\r\n' + \
'Content-Type: text/html; charset=utf-8\r\n' + \
'Content-Length: 5\r\n' + \
'Connection: close\r\n\r\n' + \
'hello'
@estin
estin / gist:1044489
Created June 24, 2011 09:24
Python async http "hello" server
# -*- coding: utf-8 -*-
import asyncore
import socket
ANSWER = 'HTTP/1.0 200 OK\r\n' + \
'Content-Type: text/html; charset=utf-8\r\n' + \
'Content-Length: 5\r\n' + \
'Connection: close\r\n\r\n' + \
'hello'