This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# ========================================================================== | |
# Dependencies: | |
# 1) Python 3.6+ interpreter | |
# 2) fonttools Python library (https://github.com/fonttools/fonttools) | |
# - install with `pip3 install fonttools` | |
# | |
# Usage: | |
# python3 update-font-family.py [FONT FAMILY NAME] [FONT PATH 1] <FONT PATH ...> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
from urllib import urlencode | |
import requests | |
from purl import URL | |
from django.conf import settings | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name project-name.com; | |
charset utf-8; | |
client_max_body_size 512m; | |
location /static/ { | |
alias /home/webmaster/apps/project_name/public/static/; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum remove fuse fuse-devel fuse-s3fs | |
yum install gcc libstdc++-devel gcc-c++ curl-devel libxml2-devel openssl-devel mailcap | |
cd /usr/src/ | |
wget https://github.com/libfuse/libfuse/releases/download/fuse-2.9.6/fuse-2.9.6.tar.gz | |
tar xzf fuse-2.9.6.tar.gz | |
cd fuse-2.9.6 | |
./configure --prefix=/usr/local | |
make && make install | |
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig | |
ldconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2008-10-17", | |
"Id": "http better policy", | |
"Statement": [ | |
{ | |
"Sid": "readonly policy", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::media.example.com/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch /etc/sysconfig/i18n | |
nano /etc/sysconfig/i18n | |
LANG="ru_RU.UTF-8" | |
SUPPORTED="ru_RU.UTF-8:ru_RU:ru" | |
SYSFONT="latarcyrheb-sun16" | |
~/.bashrc | |
export LC_ALL=en_US.UTF-8 | |
export LANG=ru_RU.UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /tmp | |
yum groupinstall "Development tools" | |
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel wget python-devel libxml2 libxml2-devel libxslt libxslt-devel python-pip libtiff-devel libjpeg-devel libzip-devel freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel htop | |
wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz | |
tar xf Python-3.8.2.tgz | |
cd Python-3.8.2 | |
./configure --prefix=/usr/local --enable-shared | |
make | |
make install | |
touch /etc/ld.so.conf.d/local.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user webmaster; | |
worker_processes 1; | |
error_log /home/webmaster/logs/nginx/error.log; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 2048; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
# длина блока кодирования | |
CHUNK_LENGTH = 8 | |
# проверка длины блока | |
assert not CHUNK_LENGTH % 8, 'Длина блока должна быть кратна 8' | |
# вычисление контрольных бит | |
CHECK_BITS = [i for i in range(1, CHUNK_LENGTH + 1) if not i & (i - 1)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user webmaster; | |
worker_processes 1; | |
daemon off; | |
error_log /home/webmaster/logs/nginx/error.log; | |
pid /tmp/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
NewerOlder