Initial migration

This commit is contained in:
pro100ton 2024-11-02 14:05:10 +03:00
commit 70c3449f03
44 changed files with 3508 additions and 0 deletions

116
.zshrc Normal file
View file

@ -0,0 +1,116 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git vi-mode)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
alias vpsz="ssh root@185.241.55.216"
alias prnv="poetry run nvim"
alias remote_astra="ssh t0xa@172.31.142.161"
alias remote_sup="ssh t0xa@172.31.142.124"
alias air='~/go/bin/air'
# alias ohmyzsh="mate ~/.oh-my-zsh"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export PATH=$PATH:/Users/antonsalimov/go/bin

3
MANIFEST.md Normal file
View file

@ -0,0 +1,3 @@
# Yabai + skhd
- [Видос с базовой настройкой](https://www.youtube.com/watch?v=k94qImbFKWE)

1
README.md Normal file
View file

@ -0,0 +1 @@
Dot-files collection for various applications

224
i3/config Normal file
View file

@ -0,0 +1,224 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex --autostart --environment i3
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec alacritty
# Screenshots
bindsym Mod1+Shift+A exec "/usr/bin/flameshot gui"
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec --no-startup-id dmenu_run
# A more modern dmenu replacement is rofi:
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+b split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 pph
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#bar {
# status_command i3status
# font pango:JetBrainsMonoNL Nerd Font Mono 10
#}
# Polybar settings. Allow obly i3bar or polybar at one time
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
# Set gaps between windows
# Works only on i3 4.22+ version
gaps inner 6
# Change layout language
exec --no-startup-id setxkbmap -model pc105 -layout us,ru -option grp:alt_space_toggle
# Configure workspaces on monitors
workspace 1 output DP-2
workspace 3 output DP-2
workspace 2 output DP-4
workspace 4 output DP-4
# Set font
font pango:JetBrainsMonoNL Nerd Font Mono 10
# Set theme
default_border pixel 2
# class border backgr. text indicator child_border
client.focused #FB8B24 #272727 #FB8B24 #272727 #FB8B24
client.focused_inactive #333333 #626262 #FB8B24 #272727 #5f676a
client.unfocused #333333 #272727 #888888 #292d2e #222222
client.urgent #2f343a #900000 #ffffff #900000 #900000
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
client.background #ffffff
# Lockscreen binding
bindsym Control+Mod1+q exec "i3lock -c 000000"

9
mint/README.md Normal file
View file

@ -0,0 +1,9 @@
# cinnamon.css
Это файл темы, который я настраивал для своей оболочки cinnamon
Для его применения необходимо:
1. Выбрать тему в меню настроек темы
2. Перейти в папку `/usr/share/themes/<theme_name>/cinnamon/`
3. Открыть на редактирование или заменить файл `cinnamon.css` на файл в репо
# zshrc
Данный файл с настройками окружения `zsh`.
Данный файл находится в `home` директории: `~/`

1756
mint/cinnamon.css Normal file

File diff suppressed because it is too large Load diff

121
mint/zshrc Normal file
View file

@ -0,0 +1,121 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
alias nvimzsh="nvim ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias ssh134="ssh astra@172.16.122.134"
alias ssh21="ssh astra@10.10.14.21"
alias ssh129="ssh astra@10.11.12.129"
alias vpsz="ssh root@185.241.55.216"
alias remote_mate="ssh t0xa@172.31.142.60"
alias remote_astra="ssh t0xa@172.31.142.194"
alias vpnz="sudo ss-local -v -c /etc/shadowsocks-libev/config.json"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export PATH=$PATH:/usr/local/go/bin

26
neovim/Dockerfile Normal file
View file

@ -0,0 +1,26 @@
FROM ubuntu:latest
LABEL maintainer="pro100ton@gmail.com"
RUN apt-get update && apt-get install -y \
build-essential \
curl \
neovim \
git \
nodejs \
npm \
fzf \
golang-go \
python3 \
python3-pip \
python3-venv \
unzip \
ripgrep
RUN useradd -m nvim_playground
USER nvim_playground
RUN mkdir /home/nvim_playground/.config
RUN mkdir /home/nvim_playground/.config/nvim
WORKDIR /home/nvim_playground/.config/nvim
COPY . .

36
neovim/README.md Normal file
View file

@ -0,0 +1,36 @@
# File structure
.
├── Dockerfile
├── README.md
├── init.lua
└── lua
└── t0xa
├── core
│   └── options.lua
└── plugins
└── lazy.lua
## init.lua
Файл, в который "смотрит" neovim при [старте](https://neovim.io/doc/user/starting.html#initialization).
## t0xa
Вместо того, чтобы использовать обращение к файлам настройки напрямую - используется данная
папка.
Можно обходиться без нее, однако для избегания конфликтов нейминга решил что буду использовать
так.
## core
Тут хранятся базовые настройки для neovim
## plugins
Папка для хранения и настроек плагинов для neovim
# Main options
# Useful links
- [neovim stup guide](https://www.youtube.com/watch?v=6pAG3BHurdM)
# Команда для запуска контейнеров
```
docker build -t nvim:nvim . && docker run -it --user nvim_playground nvim:nvim
```

3
neovim/init.lua Normal file
View file

@ -0,0 +1,3 @@
-- Omitting `lua` directory, because neovim autmaticaly serching in it
require("t0xa.core.options")
require("t0xa.lazy")

View file

@ -0,0 +1,40 @@
local opt = vim.opt -- Shorcut to scip writing vim.opt.* in settings beneath
-- enable line number and relative line number
opt.number = true -- This will show the line number cursor is currently standing
opt.relativenumber = true -- This will enable relative numbers on the left side
-- tabs & indentation
opt.shiftwidth = 2 -- Set spaces for tabs == 2
opt.tabstop = 2 -- Set spaces for indent with == 2
opt.expandtab = true -- use number of spaces to insert a <Tab>
opt.softtabstop = 2
-- search settings
opt.ignorecase = true -- ignore case when searching
opt.smartcase = true -- If mixing cases while searching = you want case-sensitive search
-- Cursor line setting
opt.cursorline = true
-- Turn on termguicolors for colorschemes
-- (Have to use true color terminal to see theese setting work)
opt.termguicolors = true
opt.background = "dark" -- colorschemes that can be light or dark will be made dark
opt.signcolumn = "yes" -- show sigh columns so that text doesn't shift
-- backspace setting
opt.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position
-- clipboard
opt.clipboard:append("unnamedplus") -- config to set up clipboard as default register
-- split windows settings
opt.splitright = true -- split vertical window to the right
opt.splitbelow = true -- split horizontal window to the bottom
-- disable swap files creation
opt.swapfile = false
-- Add line at 88 symbols
opt.colorcolumn = "88"

25
neovim/lua/t0xa/lazy.lua Normal file
View file

@ -0,0 +1,25 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- Initializing `lazy` lib and
require("lazy").setup({
{
import = "t0xa.plugins",
},
{
import = "t0xa.plugins.colorschemes",
},
{
import = "t0xa.plugins.lsp",
},
})

View file

@ -0,0 +1,31 @@
return {
"windwp/nvim-autopairs",
event = { "InsertEnter" },
dependencies = {
"hrsh7th/nvim-cmp",
},
config = function()
-- import nvim-autopairs
local autopairs = require("nvim-autopairs")
-- configure autopairs
autopairs.setup({
check_ts = true, -- enable treesitter
ts_config = {
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
java = false, -- don't check treesitter on java
},
})
-- import nvim-autopairs completion functionality
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
-- import nvim-cmp plugin (completions plugin)
local cmp = require("cmp")
-- make autopairs and completion work together
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
}

View file

@ -0,0 +1,6 @@
return {
"FabijanZulj/blame.nvim",
config = function()
require("blame").setup()
end
}

View file

@ -0,0 +1,16 @@
return {
"folke/tokyonight.nvim",
dependencies = {
"ellisonleao/gruvbox.nvim",
"sainnhe/everforest",
"sainnhe/gruvbox-material",
"rebelot/kanagawa.nvim",
},
lazy = false,
priority = 1000,
config = function()
vim.g.gruvbox_material_enable_italic = true
vim.cmd.colorscheme("gruvbox-material")
end,
}

View file

@ -0,0 +1,3 @@
return {
"rebelot/kanagawa.nvim",
}

View file

@ -0,0 +1,19 @@
return {
"numToStr/Comment.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
-- import comment plugin safely
local comment = require("Comment")
local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
-- enable comment
comment.setup({
-- for commenting tsx, jsx, svelte, html files
pre_hook = ts_context_commentstring.create_pre_hook(),
})
end,
}

View file

@ -0,0 +1,4 @@
return {
"stevearc/dressing.nvim",
event = "VeryLazy"
}

View file

@ -0,0 +1,109 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",
-- Some additional QOL impovements like rename imports when file is renamed
{ "antosha417/nvim-lsp-file-operations", config = true },
-- Improved functionality when working with neovim config
{ "folke/neodev.nvim", opts = {} },
},
config = function()
-- import lspconfig plugin
local lspconfig = require("lspconfig")
-- import mason_lspconfig plugin
local mason_lspconfig = require("mason-lspconfig")
-- import cmp-nvim-lsp plugin
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local keymap = vim.keymap -- for conciseness
-- nvim_create_autocmd - used to execute some logic automaticaly on a specific event
-- Here it is used the LSP server attaches to file
vim.api.nvim_create_autocmd("LspAttach", {
-- Grouping together autocommands. Here we creating new group and calling it "UserLspConfig"
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
-- callback defining logic to execute on the event
callback = function(ev)
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf, silent = true }
-- set keybinds
opts.desc = "Show LSP references"
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
opts.desc = "Go to declaration"
keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
opts.desc = "Show LSP definitions"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
opts.desc = "Show LSP type definitions"
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
opts.desc = "Smart rename"
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
opts.desc = "Show buffer diagnostics"
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
opts.desc = "Show line diagnostics"
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
opts.desc = "Restart LSP"
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
opts.desc = "Run formatting on current buffer"
keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, opts)
end,
})
-- used to enable autocompletion (assign to every lsp server config)
local capabilities = cmp_nvim_lsp.default_capabilities()
mason_lspconfig.setup_handlers({
-- default handler for installed servers
function(server_name)
lspconfig[server_name].setup({
capabilities = capabilities,
})
end,
["lua_ls"] = function()
-- configure lua server (with special settings)
lspconfig["lua_ls"].setup({
capabilities = capabilities,
settings = {
Lua = {
-- make the language server recognize "vim" global
diagnostics = {
globals = { "vim" },
},
completion = {
callSnippet = "Replace",
},
},
},
})
end,
})
end,
}

