Skip to content

Instantly share code, notes, and snippets.

View antnzr's full-sized avatar
🌞

Anton Nazarenko antnzr

🌞
  • 18:05 (UTC +05:00)
View GitHub Profile
@antnzr
antnzr / check_num_simple.py
Created February 3, 2020 08:54
Скрипт проверяет каков результат рассмотрения заявления по программе переселения.
import os
import sys
from datetime import datetime
import requests
import xlrd
#############################################################
# Скрипт проверяет каков результат рассмотрения заявления по
# программе переселения. Файлы для проверки загружаются с сайта
sudo apt-get update
sudo apt-get install nginx
sudo systemctl start nginx
sudo nano /etc/nginx/sites-available/default
sudo cat /etc/nginx/nginx.conf
Контекст - разделы в файлах конфигурации в которых используются директивы (events, http, server)
Директивы - конкретные опции конфигурации. Состоит из имени опции и значения
@antnzr
antnzr / mongodb.md
Created July 5, 2020 05:20
mongo_cheet_sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@antnzr
antnzr / show-wifi-password
Last active August 12, 2020 12:32
show-wifi-password
open `cmd` as an admin
cd/
netsh
wlan show profile
# with your current SSID -> Beeline777
wlan show profile Beeline777 key=clear
@antnzr
antnzr / vbox_cli
Created August 14, 2020 06:21
virtual box cli
# a list of the VMs
VBoxManage list vms
# to run the "Ubuntu Server" VM
VBoxManage startvm "Ubuntu Server" --type headless
# to pause that VM
VBoxManage controlvm "Ubuntu Server" pause --type headless
# to restart that paused VM
@antnzr
antnzr / tokens.md
Created August 28, 2020 17:13 — 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

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@antnzr
antnzr / mongodb.workaround
Last active November 16, 2020 08:25
simple mongoDb replicaSet settings
# replicaSet
mkdir -p rs1 rs2 rs3
# or in windows /c/rs1 or /data/db/rs1
mongod --replSet myReplSet --logpath "rs1.log" --dbpath rs1 --port 27018 &
mongod --replSet myReplSet --logpath "rs2.log" --dbpath rs2 --port 27019 &
mongod --replSet myReplSet --logpath "rs3.log" --dbpath rs3 --port 27020 &
# then connect to
mongo --port 27018
@antnzr
antnzr / ultimate-ut-cheat-sheet.md
Created September 30, 2021 06:17 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@antnzr
antnzr / curl.md
Last active September 30, 2021 17:06 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@antnzr
antnzr / init.vim
Last active February 5, 2023 16:07
config for neovim ~/.config/nvim/init.vim
:set number relativenumber
:set nu rnu
:set autoindent " Indent a new line the same amount as the line just typed
:set tabstop=2 " Number of columns occupied by a tab
:set shiftwidth=2 " Width for autoindents
:set softtabstop=2 " See multiple spaces as tabstops so <BS> does the right thing
:set mouse=v " Enable mouse click
:set cc=100 " Set an 80 column border for good coding style
:set cursorline " highlight current cursorline
:set ttyfast " Speed up scrolling in Vim