Skip to content

Instantly share code, notes, and snippets.

View overdese's full-sized avatar
:octocat:
Remote work

Dmitry overdese

:octocat:
Remote work
View GitHub Profile
@overdese
overdese / disable_access_on_ip
Last active May 7, 2022 10:37
Nginx: disable direct access on IP
# Disable direct access on ip
# generate stub ssl cert
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/stub-selfsigned.key -out /etc/ssl/certs/stub-selfsigned.crt
server {
listen x.x.x.x:80 default_server;
listen x.x.x.x:443 default_server;
ssl_certificate "/etc/ssl/certs/stub-selfsigned.crt";
@overdese
overdese / tokens.md
Created April 4, 2021 09:10 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

@overdese
overdese / index.md
Created October 1, 2015 10:43
Elementary OS Freya переключение раскладки

Shift+Alt:
gsettings set org.pantheon.desktop.gala.keybindings switch-input-source "['<Alt>Shift_L', '<Alt>Shift_R', '<Shift>Alt_L', '<Shift>Alt_R']"

Shift+Ctrl:
gsettings set org.pantheon.desktop.gala.keybindings switch-input-source "['<Ctrl>Shift_L', '<Ctrl>>Shift_R', '<Shift>Control_L', '<Shift>Control_R']"

@overdese
overdese / dynamicFormWTF.md
Last active June 15, 2021 06:26
WTF SelectField with dynamic choice

class wtforms.fields.SelectField(default field arguments, choices=[], coerce=unicode, option_widget=None)
Select fields keep a choices property which is a sequence of (value, label) pairs. The value portion can be any type in theory, but as form data is sent by the browser as strings, you will need to provide a function which can coerce the string representation back to a comparable object.

Select fields with static choice values:

class PastebinEntry(Form):
    language = SelectField(u'Programming Language', choices=[('cpp', 'C++'), ('py', 'Python'), ('text', 'Plain Text')])
    
@overdese
overdese / filewrapper.py
Created December 9, 2014 08:10
This script looking directory with *.txt files and wrap this files by needed functions
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
import codecs
import os
from random import choice, shuffle
from copy import deepcopy
from itertools import cycle
class FileOperation(object):
@overdese
overdese / Default (Windows).sublime-keymap
Created July 28, 2014 04:41
Sublime config for layout
[
{
"keys": ["alt+shift+6"],
"command": "set_layout",
"caption" : "1+2 Grid",
"args":
{
"cols": [0.0, 0.55, 1.0],
"rows": [0.0, 0.55, 1.0],
"cells":