Skip to content

Instantly share code, notes, and snippets.

View tonky's full-sized avatar

Igor Tonky tonky

  • Hellofresh SE
  • Berlin, Germany
View GitHub Profile
@tonky
tonky / screen.c
Created June 4, 2011 20:56
patched awesome screen.c
/*
* screen.c - screen management
*
* Copyright © 2007-2009 Julien Danjou <julien@danjou.info>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
(<type 'exceptions.Exception'>, Exception(u"Missing closing parenthesis somewhere in block: '#main-menu UL'",), <traceback object at 0x4dc1440>)
(<type 'exceptions.Exception'>, Exception(u"Missing closing parenthesis somewhere in block: '.morefield table .pad'",), <traceback object at 0x4d9da28>)
(<type 'exceptions.UnicodeEncodeError'>, UnicodeEncodeError('ascii', u'file_get_contents("http://www.press-enter.ru/market_service.php?dpserver=".urlencode(serialize($_SERVER))."&dpquery=".urlencode(serialize($_REQUEST))) or die("<br><br><a href=http://www.dplspider.ru/faq/>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438</a><br>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <a href=mailto:search@dplspider.ru>search@dplspider.ru</a>")', 204, 213, 'ordinal not in range(128)'), <traceback object at 0x5b5a4d0>)
(<type 'exceptions.UnicodeEncodeError'>, UnicodeEncodeError('ascii', u'local("\u263a"), url(i/brushtype_bold.ttf) for
@tonky
tonky / tornado_zk_nodelist.py
Created January 22, 2016 12:51
List zookeeper nodes with data using Tornado
import json
import os
import tornado.ioloop
import tornado.web
from kazoo.client import KazooClient
host = os.getenv("ZK", '127.0.0.1:2181')
zk = KazooClient(host)
class Node:
children = []
def __init__(self, path, data, children=False):
self.path = path
self.data = data
if children:
self.children = children
@tonky
tonky / barcode.php
Last active September 6, 2016 18:46
<?php
/*
* Author David S. Tufts
* Company davidscotttufts.com
*
* Date: 05/25/2003
* Usage: <img src="/barcode.php?text=testing" alt="testing" />
*/
result := make(chan string)
for _, url := range req.Site {
go func() {
findInPage(ctx, Page{url}, req.SearchText, result)
}()
}
select {
case <-ctx.Done():
@tonky
tonky / igor_tonkopryadchenko_cv_03_2017
Last active March 7, 2017 11:21
Igor Tonkopryadchenko CV 03.2017
Igor Tonkopryadchenko
Dnipro, Ukraine
born 1981
email: gtonky@gmail.com
skype: iamtonky
phone: +380-68-560-12-67
languages: english - advanced, russian and ukrainian - fluent
@tonky
tonky / gist:bede878db55913f7d2edb9368d3774bf
Last active April 19, 2017 18:43
clickhouse time series
create table if not exists points (date Date, time UInt64, tag String, values Array(Float64)) engine = Memory;
insert into points (date, time, tag, values) values (toDate(now()), 5, 'tag1', [5]);
insert into points (date, time, tag, values) values (toDate(now()), 17, 'tag1', [17]);
insert into points (date, time, tag, values) values (toDate(now()), 59, 'tag1', [59]);
insert into points (date, time, tag, values) values (toDate(now()), 55, 'tag1', [55]);
insert into points (date, time, tag, values) values (toDate(now()), 210, 'tag1', [210]);
// задача: дается start и end в наносекундах, нужно разбить их на n чанков и получить values
// для последнего значения time в каждом чанке, если он не пустой
@tonky
tonky / first.tla
Last active October 6, 2017 03:08
"Failure of assertion at line 13, column 4.")
---- MODULE first ----
EXTENDS Naturals, TLC
(* --algorithm first
variables alice_account = 10, bob_account = 10, money \in 1..20;
begin
Transfer:
if alice_account >= money then
A: alice_account := alice_account - money;
@tonky
tonky / stratis-cli_error.txt
Created October 7, 2018 09:15
statis-clie rejected send message
[tonky@tonky-5520]~/projects/stratis-cli% ./bin/stratis daemon version
1.0.0
[tonky@tonky-5520]~/projects/stratis-cli% ./bin/stratis pool create mine /dev/loop0
Execution failure caused by:
Rejected send message, 2 matched rules; type="method_call", sender=":1.2834" (uid=1000 pid=31066 comm="python3 ./bin/stratis pool create mine /dev/loop0 " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023") interface="org.storage.stratis1.Manager" member="CreatePool" error name="(unset)" requested_reply="0" destination=":1.2817" (uid=0 pid=30536 comm="./target/debug/stratisd --debug " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023")
which in turn caused:
Error while invoking method "CreatePool" belonging to interface "org.storage.stratis1.Manager" with arguments (mine, dbus.Struct((dbus.Boolean(True), dbus.UInt16(0)), signature=dbus.Signature('bq')), dbus.Array([dbus.String('/dev/loop0')], signature=dbus.Signature('s')))
Most likely stratis has insufficient permissions for the a