Skip to content

Instantly share code, notes, and snippets.

https://linuxcenter.kz/page/ustanavlivaem-ms-directx9x-v-wine
user$ wget http://winetricks.org/winetricks
user$ sh winetricks d3dx9
@kostyll
kostyll / gist:8efcede1375e7021044ba209f32a0b00
Created April 26, 2016 14:09 — forked from claudijd/gist:6ce45deabb154ceb7efa
Good one-liner for OpenSSL s_server testing
openssl req -nodes -x509 -newkey rsa:2048 -keyout server.pem -out server.pem -days 1 && openssl s_server -tls1 -www -accept 1337
@kostyll
kostyll / singleton.py
Created March 30, 2016 09:24
singleton
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
class Notifier(object):
__metaclass__ = Singleton
@kostyll
kostyll / Makefile
Last active December 27, 2016 10:11
Makefile
.PHONY: all
# https://gist.github.com/kostyll/e1bba8506c2cb08352fc
# install git-crypt from https://github.com/AGWA/git-crypt.git
REQFILE=requirements.txt
TESTDUMMY=test/test_dummy.py
GITATTRIBUTES=.gitattributes
GITIGNORE=.gitignore
KEY=key.bin
@kostyll
kostyll / Makefile
Last active February 16, 2016 15:36
cjsx_twbs_react_notes.md
DIRS = . static/js/base64.coffee static
COFFEE_SCRIPTS = $(basename $(foreach dir,$(DIRS),$(wildcard $(dir)/*.coffee)))
#GEN_POPUPS := $(basename $(shell find data/ ! -name "html.py" -name "*.py"))
CJXS_SCRIPTS = $(basename $(foreach dir,$(DIRS),$(wildcard $(dir)/*.cjsx)))
PY_EXT=.py
PYTHON=python
CHDIR_SHELL := $(SHELL)
define chdir
$(eval _D=$(firstword $(1) $(@D)))
[Как варить гречку]
http://www.timeboil.ru/cereals/buckwheat/
1. Перед варкой гречку необходимо перебрать; важно, чтобы в готовую гречку не попали камушки и растительный мусор.
2. Промыть гречку под холодной водой и слить воду.
3. Разогреть сковородку, высыпать гречку, пару минут прогреть гречку на сковородке (без масла) на тихом огне, - тогда после варки она будет рассыпчатой.
4. Налить в кастрюлю холодной воды - в 2,5 раза больше, чем гречки: на 1 стакан гречки 2,5 стакана воды. Посолить воду.
5. Всыпать гречку в воду.
6. Поставить кастрюлю на тихий огонь, довести до кипения, добавить 1 чайную ложку сливочного масла.
7. Гречку варить на медленном огне, под крышкой, 20 минут.
8. Подавать гречку на гарнир со сливочным маслом и зеленью.
@kostyll
kostyll / sigterm.py
Created December 1, 2015 11:19
sigterm handler
import signal
import sys
def sigterm_handler(_signo, _stack_frame):
# Raises SystemExit(0):
sys.exit(0)
signal.signal(signal.SIGTERM, sigterm_handler)
signal.signal(signal.SIGINT, sigterm_handler)
@kostyll
kostyll / mxe_notes.md
Last active November 27, 2015 10:15
mxe workflow

1.download repo of mxe

2.make needed targets

make MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static' freeglut qt ...

  1. generate project

cmake . -DCMAKE_TOOLCHAIN_FILE=/cross/mxe/usr/i686-w64-mingw32.shared/share/cmake/mxe-conf.cmake

@kostyll
kostyll / proxy.py
Created November 17, 2015 08:17 — forked from bxt/proxy.py
A very basic caching python HTTP proxy server.
# Originally from http://sharebear.co.uk/blog/2009/09/17/very-simple-python-caching-proxy/
#
# Usage:
# A call to http://localhost:80000/example.com/foo.html will cache the file
# at http://example.com/foo.html on disc and not redownload it again.
# To clear the cache simply do a `rm *.cached`. To stop the server simply
# send SIGINT (Ctrl-C). It does not handle any headers or post data.
import BaseHTTPServer
import hashlib
@kostyll
kostyll / main.py
Created November 17, 2015 08:14 — forked from gear11/main.py
Simple Python proxy server based on Flask and Requests. See: http:/python-proxy-server/gear11.com/2013/12/python-proxy-server/
"""
A simple proxy server. Usage:
http://hostname:port/p/(URL to be proxied, minus protocol)
For example:
http://localhost:8080/p/www.google.com
"""