Skip to content

Instantly share code, notes, and snippets.

View diyan's full-sized avatar

Oleksii Diian diyan

View GitHub Profile
@diyan
diyan / pgcli_alpine_crash.md
Last active January 10, 2016 13:09
pgcli crashes with 'Segmentation fault' error on Alpine Linux, musl C library

Docker image - https://hub.docker.com/r/diyan/pgcli/

# gdb python
(gdb) run /usr/bin/pgcli --host=postgres --user=postgres
Starting program: /usr/bin/python /usr/bin/pgcli --host=postgres --user=postgres
[New LWP 79]
Version: 0.20.1
Chat: https://gitter.im/dbcli/pgcli
Mail: https://groups.google.com/forum/#!forum/pgcli

Repro steps for gvt fetch

mkdir 1_cheggaaa_pb && cd $_
gvt fetch github.com/cheggaaa/pb
mkdir 2_go_github && cd $_
gvt fetch github.com/google/go-github/github
mkdir 3_uitable && cd $_
gvt fetch github.com/gosuri/uitable
mkdir 4_oauth2 && cd $_
gvt fetch golang.org/x/oauth2
@diyan
diyan / golang_package_management.md
Created January 3, 2016 09:42
Cambrian explosion of Golang package management tools
Most starred tools that supports GO15VENDOREXPERIMENT

godep, glide, govendor, gvt

Most starred tools that does not supports GO15VENDOREXPERIMENT

gb, gom, gpm, gopm, goop, nut, johnny-deps, gopkg, gopack, gigo

GitHub stats at 2016-01-02
repo                   	stars	forks	lang
tools/godep            	2954 	263  	Go
@diyan
diyan / validation_libs.py
Created August 26, 2015 12:02
Evaluate validation libraries - schematic, cerberus, trafaret
""" Evaluate different validators libraries.
Test YAML request model to validate:
TestRequest:
description: A test request with different attributes.
required: [first_name, last_name, email, password]
properties:
first_name:
type: string
@diyan
diyan / fix_docker_ps.md
Last active November 8, 2015 10:28
Fix. Default output from 'docker ps' command is too wide

Fix. Default output from 'docker ps' command is too wide

$ docker ps -a
CONTAINER ID        IMAGE                    COMMAND                CREATED             STATUS                     PORTS               NAMES
e33e91281698        choam_nagios4            "/usr/bin/supervisor   12 days ago         Exited (0) 12 days ago                         choam_nagios4
@diyan
diyan / nodejs_generator_runners.md
Last active September 25, 2016 08:55
Evaluate how different ES6 generator runners (Q, Bluebird and Co) behaves with buggy code
@diyan
diyan / gui_automation_python.md
Last active December 4, 2023 14:48
Desktop GUI automation in Python

Desktop

UI Automation. Desktop. Python

GUI toolkit agnostic

autopy - simple, cross-platform GUI automation toolkit. MIT - https://github.com/msanders/autopy/

  • 432 stars, 102 forks, 2950 monthly downloads at 2015-05-13
  • GUI toolkit agnostic
@diyan
diyan / go_loggers.md
Last active August 29, 2015 14:17
I've used strucutred logging approach in Python with structlog library. Now looking for similar options in Golang.

I've used strucutred logging approach in Python (with structlog library).

Now looking for same options but in Golang.

Candidates are logxi, log15 and logrus.

IMO log15 has most idiomatic API while logxi is most convenient (due to stack context info)

To build and run I'm using following:

@diyan
diyan / matplotlib_on_pypy.md
Last active April 21, 2016 22:46
Did a try to setup matplotlib for PyPy in Docker container with Ubuntu 14.04 to run Multi Mechanize load test tool

Did a try to setup matplotlib for PyPy in Docker container with Ubuntu 14.04 to run Multi Mechanize load test tool.

Good news: NumPy can be easily installed for PyPy.

Bad news: matplotlib failed to install most likely due lack of NumPy's C-API.

If anyone have workaround for building matplotlib for PyPy I would happy to get your suggestions.

Dockerfile

@diyan
diyan / uwsgi_json_access_log.md
Last active October 29, 2018 14:44
uWSGI logging configuration that could be used with central logging servers such as Logstash, Fluentd, etc.

uWSGI logging configuration that could be used with central logging servers such as Logstash, Fluentd, etc.

[uwsgi]
project = some_project
...

# file: prefix is required for req-logger
req-logger = file:/var/log/%(project)/%(project)_access.log
log-format = "method": "%(method)", "uri": "%(uri)", "proto": "%(proto)", "status": %(status), "referer": "%(referer)", "user_agent": "%(uagent)", "remote_addr": "%(addr)", "http_host": "%(host)", "pid": %(pid), "worker_id": %(wid), "core": %(core), "async_switches": %(switches), "io_errors": %(ioerr), "rq_size": %(cl), "rs_time_ms": %(msecs), "rs_size": %(size), "rs_header_size": %(hsize), "rs_header_count": %(headers)