Skip to content

Instantly share code, notes, and snippets.

View yaroslav-vorobyov's full-sized avatar
🎯
Focusing

Yaroslav Vorobyov yaroslav-vorobyov

🎯
Focusing
  • Saint-Petersburg
  • 22:36 (UTC +03:00)
View GitHub Profile
@yaroslav-vorobyov
yaroslav-vorobyov / docker-unlock.md
Created June 3, 2024 07:08
Прокси сервер для registry-1.docker.io - hub.docker.com / Обход блокировки Docker Registry - зеркало Docker Hub

Этот прокси можно использовать, если вы получаете ошибку

Error response from daemon: pull access denied for nginx, repository does not exist or may 
require 'docker login': denied: 403 Forbidden Since Docker is a US company, 
we must comply with US export control regulations. In an effort to comply with these, we now block 
all IP addresses that are located in Cuba, Iran, North Korea, Republic of Crimea, Sudan, and Syria. 
If you are not in one of these cities, countries, or regions and are blocked, 
please reach out to https://hub.docker.com/support/contact/
@yaroslav-vorobyov
yaroslav-vorobyov / settings.json
Created April 11, 2024 13:27 — forked from Tynael/settings.json
Add Git Bash to Windows Terminal via settings.json
{
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe",
"guid": "{ae44d6a3-cf84-4725-8e60-0039021b35fb}",
"hidden": false,
"icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
"name": "Git Bash",
"startingDirectory": "%USERPROFILE%",
"tabTitle": "Git Bash"
}
@yaroslav-vorobyov
yaroslav-vorobyov / cheatsheet.ps1
Created March 3, 2024 15:35 — forked from pcgeek86/cheatsheet.ps1
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Command -Module Microsoft* # Retrieves a list of all the PowerShell commands exported from modules named Microsoft*
Get-Command -Name *item # Retrieves a list of all commands (native binaries + PowerShell commands) ending in "item"
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command
@yaroslav-vorobyov
yaroslav-vorobyov / customize-GitBashPrompt.md
Created January 12, 2024 14:46 — forked from adojos/customize-GitBashPrompt.md
Git: Customizing GitBash Shell Prompt #gitbash

Customizing GitBash Shell Prompt and Theme


As an example, lets assume we want to change / customize the following :

  • Change the Title of the GitBash window from default [MINGW64:/directoryName] to [Tushars Gitbash (Win64)]
  • Change the default prompt () to a customized prompt e.g [GitBash (Win64):> ]

👉 Note ($HOME/.bash_profile vs $HOME/.bashrc vs $HOME/.config):

The below described method only focusses on customizing the 'GitBash' prompt and NOT about customizing default 'Bash' prompt on Linux terminals. Hence this method uses the '$HOME/.config' folder for storing 'GitBash' prompt customization as per XDG Directory Specs. If you are looking for customizing default 'Bash' prompt for your Linux terminal you should be using '$HOME/.bashrc' for storing your customization and hence advised not to continue with this method.

@yaroslav-vorobyov
yaroslav-vorobyov / winterm-gitbash.md
Created January 4, 2024 10:14 — forked from plembo/winterm-gitbash.md
Git-Bash in Windows Terminal

Git-Bash in Windows Terminal

Windows Terminal is a nice console for Windows. With the latest version of it a prior or subsequent install of Git for Windows does does not show up among the available terminals, so if you want it you'll need to add it manually.

NOTE: The latest versions of Windows Terminal allow you to create and edit profiles in Settings. Use the paths for bash.exe and git-for-windows.ico below and it will work as advertised (don't just copy and paste: the path separators won't work in the Settings gui if they're escaped). Apart from being able to set things up visually, a big advantage of the new method is that you don't have to make up a guid :-)

To add Git-Bash to Windows Terminal, open the Windows Terminal Settings and paste in block of profile code:

@yaroslav-vorobyov
yaroslav-vorobyov / git-ssh-auth-win-setup.md
Created January 3, 2024 09:14 — forked from bsara/git-ssh-auth-win-setup.md
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@yaroslav-vorobyov
yaroslav-vorobyov / rank_metrics.py
Created August 5, 2023 15:20 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@yaroslav-vorobyov
yaroslav-vorobyov / Linux.md
Created March 21, 2023 11:22 — forked from fomvasss/Linux.md
Settings OS Linux after install

After install OS

Upgrate OS

sudo apt upgrate

Add swap (optional)

sudo fallocate -l 4G /swapfile
Аббревиатура REST расшифровывается как representational state transfer — «передача состояния представления» или, лучше сказать, представление данных в удобном для клиента формате. Термин “REST” был введен Роем Филдингом в 2000 г. Основная идея REST в том, что каждое обращение к сервису переводит клиентское приложение в новое состояние. По сути, REST — не протокол и не стандарт, а подход, архитектурный стиль проектирования API.
Любой ресурс имеет ID, по которому можно получить данные.
Сервер не хранит состояние — это значит, сервер не отделяет один вызов от другого, не сохраняет все сессии в памяти.
Методы POST и PUT должны возвращать обратно объект, который они изменили или создали, — это позволит сократить время обращения к сервису вдвое.
Возвращайте соответствующие http коды статуса в каждом ответе. Успешные ответы должны содержать следующие коды:
200 — для GET запроса и для синхронных DETELE и PATCH
201 — для синхронного POST запроса
202 — для асинхронных POST, DELETE и PATCH запросов
@yaroslav-vorobyov
yaroslav-vorobyov / GIT info.md
Created March 21, 2023 11:17 — forked from fomvasss/GIT info.md
GIT info.md

GIT, Composer

Новый проект

- cd sites/
- git clone git@bitbucket.org:webwest/basebest.ru.git
- cd basebest
- git status
- laravel new myapp (or) composer create-project --prefer-dist laravel/laravel myapp