lkjasdklfjasdf

This commit is contained in:
Arthur K. 2024-12-18 12:23:31 +03:00
parent f4b88690f7
commit 96fbeb821a
Signed by: wzray
GPG key ID: B97F30FDC4636357
5 changed files with 51 additions and 20 deletions

View file

@ -14,6 +14,7 @@ setopt hist_ignore_all_dups
setopt hist_ignore_space setopt hist_ignore_space
setopt hist_find_no_dups setopt hist_find_no_dups
setopt hist_save_no_dups setopt hist_save_no_dups
setopt inc_append_history
# change word-style # change word-style
autoload -U select-word-style autoload -U select-word-style
@ -65,6 +66,14 @@ alias ....="cd ../../../"
alias .....="cd ../../../../" alias .....="cd ../../../../"
alias ......="cd ../../../../../" alias ......="cd ../../../../../"
alias .......="cd ../../../../../../" alias .......="cd ../../../../../../"
alias ........="cd ../../../../../../../"
alias .........="cd ../../../../../../../../"
alias ..........="cd ../../../../../../../../../"
alias ...........="cd ../../../../../../../../../../"
alias ............="cd ../../../../../../../../../../../"
alias .............="cd ../../../../../../../../../../../../"
alias ..............="cd ../../../../../../../../../../../../../"
alias ...............="cd ../../../../../../../../../../../../../../"
# aliases # aliases
alias rz="exec zsh" alias rz="exec zsh"
@ -81,6 +90,7 @@ alias 7z="7zz" # for whatever reason 7z provides 7zz binary in debian
alias wt="watch --color -d -cn 0.1 " alias wt="watch --color -d -cn 0.1 "
alias cal="ncal -b" alias cal="ncal -b"
alias .e="source .env" alias .e="source .env"
alias vimu="vim -u /dev/null"
# function aliases # function aliases
bl() { brightnessctl set "$1"% > /dev/null; } bl() { brightnessctl set "$1"% > /dev/null; }
@ -94,20 +104,24 @@ compdef '_files -g "*.md"' md
# git aliases # git aliases
gl() { git log --decorate "$@" | bat }; compdef '_git; _git-log' gl gl() { git log --decorate "$@" | bat }; compdef '_git; _git-log' gl
alias gs="git status" alias ga="git add"
alias gb="git branch"
alias gc="git commit" alias gc="git commit"
alias gca="git commit --amend --no-edit" alias gca="git commit --amend --no-edit"
alias gp="git push"
alias ga="git add"
alias gck="git checkout" alias gck="git checkout"
alias gb="git branch" alias gcl="git clone"
alias gd="git diff" alias gd="git diff"
alias gds="gd --staged"
alias gf="git fetch"
alias gi="git init"
alias gm="git merge"
alias gp="git push"
alias gpu="git pull"
alias gr="git restore" alias gr="git restore"
alias grb="git rebase"
alias grs="git restore --staged" alias grs="git restore --staged"
alias grt="git reset" alias grt="git reset"
alias gcl="git clone" alias gs="git status"
alias gds="gd --staged"
alias gm="git merge"
# docker aliases # docker aliases
alias dc="docker compose" alias dc="docker compose"

View file

@ -1,8 +1,8 @@
[core] [core]
pager = LESS="-Rz3" delta pager = LESS="-Rz3" delta
[user] [user]
email = me@wzray.ru email = me@wzray.com
name = Arthur Khachaturov name = Arthur K.
[init] [init]
defaultBranch = main defaultBranch = main
[commit] [commit]

View file