View file

@ -0,0 +1,54 @@
return {
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim", -- util for better language servers manipulation
"WhoIsSethDaniel/mason-tool-installer.nvim",
},
config = function()
-- import mason
local mason = require("mason")
-- import mason-lspconfig
local mason_lspconfig = require("mason-lspconfig")
local mason_tool_installer = require("mason-tool-installer")
-- enable mason and configure icons
mason.setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
})
mason_lspconfig.setup({
-- list of servers for mason to install
ensure_installed = {
"lua_ls",
"pyright",
"gopls",
},
})
mason_tool_installer.setup({
ensure_installed = {
"prettier", -- prettier formatter
"stylua", -- lua formatter
"isort", -- python formatter
"black", -- python formatter
"pylint",
"flake8",
-- Astra settings for 3.7 Python
-- { "isort", version = "5.11.5" }, -- python formatter
-- { "black", version = "23.3.0" }, -- python formatter
-- { "pylint", version = "2.9.0" },
-- { "pylint", version = "2.9.0" },
-- { "flake8", version = "4.0.1" },
"eslint_d",
},
})
end,
}

View file

@ -0,0 +1,22 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
local lualine = require("lualine")
-- configure lualine with modified theme
lualine.setup({
options = {
theme = "gruvbox-material",
},
sections = {
lualine_c = {
{
"filename",
file_status = true,
path = 2,
},
},
},
})
end,
}

