Skip to content

Instantly share code, notes, and snippets.

@maestrow
maestrow / post.md
Last active March 17, 2021 12:51
FSF vs OSI

Open Source Software Vs Free Software

Free software foundation was first introduced in 1985 by GNU founder Richard Stallman. Stallman believed that software beyond the monetary sense should be free to run, share, and modify.

Open source software movement came about by a gentlemen named Eric Raymond. Raymond believed that the free software movement needed to appeal to more commercial entities. Thus, Raymond founded the OSI - Open Source Initiative which introduced and encouraged the option of sharing software and modifying through the use of licenses. This ended up creating a platform in the marketplace for free software with a twist in comparison to the free software movement where true enthusiast of the movement believed it should be open and free without any restrictions to the end user.

Although the free software and open source m

@maestrow
maestrow / post.md
Created October 20, 2020 18:13
VSCode Remote SSH не работает через ProxyJump

Расширение Remote SSH для VSCode позволяет работать с файлами удаленной машины через ssh. В Windows 10 столкнулся с проблемой - если в параметрах ssh соединения используется директива ProxyJump, то Remote SSH не работает (не соединяется). Решил проблему тем, что обновил ssh https://chocolatey.org/packages/openssh до версии Win32 OpenSSH (Universal Installer) 8.1.0-beta.

@maestrow
maestrow / passgen.js
Last active June 15, 2020 16:38
Passsword generator bookmarklet (javascript)
javascript:(function() {
var lowers = 'abcdefghijklmnopqrstuvwxyz';
var uppers = lowers.toUpperCase();
var nums = '123456789';
var alphabeet = lowers + uppers + nums;
var pass = '';
for (var i = 0; i<8; i++) {
var x = Math.floor(Math.random() * alphabeet.length);
pass += alphabeet[x];
}
@maestrow
maestrow / readme.md
Last active December 7, 2020 05:45
Подписанные (pre-signed) URL для Яндекс Облака
@maestrow
maestrow / vimeo-download.py
Created June 12, 2020 12:50 — forked from alexeygrigorev/vimeo-download.py
Downloading segmented video from vimeo
import requests
import base64
from tqdm import tqdm
master_json_url = 'https://178skyfiregce-a.akamaihd.net/exp=1474107106~acl=%2F142089577%2F%2A~hmac=0d9becc441fc5385462d53bf59cf019c0184690862f49b414e9a2f1c5bafbe0d/142089577/video/426274424,426274425,426274423,426274422/master.json?base64_init=1'
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1]
resp = requests.get(master_json_url)
content = resp.json()
@maestrow
maestrow / post.md
Created June 5, 2020 17:26
WSL и docker

Использую Docker Desktop на WIN10. Далее все команды выполняются из debian на WSL. При запуске docker run -ti -v $PWD/data:/var/lib/postgresql/data postgres получал ошибку, что у var/lib/postgresql/data неправильный owner. Однако docker run -ti -v $HOME/data:/var/lib/postgresql/data postgres работает исправно. Но папки $HOME/data просто нет! Нет ни у одного пользователя внутри WSL /home, ни внутри %userprofile% в win10. Загадка!

Остановил Docker Desktop, поставил https://docs.docker.com/engine/install/debian/. В результате:

  1. Первая бага: https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269
  2. Вторая https://stackoverflow.com/questions/61140111/installing-docker-in-ubuntu-on-windows-10-failed-to-setup-ip-tables-unable-to
@maestrow
maestrow / post.md
Last active February 22, 2023 16:57
How to use html tags in markdown with remark-parse?

How to use html tags in markdown with remark-parse?

From documentation: Note that toHast.allowDangerousHTML does not work: it’s not possible to inject raw HTML with this plugin (as it’s mean to prevent having to use dangerouslySetInnerHTML).

But still there is a way to allow html tags. Thanks to ChristianMurphy suggestion.

I've made just couple improvements:

  1. Module rehype-dom-parse leads to error: 'document is not defined'. So I replace it with 'rehype-parse'.
  2. Extract rehypeParser from handler, so it's created only once.
  3. Also notice about sanitize: false
@maestrow
maestrow / post.md
Last active August 27, 2021 10:34
Python Data Apps