Skip to content

Instantly share code, notes, and snippets.

Alexander Okrugin aviafelix

  • Yaroslavl
View GitHub Profile
aviafelix /
Created Oct 31, 2018 birthday quest '18
#!/usr/bin/env python3
from pprint import pprint
'А' : 'О',
'а' : 'о',
'Б' : 'П',
'б' : 'п',
'В' : 'Р',
'в' : 'р',
aviafelix /
Last active May 6, 2018
Compare json, simplejson, ujson, msgpack, umsgpack, cbor, cbor2, flunn on CPython 3.5.2, Ubuntu, VMware Player

Compare json, simplejson, ujson, msgpack, umsgpack, cbor, cbor2, flunn performance on CPython 3.5.2

Tests were performed on Ubuntu 16.04 guest OS running on VMware Player

import timeit
    setup='import {lib} as qwerty\nfrom test_json import data\n',
aviafelix /
Created May 5, 2018
RKN: Nothing personal
#!/usr/bin/env python3
STRING_RKNZ = "Роскомнадзор запретил букву"
def gen_rualphabet_uppercase():
l = list(chr(l) for l in range(ord('А'), ord('Я')+1))
l.insert(ord('Е') - ord('А') + 1, 'Ё')
return "".join(l)
View .bash_history_ceph_aviafelix
sudo -i
su root
sudo -i
sudo shutdown -s
sudo shutdown -t 0
ip addr show
sudo yum install kbd
loadkeys sk
sudo loadkeys sk
localectl list=kezmaps
aviafelix / start_browser_windows.cmd
Last active Mar 13, 2018
Launch browser from command line in Windows
View start_browser_windows.cmd
:: Launch browser for testing
@echo off
set CHROME_BROWSER_PATH=C:\Program Files^ (x86)\Google\Chrome\Application\
set CHROME_EXEC=chrome.exe
set CHROME_USER_DATA="%~dp0%project_name_user_data"
set CHROME_PARAMS=--user-data-dir=%CHROME_USER_DATA% ^
--start-maximized ^
--no-first-run ^
--no-default-browser-check ^
aviafelix /
Last active Apr 6, 2020
Patching binary files with Python
#/usr/bin/env python3
Yet another simple binary patcher
patches = [
# 1 Windows x64, version 3, build 1234
'file': 'file_1.bin',
'offset': 0x0BA950,
'original': b'\x00',
aviafelix / site.conf
Created May 2, 2016 — forked from paskal/site.conf
Nginx configuration for best security and modest performance. Full info on
View site.conf
#
# latest version on
# security test score:
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat & wget -O - | tee -a /etc/nginx/ssl/domain.pem > /dev/null
You can’t perform that action at this time.