View file

@ -0,0 +1,15 @@
return {
"danymat/neogen",
version = "*", -- Follow only stable versions
enabled = true,
config = function()
local neogen = require("neogen")
neogen.setup({
enabled = true
})
local keymap = vim.keymap
local opts = { noremap = true, silent = true }
keymap.set("n", "<Leader>ids", ":lua require('neogen').generate()<CR>", opts)
end,
-- config = true,
}

View file

@ -0,0 +1,21 @@
return {
"nvimtools/none-ls.nvim",
dependencies = {
"nvimtools/none-ls-extras.nvim",
},
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.isort,
null_ls.builtins.formatting.gofumpt,
null_ls.builtins.formatting.goimports_reviser,
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.golines,
require("none-ls.diagnostics.flake8"),
},
})
end,
}

View file

@ -0,0 +1,64 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter", -- Only load plugin when in INSERT mode
dependencies = {
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
},
"saadparwaiz1/cmp_luasnip", -- for autocompletion
"rafamadriz/friendly-snippets", -- useful snippets
"onsails/lspkind.nvim", -- vs-code like pictograms
},
config = function()
-- Load custom snippets from path
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({ paths = vim.fn.stdpath("config") .. "/snippets/" })
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
completion = {
completeopt = "menu,menuone,preview,noselect",
},
snippet = { -- configure how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm { select = true },
}),
-- sources for autocompletion
-- !! Priority is important - autocompletion will be ordered from top to bottom
sources = cmp.config.sources({
{ name = "nvim_lsp" }, -- nvim LSP servers
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
}),
-- configure lspkind for vs-code like pictograms in completion menu
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
})
end,
}

