Skip to content

Instantly share code, notes, and snippets.

View DeckerSU's full-sized avatar

DeckerSU DeckerSU

View GitHub Profile
@DeckerSU
DeckerSU / tokens.md
Created November 1, 2021 13:25 — 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

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@DeckerSU
DeckerSU / cf-ddns.rsc
Created September 8, 2021 13:00 — forked from ChrisG661/cf-ddns.rsc
Mikrotik RouterOS Cloudflare Dynamic DNS Script
# Cloudflare Dynamic DNS update script
# Required policy: read, write, test, policy
# Add this script to scheduler
# Install DigiCert root CA or disable check-certificate
# Configuration ---------------------------------------------------------------------
:local TOKEN "__APITOKEN__"
:local ZONEID "__ZONEIDENTIFIER__"
:local RECORDID "__RECORDIDENTIFIER__"
:local RECORDNAME "__DNSRECORD__"
@DeckerSU
DeckerSU / multiple_ssh_setting.md
Created September 2, 2021 14:33 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@DeckerSU
DeckerSU / rsync_daemon_over_ssh.md
Created May 6, 2021 03:28 — forked from trendels/rsync_daemon_over_ssh.md
Rsync daemon mode over ssh

rsync daemon mode over ssh

There are several common ways to do rsync backups of hosts over ssh:

  1. As a non-root user. Upsides: very secure. Downside: cannot back up sensitive files.
  2. As root, with a public key. Downsides: Whoever has the private key has full root access to the host being backed up.
  3. As root, with a public key and a "forced command". Upsides: Restricts access to the server. Downsides: Requires either careful matching of rsync options (which might change over time), or "validator" scripts. Neither idea sounds very appealing to me.
  4. Running rsync in daemon mode on the host being backed up. Upsides: Lots of useful options, like read-only mode, running as a different user if required, server-side excludes/includes, etc. Downsides: Opens up a TCP port that has full filesystem read access and is hard to secure (Ideally you could make the rsync daemon use a unix socket instead, that could be secured by filesystem permissions, but I haven't found a way to do that).

Here is another option t

@DeckerSU
DeckerSU / gitian-BTC-v0.16.3.md
Created October 8, 2020 23:15 — forked from cryptozeny/gitian-BTC-v0.16.3.md
gitian cross compilation for BTC v0.16.3
@DeckerSU
DeckerSU / keybase.md
Created February 13, 2020 18:15
keybase.md

Keybase proof

I hereby claim:

  • I am DeckerSU on github.
  • I am deckersu (https://keybase.io/deckersu) on keybase.
  • I have a public key whose fingerprint is FD9A 772C 7300 F4C8 94D1 A819 FE50 4808 62E6 451C

To claim this, I am signing this object:

@DeckerSU
DeckerSU / keepassxc_build_ubuntu_16.04_static.sh
Created September 27, 2019 22:04
Build script for KeePassXC for Ubuntu 16.04 (x64)
#!/bin/bash
# Build script for KeePassXC for Ubuntu 16.04 (x64) by Decker (q) 2019
# Follow the original instructions, i.e. mkdir build, cd build, place script in created
# build folder and run. You should get your keepassxc binaries in build/release folder.
CURDIR=$(pwd)
PREFIX=${CURDIR}/depends
BUILD=${CURDIR}/release
@DeckerSU
DeckerSU / gist:873ff22a9be7d5c3bca0fb874d7fc9c4
Created May 6, 2019 15:06 — forked from luckydev/gist:b2a6ebe793aeacf50ff15331fb3b519d
Increate max no of open files limit in Ubuntu 16.04/18.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf
@DeckerSU
DeckerSU / test1
Created October 22, 2018 00:39
test1
some important text
@DeckerSU
DeckerSU / test1
Created October 22, 2018 00:36
test1
test1