Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Maxattax97/miscellaneous
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxattax97 committed Sep 29, 2024
2 parents d36831f + b0883bf commit ee09b91
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 8 deletions.
37 changes: 35 additions & 2 deletions .tmuxp/leviathan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,45 @@ windows:
- window_name: SYS
environment:
DISABLE_AUTO_TITLE: "true"
# focus: true
options:
allow-rename: false
automatic-rename: false
panes:
- shell_command: sudo top
- shell_command: sudo btop
focus: true
environment:
DISABLE_AUTO_TITLE: "true"
options:
allow-rename: false
automatic-rename: false
- window_name: XMR / LLM
layout: main-vertical
environment:
DISABLE_AUTO_TITLE: "true"
options:
allow-rename: false
automatic-rename: false
panes:
- shell_command: ~/mine
focus: true
environment:
DISABLE_AUTO_TITLE: "true"
options:
allow-rename: false
automatic-rename: false
- shell_command: tail -f /var/log/ollama/ollama.log
environment:
DISABLE_AUTO_TITLE: "true"
options:
allow-rename: false
automatic-rename: false
- shell_command: tail -f /var/log/flamenco/flamenco.log
environment:
DISABLE_AUTO_TITLE: "true"
options:
allow-rename: false
automatic-rename: false
- shell_command: kernlog
environment:
DISABLE_AUTO_TITLE: "true"
options:
Expand Down
79 changes: 77 additions & 2 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -1375,12 +1375,84 @@ zshrc_load_library() {
image-optimize $@
}
scale() {
image-scale() {
scale=$1
shift
mogrify -scale $scale $@
}
audio-normalize() {
for file in "$@"; do
ffmpeg -i "$file" -filter:a loudnorm=I=-23:TP=-1.5:LRA=11 "normalized_${file}"
mv "normalized_${file}" "$file"
done
}
# Adds reverb, slows down, and boosts the bass.
audio-boost() {
for file in "$@"; do
base="${file%.*}"
# SoX has limited output support, so we have to convert between FLAC and MP4.
ffmpeg -i "$file" "${base}.flac"
rm "$file"
sox "${base}.flac" "boosted_${base}.flac" speed 0.85 reverb 50 equalizer 60 1q +6
rm "${base}.flac"
audio-optimize "boosted_${base}.flac"
mv "boosted_${base}.mp4" "${base}.mp4"
done
}
audio-optimize() {
for file in "$@"; do
noextension="${file%.*}"
ffmpeg -i "$file" -c:a aac -b:a 192k -filter:a "volume=replaygain=track" "${noextension}.mp4"
rm "$file"
done
}
audio-clip() {
file="$1"
start_secs="$2"
end_secs="$3"
ffmpeg -ss "$start_secs" -to "$end_secs" -i "$file" "clip_${start_secs}_${end_secs}_${file}"
}
audio-enhance() {
audio-normalize $@
audio-optimize $@
}
audio-remote-play() {
ssh "$1" "cat $2" | mpv -
}
video-enhance() {
# TODO: auto-pick threads
# TODO: crf to 20?
#
for file in "$@"; do
ffmpeg -i "$file" \
-vf "
yadif,
format=yuv420p,
" \
-c:v libvpx-vp9 -crf 32 -b:v 0 -threads 0 -speed 1 -tile-columns 4 -frame-parallel 1 \
-an \
-c:a libopus -b:a 128k -ar 48000 -ac 2 -af loudnorm \
-y "enhanced_${file%.*}.webm"
done
}
iperf-host() {
iperf3 -s
}
iperf-client() {
iperf3 -c "$1" -P 8 -t 10
}
poor_mans_scp_upload() {
local source_file="$1"
local target_user_at_host="$2"
Expand Down Expand Up @@ -1578,6 +1650,8 @@ zshrc_load_library() {
# Reset to default
echo -e "\033[0mDefault Text"
echo "Example: \\\\033[1;34mBold Blue Text\\\\033[0m (Reset)"
echo "To type an ANSI color code in Vim, use \`Ctrl+v Esc\`, then enter the digits"
# :help i_CTRL-V_digit
}
random_string() {
Expand Down Expand Up @@ -1614,7 +1688,7 @@ zshrc_load_library() {
screen-rescale() {
local factor="$(zcalc -f -e "1 / ${1:-1}")"
local monitor="$(xrandr --listmonitors | awk '{ print $4}' | tr -d '\n' | head -n 1)"
local monitor="$(xrandr --listmonitors | awk '{ print $4}' | tail -n 1)"
xrandr --output "${monitor}" --scale "${factor}x${factor}"
}
Expand Down Expand Up @@ -1753,6 +1827,7 @@ zshrc_set_aliases() {
alias Eupgrade='sudo emerge --ask --tree --update --verbose --deep --newuse @world'
alias Einstall='sudo emerge --ask --verbose --tree --noreplace'
alias Eclean='sudo emerge --ask --depclean'
alias Esearch='emerge --search'
}
zshrc_set_default_programs() {
Expand Down
4 changes: 4 additions & 0 deletions config/ssh/config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Host entourage maxocull.com
ForwardX11 yes
ForwardX11Trusted yes

Host git.alanocull.com pi.alanocull.com git.maxocull.com
HostName git.alanocull.com
Port 2212

Host leviathan
HostName 192.168.1.11
#ProxyJump maxocull.com
Expand Down
11 changes: 7 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,7 @@ case "$response" in
p7zip \
qalculate-gtk \
qemu \
rar \
yt-dlp
rar

brew install --cask \
brave-browser \
Expand Down Expand Up @@ -919,7 +918,6 @@ case "$response" in
if [[ -x "$(command -v yay)" ]]; then
yay -Syu "$AUTOMATED_PACMAN_FLAGS" \
brave-bin \
yt-dlp \
--needed
fi
elif [[ -x "$(command -v pkg)" ]]; then
Expand All @@ -936,7 +934,6 @@ case "$response" in
touchegg \
unrar \
veracrypt \
yt-dlp \
zathura \
zathura-pdf-mupdf
fi
Expand Down Expand Up @@ -971,6 +968,12 @@ case "$response" in
esac
fi

# Install yt-dlp, to nightly edition
if [[ ! -x "$(command -v yt-dlp)" ]]; then
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/.local/bin/yt-dlp
chmod a+rx ~/.local/bin/yt-dlp
yt-dlp --update-to nightly
fi
;;
*)
echo "Skipping workstation utility installation"
Expand Down

0 comments on commit ee09b91

Please sign in to comment.