View file

@ -0,0 +1,40 @@
return {
"nvim-tree/nvim-tree.lua",
dependencies = "nvim-tree/nvim-web-devicons",
config = function()
local nvimtree = require("nvim-tree")
-- recommended settings from nvim-tree documentation
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
nvimtree.setup({
view = {
-- width = 35,
adaptive_size = true,
relativenumber = true,
},
-- disable window_picker for explorer to work well with window splits
actions = {
open_file = {
window_picker = {
enable = true,
},
},
},
-- Custom list of vim regex for names that will not be shown
filters = {
custom = { ".DS_Store" },
},
-- Show files ignored by git
git = {
ignore = false,
},
})
-- set nvim-tree keypmaps
local keymap = vim.keymap
keymap.set('n', '<leader>nt', ':NvimTreeToggle<CR>', {desc = "Toggle file explorer"})
keymap.set('n', '<leader>nf', ':NvimTreeFindFileToggle<CR>', {desc = "Toggle file explorer on current file"})
end
}

View file

@ -0,0 +1,3 @@
return {
"nvim-lua/plenary.nvim"
}

View file

@ -0,0 +1,38 @@
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.6",
dependencies = {
"nvim-lua/plenary.nvim",
-- Improving performance of finder
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
-- Display dev icons
"nvim-tree/nvim-web-devicons",
"folke/todo-comments.nvim",
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
telescope.setup({
defaults = {
path_display = { "smart" },
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result
},
},
},
})
telescope.load_extension("fzf") -- load FZF extension to improve performance
local builtin = require("telescope.builtin")
local keymap = vim.keymap
keymap.set("n", "<leader>ff", builtin.find_files, { desc = "FZF: find files in cwd" })
keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "FZF: find string in cwd" })
keymap.set("n", "<leader>fb", builtin.buffers, { desc = "FZF: display opened buffers" })
keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "FZF: display help tags" })
keymap.set("n", "<leader>ft", "<cmd>TodoTelescope<cr>", { desc = "FZF: display TODO comments" })
end,
}

View file

@ -0,0 +1,21 @@
return {
"folke/todo-comments.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local todo_comments = require("todo-comments")
-- set keymaps
local keymap = vim.keymap -- for conciseness
keymap.set("n", "]t", function()
todo_comments.jump_next()
end, { desc = "Next todo comment" })
keymap.set("n", "[t", function()
todo_comments.jump_prev()
end, { desc = "Previous todo comment" })
todo_comments.setup()
end,
}

View file

@ -0,0 +1,66 @@
return {
"nvim-treesitter/nvim-treesitter",
-- open this plugin on two events:
-- BufReadPre - open existing file
-- BufNewFile - open new file
event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate", -- Run whenever this plugin is installed or updated
dependencies = {
"windwp/nvim-ts-autotag", -- Auto-closing functionality within treesitter
},
config = function()
-- import nvim-treesitter plugin
local treesitter = require("nvim-treesitter.configs")
-- Configure treesitter
-- treesitter.setup({
-- -- enable syntax highlighting
-- highligh = {
-- enable = true,
-- },
--
-- -- enable better indentation
-- indent = {
-- enable = true,
-- },
--
-- -- enable auto-tagging
-- autotag = {
-- enable = true,
-- },
--
-- -- ensure these languages parsers are installed
-- ensure_installed = {
-- "python",
-- "go",
-- "lua",
-- "bash",
-- "json",
-- "javascript",
-- "jq",
-- "markdown",
-- "markdown_inline",
-- "regex",
-- "vim",
-- "dockerfile",
-- },
-- })
-- end,
treesitter.setup({
ensure_installed = {
"python",
"lua",
"vim",
"vimdoc",
"query",
"elixir",
"heex",
"javascript",
"html",
},
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end,
}

View file

@ -0,0 +1,17 @@
return {
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
}

View file

@ -0,0 +1,19 @@
return {
"folke/which-key.nvim",
-- Telling nvim that it can load this plugin later, and that it is not
-- that important for initial UI
event = "VeryLazy",
-- Function that will run while neovim startup instead of when plugin is actualy loads
init = function()
-- How long which-key will wait until activation
vim.o.timeout = true
vim.o.timeoutlen = 500
end,
-- Options that will pass to setup function, but we are leaving it empty to use
-- default configuration
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
}

View file

@ -0,0 +1,15 @@
{
"name": "custom-snippets",
"engines": {
"vscode": "^1.11.0"
},
"contributes": {
"snippets": [
{
"language": "python",
"path": "./python.json"
}
]
}
}

View file

@ -0,0 +1,26 @@
{
"implog": {
"prefix": "implog",
"body": [
"import logging",
"_log = logging.getLogger(__name__)"
],
"description": "Snippet for importing logger"
},
"Log event": {
"prefix": "logevent",
"body": [
"_log.error('${1:delimiter}' * 60)",
"_log.error(${2})",
"_log.error('${1:delimiter}' * 60)"
],
"description": "Snippet for inserting error log"
},
"Log debug": {
"prefix": "logdebug",
"body": [
"_log.debug(${1:deug_body})"
],
"description": "Snippet for inserting debug log"
}
}

254
polybar/config.ini Normal file
View file

@ -0,0 +1,254 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[global/wm]
margin-top = 0
margin-bottom = 0
[module/i3]
type = internal/i3
pin-workspaces = true
show-urgent = true
label-focused = %index%
label-focused-foreground = #ffffff
label-focused-background = #3f3f3f
label-focused-underline = #fba922
label-focused-padding = 3
label-unfocused-padding = 1
[colors]
background = #282A2E
background-alt = #373B41
foreground = #C5C8C6
primary = #F0C674
secondary = #8ABEB7
disabled = #707880
[bar/example]
width = 100%
height = 24pt
radius = 6
monitor = ${env:MONITOR:}
; dpi = 96
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3pt
border-size = 0pt
border-color = #00000000
border-left = 6
border-right = 6
border-top = 6
padding-left = 0
padding-right = 1
module-margin = 1
separator = |
separator-foreground = ${colors.disabled}
font-0 = JetBrainsMonoNL Nerd Font Mono;3
modules-left = i3 xwindow
modules-right = pulseaudio network-home network-vpn memory cpu xkeyboard date
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.disabled}
[module/pulseaudio]
type = internal/pulseaudio
format-volume-prefix = "VOL "
format-volume-prefix-foreground = ${colors.primary}
format-volume = <label-volume>
label-volume = %percentage%%
label-muted = muted
label-muted-foreground = ${colors.disabled}
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
; label-layout = %{T2}%{T-}
label-layout =  %name%
label-layout-foreground = ${colors.primary}
layout-icon-0 = ru;ru
layout-icon-1 = us;us
label-indicator-on = %name%
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ${colors.background}
label-indicator-background = ${colors.secondary}
format = <label-indicator><label-layout>
[module/memory]
type = internal/memory
interval = 2
format-prefix = "RAM "
format-prefix-foreground = ${colors.primary}
label = %percentage_used:2%%
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "CPU "
format-prefix-foreground = ${colors.primary}
label = %percentage:2%%
[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
[module/date]
type = internal/date
interval = 1
date = %a %d-%b %H:%M:%S
date-alt = %Y-%m-%d %H:%M:%S
label = %date%
label-foreground = ${colors.primary}
[settings]
screenchange-reload = true
pseudo-transparency = true
; vim:ft=dosini
[module/network-home]
type = internal/network
; Name of the network interface to display. You can get the names of the
; interfaces on your machine with `ip link`
; Wireless interfaces often start with `wl` and ethernet interface with `eno` or `eth`
interface = eno1
; If no interface is specified, polybar can detect an interface of the given type.
; If multiple are found, it will prefer running interfaces and otherwise just
; use the first one found.
; Either 'wired' or 'wireless'
; New in version 3.6.0
interface-type = wired
; Seconds to sleep between updates
; Default: 1
interval = 3.0
; NOTE: Experimental (might change or be removed in the future)
; Test connectivity every Nth update by pinging 8.8.8.8
; In case the ping fails 'format-packetloss' is used until the next ping
; A value of 0 disables the feature
; Default: 0
;ping-interval = 3
; @deprecated: Define min width using token specifiers (%downspeed:min% and %upspeed:min%)
; Minimum output width of upload/download rate
; Default: 3
udspeed-minwidth = 5
; Accumulate values from all interfaces
; when querying for up/downspeed rate
; Default: false
accumulate-stats = true
; Consider an `UNKNOWN` interface state as up.
; Some devices like USB network adapters have
; an unknown state, even when they're running
; Default: false
unknown-as-up = true
; The unit used for displaying network speeds
; For example if set to the empty string, a speed of 5 KB/s is displayed as 5 K
; Default: B/s
; New in version 3.6.0
speed-unit = ''
[module/network-vpn]
type = internal/network
; Name of the network interface to display. You can get the names of the
; interfaces on your machine with `ip link`
; Wireless interfaces often start with `wl` and ethernet interface with `eno` or `eth`
interface = vpn0
; If no interface is specified, polybar can detect an interface of the given type.
; If multiple are found, it will prefer running interfaces and otherwise just
; use the first one found.
; Either 'wired' or 'wireless'
; New in version 3.6.0
interface-type = wired
; Seconds to sleep between updates
; Default: 1
interval = 3.0
; NOTE: Experimental (might change or be removed in the future)
; Test connectivity every Nth update by pinging 8.8.8.8
; In case the ping fails 'format-packetloss' is used until the next ping
; A value of 0 disables the feature
; Default: 0
;ping-interval = 3
; @deprecated: Define min width using token specifiers (%downspeed:min% and %upspeed:min%)
; Minimum output width of upload/download rate
; Default: 3
udspeed-minwidth = 5
; Accumulate values from all interfaces
; when querying for up/downspeed rate
; Default: false
accumulate-stats = true
; Consider an `UNKNOWN` interface state as up.
; Some devices like USB network adapters have
; an unknown state, even when they're running
; Default: false
unknown-as-up = true
; The unit used for displaying network speeds
; For example if set to the empty string, a speed of 5 KB/s is displayed as 5 K
; Default: B/s
; New in version 3.6.0
speed-unit = ''

22
polybar/launch.sh Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Terminate already running bar instances
# If all your bars have ipc enabled, you can use
polybar-msg cmd quit
# Otherwise you can use the nuclear option:
# killall -q polybar
# Launch bar1 and bar2
echo "---" | tee -a /tmp/example.log
#polybar example --config=$HOME/.config/polybar/config.ini 2>&1 | tee -a /tmp/example.log & disown
if type "xrandr"; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
echo $m
MONITOR=$m polybar --reload example --config=$HOME/.config/polybar/config.ini &
done
else
polybar --reload example --config=$HOME/.config/polybar/config.ini &
fi
echo "Bars launched..."

11
scripts/README.md Normal file
View file

@ -0,0 +1,11 @@
# db_dropper
Скрипт для проделывания следующих процедур:
1. Подключение к БД и сброс баз данных `console_db` и `logs_db`
2. Создание новых БД с аналогичными названиями и присваивания владельцем `console_user`
3. Переход в директорию проекта и активация виртуального окружения `python`
4. Очистка миграций, отсутствующих в `git`
5. Создание новых миграций
6. Применение миграций
7. Создание суперпользователя
8. Деактивация виртуального окружения.

40
scripts/db_dropper Executable file
View file

@ -0,0 +1,40 @@
#!/bin/bash
# Database details
DBS=("console_db" "logs_db")
DB_OWNER="console_user"
# Drop and create databases
for DB in "${DBS[@]}"; do
sudo -u postgres -H -- psql -c "DROP DATABASE IF EXISTS $DB"
sudo -u postgres -H -- psql -c "CREATE DATABASE $DB OWNER $DB_OWNER"
done
PROJECT_DIR="/home/t0xa/Documents/backend"
VENV_DIR="$PROJECT_DIR/.venv"
cd "$PROJECT_DIR" || { echo "Project directory not found!"; exit 1; }
source "$VENV_DIR/bin/activate"
git clean -xf */migrations/
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py migrate --database logs
python3 manage.py shell -c "
from django.contrib.auth import get_user_model;
User = get_user_model();
if not User.objects.filter(email='a@a.ru').exists():
User.objects.create_superuser('a@a.ru', password='T1Rules@123')
"
deactivate
# sudo -u postgres -H -- psql -c "DROP DATABASE console_db"
# sudo -u postgres -H -- psql -c "DROP DATABASE logs_db"
# sudo -u postgres -H -- psql -c "CREATE DATABASE console_db OWNER console_user"
# sudo -u postgres -H -- psql -c "CREATE DATABASE logs_db OWNER console_user"
# cd /home/t0xa/Documents/backend
# source .venv/bin/activate
# # python3 manage.py makemigrations
# python3 manage.py migrate
# python3 manage.py shell -c "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('a@a.ru', password='T1Rules@123')"
# deactivate

54
skhd/skhdrc Normal file
View file

@ -0,0 +1,54 @@
# -- Changing Window Focus --
# change window focus within space
alt - j : yabai -m window --focus south
alt - k : yabai -m window --focus north
alt - h : yabai -m window --focus west
alt - l : yabai -m window --focus east
# -- Modifying the Layout --
#
# rotate layout clockwise
shift + alt - r : yabai -m space --rotate 270
# flip along y-axis
# shift + alt - y : yabai -m space --mirror y-axis
# flip along x-axis
# shift + alt - x : yabai -m space --mirror x-axis
# toggle window float
shift + alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2
# -- Modifying Window Size --
# maximize a window
shift + alt - f : yabai -m window --toggle zoom-fullscreen
# balance out tree of windows (resize to occupy same area)
shift + alt - e : yabai -m space --balance
# swap windows
shift + alt - j : yabai -m window --swap south
shift + alt - k : yabai -m window --swap north
shift + alt - h : yabai -m window --swap west
shift + alt - l : yabai -m window --swap east
# move window to space #
shift + alt - 1 : yabai -m window --space 1;
shift + alt - 2 : yabai -m window --space 2;
shift + alt - 3 : yabai -m window --space 3;
shift + alt - 4 : yabai -m window --space 4;
shift + alt - 5 : yabai -m window --space 5;
shift + alt - 6 : yabai -m window --space 6;
shift + alt - 7 : yabai -m window --space 7;
# Move between monitors
alt - s: yabai -m display --focus west
alt - g: yabai -m display --focus east
# Resize panes in space
ctrl + cmd - h : yabai -m window west --resize right:-20:0 2> /dev/null || yabai -m window --resize right:-20:0
ctrl + cmd - j : yabai -m window north --resize bottom:0:20 2> /dev/null || yabai -m window --resize bottom:0:20
ctrl + cmd - k : yabai -m window south --resize top:0:-20 2> /dev/null || yabai -m window --resize top:0:-20
ctrl + cmd - l : yabai -m window east --resize left:20:0 2> /dev/null || yabai -m window --resize left:20:0

View file

@ -0,0 +1,19 @@
# Use Node.js LTS image as base
FROM node:21-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY ./reactapp/package.json /app/package.json
RUN npm config --global set 'registry=https://nexuswatchman.t1-consulting.ru/repository/npm-group/'
RUN npm config --global set 'fund=false'
RUN npm install react-scripts@3.0.1 -g --silent
RUN npm install
# Create environment file
COPY ./reactapp/ /app
RUN npm run build
FROM nginx:stable-alpine
COPY --from=build /app/dist usr/share/nginx/html
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,30 @@
# Контейнеризация react приложения Купол.Управление
## Структура папок для запуска
```
.
├── Dockerfile
├── nginx
│   └── nginx.conf
├── reactapp
│   ├── ...
```
где:
- `.` - build контекст приложения;
- Папка `nginx` - конфиг для контейнера с nginx;
- Папка `reactapp` - папка, куда клонируется реакт проект Купол.Управление.
## Команды для сборки и запуска приложения
Для сборки используется команда:
```
docker build -t pro100ton:kupol-front-prod .
```
Для запуска используется команда:
```
docker run -it --rm -p 1337:80 pro100ton:kupol-front-prod
```

View file

@ -0,0 +1,55 @@
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://172.31.142.161:8080;
}
location /media {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://172.31.142.161:8080;
}
location /ssh/ {
proxy_pass http://172.31.142.161:9590/;
proxy_http_version 1.1;
proxy_read_timeout 300;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
}
location /ws {
proxy_pass http://172.31.142.161:9590;
proxy_http_version 1.1;
proxy_read_timeout 300;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

4
tmux/README.md Normal file
View file

@ -0,0 +1,4 @@
# Установка
1. Копируем в `~/.` папку, чтобы было: `~/.tmux.conf`
2. Выходим из tmux
3. Заходим обратно и выполняем `prefix + I`

35
tmux/tmux.conf Normal file
View file

@ -0,0 +1,35 @@
set-option -sa terminal-overrides ",xterm*:Tc"
set -g mouse on
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
# set -g @plugin 'dreamsofcode-io/catppuccin-tmux'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'egel/tmux-gruvbox'
set -g @tmux-gruvbox 'dark' # or 'light'
# Shift Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# Open panes in the same directory
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# set vi-mode
set-window-option -g mode-keys vi
# keybindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

15
yabai/yabairc Normal file
View file

@ -0,0 +1,15 @@
# bsp, stack or float
yabai -m config layout bsp
yabai -m config window_placement second_split
# padding
yabai -m config top_padding 6
yabai -m config bottom_padding 6
yabai -m config right_padding 6
yabai -m config left_padding 6
# mouse settings
yabai -m config mouse_follows_focus on
yabai -m mouse_drop_action swap