This commit is contained in:
parent
365e0feddc
commit
ce19d6a62c
24 changed files with 212 additions and 96 deletions
|
@ -1,7 +1,7 @@
|
|||
If:
|
||||
PathMatch: '.*\.(c|h)'
|
||||
CompileFlags:
|
||||
Add: [ -std=c99 ]
|
||||
Add: [ -xc, -std=c99 ]
|
||||
|
||||
---
|
||||
If:
|
||||
|
|
41
.config/nvim/.luarc.json
Normal file
41
.config/nvim/.luarc.json
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"workspace.library": [
|
||||
"/home/wzray/.local/share/nvim/lazy/neodev.nvim/types/stable",
|
||||
"/usr/share/nvim/runtime/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-surround/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/telescope-fzf-native.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-tree.lua/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/cmp-nvim-lsp/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/cmp-buffer/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/lspkind.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/lualine.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-web-devicons/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-treesitter-textobjects/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-treesitter-context/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-treesitter/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/indent-blankline.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-notify/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-colorizer.lua/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/mason.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/lazy.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/LuaSnip/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-lastplace/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/telescope.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/Navigator.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/trouble.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/bufferline.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/Comment.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-lspconfig/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/neodev.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/onedark.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/plenary.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/fidget.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-autopairs/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/todo-comments.nvim/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/nvim-cmp/lua",
|
||||
"/home/wzray/.local/share/nvim/lazy/telescope-emoji.nvim/lua",
|
||||
"/usr/share/nvim/runtime",
|
||||
"/home/wzray/.dotfiles/.config/nvim/lua",
|
||||
"${3rd}/luv/library"
|
||||
]
|
||||
}
|
|
@ -33,6 +33,8 @@
|
|||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
|
||||
"vim-bbcode": { "branch": "master", "commit": "6fb28c6deae5844ee2bf0b97ef2fea04bd3d4eac" },
|
||||
"vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "320b18fba2a4f2fe3c8225c778c687e0d2620384" },
|
||||
"vim-peekaboo": { "branch": "master", "commit": "cc4469c204099c73dd7534531fa8ba271f704831" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }
|
||||
|
|
|
@ -9,7 +9,7 @@ vim.wo.relativenumber = true
|
|||
vim.o.mouse = 'a'
|
||||
|
||||
-- Indentation
|
||||
vim.o.tabstop = 8
|
||||
vim.o.tabstop = 4
|
||||
vim.o.expandtab = true
|
||||
vim.o.shiftwidth = 4
|
||||
vim.o.autoindent = true
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
local servers = {
|
||||
bashls = {},
|
||||
cmake = {},
|
||||
clangd = {},
|
||||
eslint = {},
|
||||
gopls = {},
|
||||
|
@ -8,9 +9,12 @@ local servers = {
|
|||
kotlin_language_server = {},
|
||||
lua_ls = require('lsp.lua_ls'),
|
||||
pyright = {},
|
||||
ruby_lsp = {},
|
||||
rust_analyzer = {},
|
||||
ts_ls = {},
|
||||
ruby_lsp = {},
|
||||
yamlls = require('lsp.yamlls'),
|
||||
jsonls = {},
|
||||
svls = {}
|
||||
}
|
||||
|
||||
vim.lsp.set_log_level("debug")
|
||||
|
@ -44,22 +48,6 @@ end
|
|||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
for server_name, config in pairs(servers) do
|
||||
lspconfig[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
[server_name] = config ~= {} and {
|
||||
settings = {
|
||||
[server_name] = {
|
||||
config
|
||||
}
|
||||
}
|
||||
} or {}
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
for server_name, config in pairs(servers) do
|
||||
lspconfig[server_name].setup(vim.tbl_deep_extend('keep', {
|
||||
capabilities = capabilities,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
return {
|
||||
settings = {
|
||||
root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
return {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = true,
|
||||
|
@ -9,3 +10,4 @@ return {
|
|||
telemetry = { enable = false },
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
9
.config/nvim/lua/lsp/yamlls.lua
Normal file
9
.config/nvim/lua/lsp/yamlls.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
settings = {
|
||||
redhat = {
|
||||
telemetry = {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
return {
|
||||
'isobit/vim-caddyfile',
|
||||
'rcarriga/nvim-notify',
|
||||
'stefandtw/quickfix-reflector.vim',
|
||||
'tpope/vim-fugitive',
|
||||
'junegunn/vim-peekaboo',
|
||||
'tpope/vim-sleuth',
|
||||
'vim-scripts/iptables',
|
||||
{ 'akinsho/bufferline.nvim', opts = {}, dependencies = { 'navarasu/onedark.nvim' } },
|
||||
|
@ -12,4 +14,5 @@ return {
|
|||
{ 'norcalli/nvim-colorizer.lua', opts={ '*' }, dependencies = { 'navarasu/onedark.nvim' } },
|
||||
-- { 'wakatime/vim-wakatime', event = 'VeryLazy' },
|
||||
{ 'williamboman/mason.nvim', opts = {} },
|
||||
'Winseven4lyf/vim-bbcode',
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
return {
|
||||
'junegunn/vim-peekaboo',
|
||||
config = function ()
|
||||
vim.g.peekaboo_window = 'enew'
|
||||
end
|
||||
}
|
|
@ -13,6 +13,10 @@ return {
|
|||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
|
||||
require('treesitter-context').setup {
|
||||
max_lines = 6
|
||||
}
|
||||
end, 0)
|
||||
end
|
||||
}
|
||||
|
|
30
.config/nvim/lua/plugins/ufo.lua
Normal file
30
.config/nvim/lua/plugins/ufo.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
-- 'kevinhwang91/nvim-ufo',
|
||||
-- dependencies = {
|
||||
-- 'kevinhwang91/promise-async'
|
||||
-- },
|
||||
-- config = function()
|
||||
-- vim.defer_fn(function()
|
||||
-- vim.o.foldcolumn = '0'
|
||||
-- vim.o.foldlevel = 99
|
||||
-- vim.o.foldlevelstart = 99
|
||||
-- vim.o.foldenable = true
|
||||
--
|
||||
-- vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
||||
-- vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
||||
--
|
||||
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- capabilities.textDocument.foldingRange = {
|
||||
-- dynamicRegistration = false,
|
||||
-- lineFoldingOnly = true
|
||||
-- }
|
||||
-- local language_servers = vim.lsp.get_clients()
|
||||
-- for _, ls in ipairs(language_servers) do
|
||||
-- require('lspconfig')[ls].setup({
|
||||
-- capabilities = capabilities
|
||||
-- })
|
||||
-- end
|
||||
-- require('ufo').setup()
|
||||
-- end, 0)
|
||||
-- end
|
||||
}
|
|
@ -1,11 +1,12 @@
|
|||
[ -f "~/.config/.fix-tty" ] || return
|
||||
[ -f "$HOME/.config/.fix-tty" ] || return
|
||||
|
||||
process_id="$$"
|
||||
(
|
||||
if [ "$(inxi -aG | grep -c 'Monitor')" -eq 1 ]; then
|
||||
setfont Uni3-Terminus32x16.psf.gz
|
||||
if [ "$(inxi -aG | grep -c 'Monitor')" = "1" ]; then
|
||||
setfont ter-v32n
|
||||
stty -F /proc/$process_id/fd/0 rows 65 cols 195
|
||||
else
|
||||
setfont Uni3-Terminus16.psf.gz
|
||||
setfont ter-v16n
|
||||
stty -F /proc/$process_id/fd/0 rows 90 cols 320
|
||||
fi >/dev/null 2>&1 &
|
||||
)
|
||||
|
|
|
@ -32,6 +32,7 @@ bindkey "^[[1;3C" forward-word
|
|||
bindkey "^[[1;5C" forward-word
|
||||
bindkey "^[[1;3D" backward-word
|
||||
bindkey "^[[1;5D" backward-word
|
||||
bindkey "^[[3~" delete-char
|
||||
|
||||
bindkey "^[n" backward-word
|
||||
bindkey "^[m" forward-word
|
||||
|
@ -88,10 +89,13 @@ alias d="diff --color -u "
|
|||
alias rgf="rg --files | rg "
|
||||
alias 7z="7zz" # for whatever reason 7z provides 7zz binary in debian
|
||||
alias wt="watch --color -d -cn 0.1 "
|
||||
alias cal="ncal -b"
|
||||
alias .e="source .env"
|
||||
alias .e="set -a && source .env && set +a"
|
||||
alias vimu="vim -u /dev/null"
|
||||
alias reswap="sudo swapoff /swapfile && sudo swapon /swapfile"
|
||||
alias reswap="sudo bash -c 'echo Working...; swapoff /swapfile && sudo swapon /swapfile'"
|
||||
alias make="make -j$(nproc)"
|
||||
alias py="python3"
|
||||
alias neofetch="fastfetch"
|
||||
alias open="xdg-open"
|
||||
|
||||
# function aliases
|
||||
bl() { brightnessctl set "$1"% > /dev/null; }
|
||||
|
@ -107,12 +111,15 @@ compdef '_files -g "*.md"' md
|
|||
# git aliases
|
||||
gl() { git log --decorate "$@" | bat }; compdef '_git; _git-log' gl
|
||||
gus() { git branch --set-upstream-to="${1:?}/${2:?}" "${2:?}"}; compdef '_git; _git-push' gus
|
||||
gpo() { git push --set-upstream origin ${1:-$(git rev-parse --abbrev-ref HEAD)}}
|
||||
alias ga="git add"
|
||||
alias gb="git branch"
|
||||
alias gc="git commit"
|
||||
alias gca="git commit --amend --no-edit"
|
||||
alias gca="git commit --allow-empty-message --amend --no-edit"
|
||||
alias gck="git checkout"
|
||||
alias gcl="git clone"
|
||||
alias gcls="git clone --depth=1"
|
||||
alias gcm="git commit --allow-empty-message -m ''"
|
||||
alias gcn="git clean"
|
||||
alias gcp="git cherry-pick"
|
||||
alias gd="git diff"
|
||||
|
@ -122,7 +129,6 @@ alias gi="git init"
|
|||
alias gla="gl --all"
|
||||
alias gm="git merge"
|
||||
alias gp="git push"
|
||||
alias gpo="git push origin"
|
||||
alias gpu="git pull"
|
||||
alias gr="git restore"
|
||||
alias grj="git rebase"
|
||||
|
@ -134,9 +140,10 @@ alias grt="git reset"
|
|||
alias gs="git status"
|
||||
alias gsc="git switch -c"
|
||||
alias gsh="git show"
|
||||
alias gsp="git stash pop"
|
||||
alias gsj="git stash"
|
||||
alias gsp="git stash pop"
|
||||
alias gt="git tag"
|
||||
alias gus="git fetch --unshallow"
|
||||
|
||||
# docker aliases
|
||||
alias dc="docker compose"
|
||||
|
|
BIN
.fonts/EngraversGothic-Bold.ttf
Normal file
BIN
.fonts/EngraversGothic-Bold.ttf
Normal file
Binary file not shown.
|
@ -11,6 +11,6 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
ssh -p 8022 u0_a343@"$phone_ip" 'su -c setprop service.adb.tcp.port 5555 && su -c stop adbd && su -c start adbd'
|
||||
ssh -p 8022 u0_a230@"$phone_ip" 'su -c setprop service.adb.tcp.port 5555 && su -c stop adbd && su -c start adbd'
|
||||
sleep 0.1
|
||||
adb connect "$phone_ip"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
url="$(git remote get-url "${1:-origin}")"
|
||||
|
||||
if [[ "$url" =~ ^https?:\/\/ ]]; then
|
||||
echo "$url"
|
||||
xdg-open "$url"
|
||||
elif [[ "$url" =~ ^[a-zA-Z0-9_-]+@([a-zA-Z0-9_.-]+):(.*) ]]; then
|
||||
url="https://${BASH_REMATCH[1]}/${BASH_REMATCH[2]}"
|
||||
url="${url%.git}"
|
||||
|
|
|
@ -46,8 +46,6 @@ def run_until_successful(fn: Callable[..., T], *args, **kwargs) -> T:
|
|||
return fn(*args, **kwargs)
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
break # no it's not >( # pyright: ignore
|
||||
|
||||
|
||||
def send_message(chat_id: int, text: str, token: str):
|
||||
|
@ -180,14 +178,22 @@ class Api:
|
|||
self._first_auth()
|
||||
|
||||
|
||||
def get_status_list(self):
|
||||
def _make_request(self, method: Literal["GET", "POST"], endpoint: str):
|
||||
self._ensure_authorized()
|
||||
r = run_until_successful(self._session.get, 'https://my.itmo.ru/api/requests/my', timeout=2)
|
||||
r = run_until_successful(self._session.request, method, f'https://my.itmo.ru/api/{endpoint}', timeout=2)
|
||||
|
||||
if r.status_code == 403:
|
||||
self._first_auth() # do full reauth if 403 after self._ensure_authorized()
|
||||
r = run_until_successful(self._session.request, method, f'https://my.itmo.ru/api/{endpoint}', timeout=2)
|
||||
|
||||
if r.status_code != 200 or r.json()['error_code'] != 0:
|
||||
raise ApiException(r.status_code, r.text)
|
||||
|
||||
return [StatusObject.from_dict(obj) for obj in r.json()['result']]
|
||||
return r.json()
|
||||
|
||||
|
||||
def get_status_list(self):
|
||||
return [StatusObject.from_dict(obj) for obj in self._make_request('GET', 'requests/my')['result']]
|
||||
|
||||
|
||||
def to_dict(self) -> Any:
|
||||
|
@ -305,13 +311,13 @@ def main():
|
|||
print('\n'.join(map(format_status, message)))
|
||||
file.write(' '.join(map(format_status, message)))
|
||||
|
||||
# update_filter = LastUpdateFilter(ignore_now=True)
|
||||
# for message in listen_for_messages(api, filter_func=update_filter):
|
||||
# formatted_messages = list(map(format_message, message))
|
||||
# print('\n---\n'.join(formatted_messages))
|
||||
# for message in formatted_messages:
|
||||
# send_message(owner_id, message, bot_token)
|
||||
# update_filter.update()
|
||||
update_filter = LastUpdateFilter(ignore_now=True)
|
||||
for message in listen_for_messages(api, filter_func=update_filter):
|
||||
formatted_messages = list(map(format_message, message))
|
||||
print('\n---\n'.join(formatted_messages))
|
||||
for message in formatted_messages:
|
||||
send_message(owner_id, message, bot_token)
|
||||
update_filter.update()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
IFNAME="wg_lva"
|
||||
PIPE="/var/run/vpnd.sock"
|
||||
send_cmd() {
|
||||
[ -p $PIPE ] && echo "$@" > $PIPE && \
|
||||
cat < $PIPE
|
||||
}
|
||||
|
||||
IFNAME="rix"
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
'd'|'-d'|'--dpi') DPI="_d"
|
||||
;;
|
||||
'm'|'msk') IFNAME='wg_msk'
|
||||
;;
|
||||
'-v'|'--verbose') VERBOSE=1
|
||||
;;
|
||||
*) echo "Wrong argument!"; exit 1
|
||||
;;
|
||||
'm'|'msk') IFNAME='msk';;
|
||||
'-v'|'--verbose') VERBOSE=1;;
|
||||
*) echo "Wrong argument!"; exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
@ -22,18 +23,17 @@ else
|
|||
set -x
|
||||
fi
|
||||
|
||||
UP_NAME="$(ip link show | grep 'wg' | cut -d ' ' -f 2 | sed 's/://')"
|
||||
UP_NAME="$(send_cmd status)"
|
||||
|
||||
IFNAME="${IFNAME}${DPI}"
|
||||
if [ -n "${UP_NAME}" ]; then
|
||||
if [ "${UP_NAME}" != "${IFNAME}" ]; then
|
||||
wg-quick down "${UP_NAME}"
|
||||
wg-quick up "${IFNAME}"
|
||||
send_cmd down
|
||||
send_cmd up "$IFNAME"
|
||||
else
|
||||
wg-quick down "${UP_NAME}"
|
||||
send_cmd down
|
||||
fi
|
||||
else
|
||||
wg-quick up "${IFNAME}"
|
||||
send_cmd up "$IFNAME"
|
||||
fi
|
||||
|
||||
pkill -36 dwmblocks
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# shellcheck disable=SC2034
|
||||
|
||||
die() {
|
||||
[ -n "$oc_pid" ] && kill -s TERM $oc_pid
|
||||
echo "exitting..."
|
||||
rm -f $PIPE
|
||||
exit 0
|
||||
|
@ -11,6 +12,7 @@ trap 'die' SIGTERM SIGQUIT SIGINT
|
|||
|
||||
PIPE="/var/run/vpnd.sock"
|
||||
oc_pid=
|
||||
up_name=
|
||||
|
||||
[ -p $PIPE ] && exit 1
|
||||
[ "$(id -u)" != "0" ] && exit 1
|
||||
|
@ -21,7 +23,7 @@ for config in /etc/openconnect/config_*; do
|
|||
CONFIGS+=("${config#config_}")
|
||||
done
|
||||
|
||||
COMMANDS=("up" "down")
|
||||
COMMANDS=("up" "down" "status")
|
||||
|
||||
in_arr() {
|
||||
declare -n arr="$2"
|
||||
|
@ -37,12 +39,22 @@ down() {
|
|||
kill -s TERM $oc_pid
|
||||
wait $oc_pid
|
||||
oc_pid=
|
||||
up_name=
|
||||
}
|
||||
|
||||
up() {
|
||||
[ -n "$oc_pid" ] && down
|
||||
openconnect --config "/etc/openconnect/config_$1" &
|
||||
oc_pid="$!"
|
||||
up_name="$1"
|
||||
}
|
||||
|
||||
status() {
|
||||
# if [ -z "$up_name" ]; then
|
||||
# echo "DOWN" > $PIPE
|
||||
# else
|
||||
# fi
|
||||
echo "$up_name" > $PIPE
|
||||
}
|
||||
|
||||
main() {
|
||||
|
@ -50,18 +62,25 @@ main() {
|
|||
|
||||
while :; do
|
||||
read -r cmd ifname < $PIPE
|
||||
|
||||
if ! in_arr "$ifname" "CONFIGS"; then
|
||||
echo "ERROR: Invalid interface $ifname" > $PIPE
|
||||
elif ! in_arr "$cmd" "COMMANDS"; then
|
||||
if ! in_arr "$cmd" "COMMANDS"; then
|
||||
echo "ERROR: Invalid command $cmd" > $PIPE
|
||||
else
|
||||
case "$cmd" in
|
||||
"up") up "$ifname" > $PIPE ;;
|
||||
"down") down > $PIPE ;;
|
||||
"up")
|
||||
if ! in_arr "$ifname" "CONFIGS"; then
|
||||
echo "ERROR: Invalid interface $ifname" > $PIPE
|
||||
else
|
||||
up "$ifname"
|
||||
echo "$ifname" > $PIPE
|
||||
fi
|
||||
;;
|
||||
"down") down; echo "down" > $PIPE;;
|
||||
"status") status;;
|
||||
esac
|
||||
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
echo "Running..."
|
||||
main
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
PIPE="/var/run/vpnd.sock"
|
||||
|
||||
[ -p $PIPE ] &&
|
||||
echo "$@" > $PIPE &&
|
||||
cat < $PIPE
|
|
@ -25,14 +25,13 @@ remove() {
|
|||
}
|
||||
|
||||
|
||||
create_or_activate() {
|
||||
# shellcheck disable=SC1091
|
||||
if [ -d "${VENV_FOLDER}" ]; then
|
||||
source "${VENV_FOLDER}/bin/activate"
|
||||
else
|
||||
create_or_activate() {
|
||||
if [ ! -d "${VENV_FOLDER}" ]; then
|
||||
python3 -m venv "${VENV_FOLDER}"
|
||||
source "${VENV_FOLDER}/bin/activate"
|
||||
fi
|
||||
|
||||
source "${VENV_FOLDER}/bin/activate"
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
IFNAME="$(ip link show | grep 'wg_' | cut -d ' ' -f 2 | sed 's/://' | sed 's/wg_//' | tr '[:lower:]' '[:upper:]' | sed 's/_D/ (dpi)/')"
|
||||
|
||||
if [ -n "${IFNAME}" ]; then
|
||||
echo " ${IFNAME}"
|
||||
PIPE="/var/run/vpnd.sock"
|
||||
send_cmd() {
|
||||
[ -p $PIPE ] && echo "$@" > $PIPE && \
|
||||
cat < $PIPE
|
||||
}
|
||||
|
||||
IFNAME="$(send_cmd status)"
|
||||
|
||||
case "$IFNAME" in
|
||||
"msk") IFNAME="Moscow";;
|
||||
"rix") IFNAME="Riga";;
|
||||
esac
|
||||
|
||||
if [ -n "$IFNAME" ]; then
|
||||
echo " $IFNAME"
|
||||
fi
|
||||
|
|
|
@ -6,6 +6,10 @@ Host *.zvray.ru *.wzray.com *.vpn.wzray.ru
|
|||
User root
|
||||
Port 8022
|
||||
|
||||
Host docker
|
||||
User root
|
||||
Hostname 10.161.192.10
|
||||
|
||||
Host 192.168.1.1 10.161.0.1 10.162.0.1 openwrt
|
||||
User root
|
||||
UserKnownHostsFile /dev/null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue