Skip to content

Instantly share code, notes, and snippets.

View galchenkov's full-sized avatar
💻
Working hard

Aleksandr Galchenkov galchenkov

💻
Working hard
View GitHub Profile
@galchenkov
galchenkov / Установка Outline VPN на Ubuntu 20.04.md
Created March 22, 2022 10:21 — forked from YPermitin/Установка Outline VPN на Ubuntu 20.04.md
Инструкция по развертыванию собственного VPN-сервиса на базе Outline VPN

Установка Outline VPN на Ubuntu 20.04

Outline VPN - это бесплатный инструмент с открытым исходным кодом, позволяющий развернуть собственную VPN на Вашем собственном сервере или на машине облачного провайдера. Подробную информацию Вы можете узнать здесь и здесь.

В своем составе имеет как графические инструменты, так и средства работы через командную строку. Позволяет использовать VPN как на настольных компьютерах, так и на мобильных устройствах.

Прежде чем начать

Вам нужен сервер. Да, его нужно арендовать, учитывая его местоположение. Например, если Вам нужно получать доступ к ресурсам, которые недоступны в текущем местоположении, но доступны, например, в Канаде, то смело арендуйте виртуальную машину в AWS, Digital Ocean или любом другом месте.

@galchenkov
galchenkov / aboutNodeJsArchitecture.md
Created February 13, 2020 22:19 — forked from zmts/aboutNodeJsArchitecture.md
A little bit about Node.js API Architecture

A little bit about Node.js API Architecture (Архитектура/паттерны организации кода Node.js приложений)

node.js

TL;DR

code: https://github.com/zmts/supra-api-nodejs

Предисловие

Одной из болезней Node.js комьюнити это отсутствие каких либо крупных фреймворков, действительно крупных уровня Symphony/Django/RoR/Spring. Что является причиной все ещё достаточно юного возраста данной технологии. И каждый кузнец кует как умеет ну или как в интернетах посоветовали. Собственно это моя попытка выковать некий свой подход к построению Node.js приложений.

@galchenkov
galchenkov / fingerprint.md
Created February 13, 2020 22:04 — forked from zmts/fingerprint.md
Get browser fingerprint example (fingerprintjs2)

Get browser fingerprint example (fingerprintjs2)

import * as Fingerprint2 from 'fingerprintjs2'

function _getFingerprint () {
  return new Promise((resolve, reject) => {
    async function getHash () {
      const options = {
        excludes: {
@galchenkov
galchenkov / canvasArrowhead.js
Created May 9, 2019 15:02 — forked from jwir3/canvasArrowhead.js
Code to create an arrowhead on an html5 canvas
/**
* Draw an arrowhead on a line on an HTML5 canvas.
*
* Based almost entirely off of http://stackoverflow.com/a/36805543/281460 with some modifications
* for readability and ease of use.
*
* @param context The drawing context on which to put the arrowhead.
* @param from A point, specified as an object with 'x' and 'y' properties, where the arrow starts
* (not the arrowhead, the arrow itself).
* @param to A point, specified as an object with 'x' and 'y' properties, where the arrow ends
@galchenkov
galchenkov / letsencrypt_2018.md
Created January 29, 2019 14:22 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@galchenkov
galchenkov / tokens.md
Created January 16, 2019 16:12 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Preconditions:

В данной заметке рассматривается работа JWT с симметичным алгоритмом шифрования (HS256/HS384/HS512)

Основы:

Аутентификация(authentication, от греч. αὐθεντικός [authentikos] – реальный, подлинный; от αὐθέντης [authentes] – автор) - это процесс проверки учётных данных пользователя (логин/пароль). Проверка подлинности пользователя путём сравнения введённого им логина/пароля с данными сохранёнными в базе данных.

Авторизация(authorization — разрешение, уполномочивание) - это проверка прав пользователя на доступ к определенным ресурсам.

@galchenkov
galchenkov / image base64 encode
Created February 9, 2015 10:45
Get base64 encoded image
request.get imageUrl, (error, response, body) ->
if not error and response.statusCode == 200
data = "data:" + response.headers["content-type"] + ";base64," + new Buffer(body).toString('base64')
sudo apt-get update
sudo apt-get install libfreetype6 libfreetype6-dev libfontconfig
# /etc/apt/sources.list should contain these:
# deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
# deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
sudo echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections

How to install PhantomJS on Ubuntu

Version: 1.9.7

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
Перевод организационно-правовых форм юридических лиц
http://www.alba-translating.ru/index.php/ru/articles/glossary/legalentity.html
ОАО (Открытое акционерное общество)
OJSC (Open Joint-Stock Company)
АО (Акционерное общество)
JSC (Joint-Stock Company)
ООО (Общество с ограниченной ответственностью)