@ -7,7 +7,7 @@ HEIGHT=1080
ASPECT_OFFSET=240 ASPECT_OFFSET=240
OUTPUT_NAME='DVI-I-1-1' OUTPUT_NAME='DVI-I-1-1'
command() { get_cmd() {
echo "ffmpeg -ac 2 -ar 44100 -frame_size 2048 -fragment_size 2048 -f pulse -ac 2 -i Mkchromecast.monitor -f x11grab -r 30 -s ${WIDTH}x${HEIGHT} -i :0.0+$1,$2 -vcodec libx264 -preset veryfast -tune zerolatency -maxrate 10000k -bufsize 20000k -pix_fmt yuv420p -g 60 -f mp4 -vf scale=1280:720 -movflags frag_keyframe+empty_moov -ar 44100 -acodec libvorbis pipe:1" echo "ffmpeg -ac 2 -ar 44100 -frame_size 2048 -fragment_size 2048 -f pulse -ac 2 -i Mkchromecast.monitor -f x11grab -r 30 -s ${WIDTH}x${HEIGHT} -i :0.0+$1,$2 -vcodec libx264 -preset veryfast -tune zerolatency -maxrate 10000k -bufsize 20000k -pix_fmt yuv420p -g 60 -f mp4 -vf scale=1280:720 -movflags frag_keyframe+empty_moov -ar 44100 -acodec libvorbis pipe:1"
} }
@ -16,23 +16,25 @@ set -x
close() { close() {
xrandr --output ${OUTPUT_NAME} --off xrandr --output ${OUTPUT_NAME} --off
xrandr --delmode ${OUTPUT_NAME} "1920x1080" xrandr --delmode ${OUTPUT_NAME} "1920x1080"
pid="$(cat "${PIDFILE}")" read -r pid inh_pid < "${PIDFILE}"
rm "${PIDFILE}" rm "${PIDFILE}"
pkill -35 dwmblocks pkill -35 dwmblocks
pkill -P "${pid}" pkill -P "${pid}"
pkill -P "${inh_pid}"
} }
run() { run() {
xrandr --setprovideroutputsource 1 0 # xrandr --setprovideroutputsource 1 0
xrandr --addmode ${OUTPUT_NAME} 1920x1080 # xrandr --addmode ${OUTPUT_NAME} 1920x1080
xrandr --output ${OUTPUT_NAME} --mode 1920x1080 --rate 60 --right-of eDP-1 # xrandr --output ${OUTPUT_NAME} --mode 1920x1080 --rate 60 --right-of eDP-1
echo $$ > "${PIDFILE}" echo $$ > "${PIDFILE}"
pkill -35 dwmblocks pkill -35 dwmblocks
h_offset=$(( "$(xrandr | grep ${OUTPUT_NAME} | cut -d ' ' -f 3 | cut -d '+' -f 2)" + "${ASPECT_OFFSET}" )) h_offset=$(( "$(xrandr | grep ${OUTPUT_NAME} | cut -d ' ' -f 3 | cut -d '+' -f 2)" + "${ASPECT_OFFSET}" ))
v_offset="$(xrandr | grep ${OUTPUT_NAME} | cut -d ' ' -f 3 | cut -d '+' -f 3)" v_offset="$(xrandr | grep ${OUTPUT_NAME} | cut -d ' ' -f 3 | cut -d '+' -f 3)"
systemd-inhibit --what=handle-lid-switch sleep 2592000 & systemd-inhibit --what=handle-lid-switch sleep 2592000 &
mkchromecast --video --command "$(command ${h_offset} "${v_offset}")" echo "$!" >> "${PIDFILE}"
mkchromecast --video --command "$(get_cmd 0 0)"
} }
if [ "$1" = "-k" ]; then if [ "$1" = "-k" ]; then

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash -e
API_ENDPOINT="http://ip-api.com/json/$1"'?fields=' API_ENDPOINT="http://ip-api.com/json/$1"'?fields='
FIELDS_FULL='7876383' FIELDS_FULL='7876383'
@ -8,20 +8,20 @@ get_stats() {
api_response=$(curl "${API_ENDPOINT}${FIELDS_FULL}" 2>/dev/null) api_response=$(curl "${API_ENDPOINT}${FIELDS_FULL}" 2>/dev/null)
ip=$(jq -r .query <<< "$api_response") ip=$(jq -r .query <<< "$api_response")
jq -r '[ "IP: \(.query)", "Country: \(.country)", "City: \(.city)", "ISP: \(.isp)", "ASN: \(.as)" ][] | "\(.)"' <<< "$api_response" jq -r '[ "IP: \(.query)", "Country: \(.country)", "City: \(.city)", "ISP: \(.isp)", "ASN: \(.as)" ][] | "\(.)"' <<< "$api_response"
dig_ans="$(dig -x $ip)" dig_ans="$(dig -x "$ip")"
ans_count="$(echo "$dig_ans" | grep -o 'ANSWER: [[:digit:]]\+' | cut -d ' ' -f2)" ans_count="$(echo "$dig_ans" | grep -o 'ANSWER: [[:digit:]]\+' | cut -d ' ' -f2)"
[ "$ans_count" -gt 0 ] && { [ "$ans_count" -gt 0 ] && {
printf "PTR: " printf "PTR: "
echo "$(echo "$dig_ans" | grep -A1 ';; ANSWER SECTION' | tail -n1 | awk -F 'PTR' '{ print($2) }' | cut -d $'\t' -f 2)" grep -A1 ';; ANSWER SECTION' <<<"$dig_ans" | tail -n1 | awk -F 'PTR' '{ print($2) }' | cut -d $'\t' -f 2
} }
} }
if [ -t 0 ] && [ -t 1 ]; then if [ -t 0 ] && [ -t 1 ]; then
get_stats get_stats
elif [ -t 1 ]; then elif [ -t 1 ]; then
notify-send -i /dev/null "" "$(get_stats)" notify-send -i /dev/null "IP Info" "$(get_stats)"
else else
curl "${API_ENDPOINT}${FIELDS_SHORT}" 2>/dev/null | jq -r .query curl "${API_ENDPOINT}${FIELDS_SHORT}" 2>/dev/null | jq -r .query | tr -d $'\n'
fi fi
# vim: ft=bash # vim: ft=bash

15
.ssh/config Normal file
View file

@ -0,0 +1,15 @@
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_ed25519
Host *.zvray.ru *.wzray.com *.vpn.wzray.ru
User root
Port 8022
Host 192.168.1.1 10.161.0.1 10.162.0.1 openwrt
User root
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
UpdateHostkeys no
PubkeyAcceptedAlgorithms +ssh-rsa
HostkeyAlgorithms +ssh-rsa