Compare commits
No commits in common. "main" and "master" have entirely different histories.
|
@ -1 +0,0 @@
|
|||
alias xc="xclip -selection clipboard" # копировать stdout
|
|
@ -1 +0,0 @@
|
|||
apt-cache search '' | sort | cut --delimiter ' ' --fields 1 | fzf --multi --cycle --reverse --preview 'apt-cache show {1}' | xargs -r sudo apt install -y
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
trap "echo 'sending fail backup status to vmagent...' && curl -k -d 'etcd_backup,hostname=ml-cbt-01 status=0.0' -X POST https://<vmagent-url>/write" ERR # отсылаем алёрт в VictoriaMetrics, если одна из команд была неуспешной
|
||||
trap "echo 'sending fail backup status to vmagent...' && curl -k -d 'etcd_backup,hostname=ml-cbt-01 status=0.0' -X POST https://vmagent.at-kube.mosmetro.ru/write" ERR # отсылаем алёрт в VictoriaMetrics, если одна из команд была неуспешной
|
||||
cd /share/kubernetes/backups/etcd/ # переходим в папку с бэкапами
|
||||
timestamp=$(date +"%Y-%m-%d-%H-%M-%S")
|
||||
ETCDCTL_API=3 /usr/bin/etcdctl --cacert /etc/kubernetes/pki/etcd/ca.crt --cert /etc/kubernetes/pki/etcd/server.crt --key /etc/kubernetes/pki/etcd/server.key --endpoints=https://127.0.0.1:2379 snapshot save $timestamp.db # бэкапим etcd
|
||||
ETCDCTL_API=3 etcdctl --write-out=table snapshot status $timestamp.db # проверяем, что с бэкапом всё ок
|
||||
rm `ls -t | awk 'NR>7'` # оставляем только 7 последних бэкапов, остальные удаляем
|
||||
echo 'sending success backup status to vmagent...' && curl -k -d 'etcd_backup,hostname=ml-cbt-01 status=1' -X POST https://<vmagent-url>/write # отправляем информацию об успешном бэкапе. В результате получится метрика etcd_backup_status со значением 1
|
||||
echo 'sending success backup status to vmagent...' && curl -k -d 'etcd_backup,hostname=ml-cbt-01 status=1' -X POST https://vmagent.at-kube.mosmetro.ru/write # отправляем информацию об успешном бэкапе
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
import time
|
||||
import curses
|
||||
|
||||
|
||||
|
||||
def draw(canvas):
|
||||
canvas.keypad(True) # нужно для работы с клавишами F1-F4
|
||||
while True:
|
||||
key = canvas.getkey()
|
||||
if key == ("\x1b"):
|
||||
print(f"Вы ввели Escape!")
|
||||
print(f"Вы ввели {key.encode()}")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
curses.update_lines_cols()
|
||||
curses.wrapper(draw)
|
365
checklist.sh
365
checklist.sh
|
@ -1,365 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Set locale to handle UTF-8 characters
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
export LANGUAGE=en_US.UTF-8
|
||||
|
||||
# Check if file argument is provided
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <path_to_file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FILE="$1"
|
||||
|
||||
# Check if file exists
|
||||
if [ ! -f "$FILE" ]; then
|
||||
echo "Error: File '$FILE' not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Terminal control functions
|
||||
hide_cursor() {
|
||||
printf '\033[?25l'
|
||||
}
|
||||
|
||||
show_cursor() {
|
||||
printf '\033[?25h'
|
||||
}
|
||||
|
||||
move_cursor() {
|
||||
printf '\033[%d;%dH' "$1" "$2"
|
||||
}
|
||||
|
||||
clear_screen() {
|
||||
printf '\033[2J'
|
||||
printf '\033[H'
|
||||
}
|
||||
|
||||
get_terminal_size() {
|
||||
local size=$(stty size 2>/dev/null)
|
||||
if [ -n "$size" ]; then
|
||||
TERM_ROWS=${size% *}
|
||||
TERM_COLS=${size#* }
|
||||
else
|
||||
TERM_ROWS=24
|
||||
TERM_COLS=80
|
||||
fi
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
show_cursor
|
||||
clear_screen
|
||||
echo "Goodbye!"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Trap to ensure cursor is restored on exit
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
# Hide cursor at start
|
||||
hide_cursor
|
||||
|
||||
# Get terminal size
|
||||
get_terminal_size
|
||||
|
||||
# Parse the file and store tasks
|
||||
declare -a categories=()
|
||||
declare -A tasks=()
|
||||
declare -A checked=()
|
||||
declare -a display_items=()
|
||||
declare -A item_line_counts=() # Track how many lines each item takes
|
||||
current_category=""
|
||||
task_counter=0
|
||||
current_task=""
|
||||
|
||||
while IFS= read -r line; do
|
||||
# Don't trim leading whitespace yet - we need to detect indentation
|
||||
trimmed_line=$(echo "$line" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||
|
||||
if [[ $line =~ ^@(.+)$ ]]; then
|
||||
# Save any pending task before starting new category
|
||||
if [[ -n "$current_task" && -n "$current_category" ]]; then
|
||||
task_key="task_${task_counter}"
|
||||
tasks["$task_key"]="$current_task"
|
||||
checked["$task_key"]=false
|
||||
display_items+=("TASK:$task_key")
|
||||
# Count lines in the task (plus 1 for empty line after)
|
||||
line_count=$(echo "$current_task" | wc -l)
|
||||
item_line_counts["TASK:$task_key"]=$((line_count + 1))
|
||||
((task_counter++))
|
||||
current_task=""
|
||||
fi
|
||||
|
||||
# This is a new category
|
||||
current_category="${BASH_REMATCH[1]}"
|
||||
categories+=("$current_category")
|
||||
display_items+=("CATEGORY:$current_category")
|
||||
# Categories take 2 lines (category + empty line)
|
||||
item_line_counts["CATEGORY:$current_category"]=2
|
||||
|
||||
elif [[ -n "$trimmed_line" && -n "$current_category" ]]; then
|
||||
# Check if line starts with whitespace (continuation)
|
||||
if [[ $line =~ ^[[:space:]] && -n "$current_task" ]]; then
|
||||
# This is a continuation of the previous task
|
||||
current_task="$current_task"$'\n'"$trimmed_line"
|
||||
else
|
||||
# Save previous task if exists
|
||||
if [[ -n "$current_task" ]]; then
|
||||
task_key="task_${task_counter}"
|
||||
tasks["$task_key"]="$current_task"
|
||||
checked["$task_key"]=false
|
||||
display_items+=("TASK:$task_key")
|
||||
# Count lines in the task (plus 1 for empty line after)
|
||||
line_count=$(echo "$current_task" | wc -l)
|
||||
item_line_counts["TASK:$task_key"]=$((line_count + 1))
|
||||
((task_counter++))
|
||||
fi
|
||||
# Start new task
|
||||
current_task="$trimmed_line"
|
||||
fi
|
||||
fi
|
||||
done < "$FILE"
|
||||
|
||||
# Don't forget the last task
|
||||
if [[ -n "$current_task" && -n "$current_category" ]]; then
|
||||
task_key="task_${task_counter}"
|
||||
tasks["$task_key"]="$current_task"
|
||||
checked["$task_key"]=false
|
||||
display_items+=("TASK:$task_key")
|
||||
# Count lines in the task (plus 1 for empty line after)
|
||||
line_count=$(echo "$current_task" | wc -l)
|
||||
item_line_counts["TASK:$task_key"]=$((line_count + 1))
|
||||
((task_counter++))
|
||||
fi
|
||||
|
||||
# Current selection and scrolling
|
||||
current_selection=0
|
||||
total_items=${#display_items[@]}
|
||||
header_lines=4
|
||||
scroll_offset=0
|
||||
|
||||
# Calculate how many items can fit on screen based on their actual line counts
|
||||
calculate_visible_items() {
|
||||
local available_lines=$((TERM_ROWS - header_lines - 1))
|
||||
local used_lines=0
|
||||
local count=0
|
||||
|
||||
for (( i=scroll_offset; i<total_items; i++ )); do
|
||||
local item="${display_items[$i]}"
|
||||
local lines_needed=${item_line_counts["$item"]}
|
||||
|
||||
if (( used_lines + lines_needed <= available_lines )); then
|
||||
used_lines=$((used_lines + lines_needed))
|
||||
count=$((count + 1))
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
max_visible_items=$count
|
||||
if [ $max_visible_items -lt 1 ]; then
|
||||
max_visible_items=1
|
||||
fi
|
||||
}
|
||||
|
||||
# Calculate scroll position to keep current selection visible
|
||||
update_scroll() {
|
||||
# If current selection is before scroll window, scroll up
|
||||
if [ $current_selection -lt $scroll_offset ]; then
|
||||
scroll_offset=$current_selection
|
||||
calculate_visible_items
|
||||
return
|
||||
fi
|
||||
|
||||
# Calculate visible items from current scroll position
|
||||
calculate_visible_items
|
||||
|
||||
# If current selection is after scroll window, scroll down
|
||||
visible_end=$((scroll_offset + max_visible_items))
|
||||
if [ $current_selection -ge $visible_end ]; then
|
||||
# Find the scroll position where current_selection is the last visible item
|
||||
target_end=$((current_selection + 1))
|
||||
available_lines=$((TERM_ROWS - header_lines - 1))
|
||||
used_lines=0
|
||||
|
||||
# Work backwards from current_selection to find scroll_offset
|
||||
for (( i=current_selection; i>=0; i-- )); do
|
||||
item="${display_items[$i]}"
|
||||
lines_needed=${item_line_counts["$item"]}
|
||||
|
||||
if (( used_lines + lines_needed <= available_lines )); then
|
||||
used_lines=$((used_lines + lines_needed))
|
||||
scroll_offset=$i
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
calculate_visible_items
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to display a task (handles multi-line)
|
||||
display_task() {
|
||||
local task_key="$1"
|
||||
local is_selected="$2"
|
||||
local task_content="${tasks[$task_key]}"
|
||||
|
||||
checkbox="[ ]"
|
||||
if [ "${checked[$task_key]}" = true ]; then
|
||||
checkbox="[✓]"
|
||||
fi
|
||||
|
||||
# Split task into lines
|
||||
local first_line=true
|
||||
while IFS= read -r task_line; do
|
||||
if [ "$first_line" = true ]; then
|
||||
# First line includes checkbox
|
||||
local full_line=" $checkbox $task_line"
|
||||
first_line=false
|
||||
else
|
||||
# Continuation lines are indented
|
||||
local full_line=" $task_line"
|
||||
fi
|
||||
|
||||
if [ "$is_selected" = true ]; then
|
||||
printf '\033[7m%s\033[0m\n' "$full_line"
|
||||
else
|
||||
printf '%s\n' "$full_line"
|
||||
fi
|
||||
done <<< "$task_content"
|
||||
}
|
||||
|
||||
# Full display refresh
|
||||
full_display() {
|
||||
clear_screen
|
||||
echo "Checklist - Use ↑/↓ to navigate, SPACE to toggle, q to quit"
|
||||
echo "File: $FILE"
|
||||
|
||||
# Show scroll indicator
|
||||
if [ $total_items -gt $max_visible_items ]; then
|
||||
end_item=$((scroll_offset + max_visible_items - 1))
|
||||
if [ $end_item -ge $total_items ]; then
|
||||
end_item=$((total_items - 1))
|
||||
fi
|
||||
echo "Items $((scroll_offset + 1))-$((end_item + 1)) of $total_items"
|
||||
else
|
||||
echo "All items shown"
|
||||
fi
|
||||
|
||||
echo "=================================================="
|
||||
|
||||
# Display visible items
|
||||
visible_end=$((scroll_offset + max_visible_items))
|
||||
if [ $visible_end -gt $total_items ]; then
|
||||
visible_end=$total_items
|
||||
fi
|
||||
|
||||
for (( i=scroll_offset; i<visible_end; i++ )); do
|
||||
item="${display_items[$i]}"
|
||||
if [[ $item =~ ^CATEGORY:(.+)$ ]]; then
|
||||
category="${BASH_REMATCH[1]}"
|
||||
if [ $i -eq $current_selection ]; then
|
||||
printf '\033[7m@%s\033[0m\n' "$category"
|
||||
else
|
||||
printf '@%s\n' "$category"
|
||||
fi
|
||||
elif [[ $item =~ ^TASK:(.+)$ ]]; then
|
||||
task_key="${BASH_REMATCH[1]}"
|
||||
display_task "$task_key" $([ $i -eq $current_selection ] && echo "true" || echo "false")
|
||||
fi
|
||||
echo # Empty line after each item
|
||||
done
|
||||
}
|
||||
|
||||
# Get the task key at current selection
|
||||
get_current_task_key() {
|
||||
item="${display_items[$current_selection]}"
|
||||
if [[ $item =~ ^TASK:(.+)$ ]]; then
|
||||
echo "${BASH_REMATCH[1]}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Initial display
|
||||
update_scroll
|
||||
full_display
|
||||
|
||||
# Main loop
|
||||
while true; do
|
||||
# Read single character
|
||||
IFS= read -rsn1 input
|
||||
|
||||
# Handle different input cases
|
||||
if [[ $input == $'\x1b' ]]; then
|
||||
# ESC sequence - read next two characters
|
||||
IFS= read -rsn2 input
|
||||
case $input in
|
||||
'[A') # Up arrow
|
||||
if [ $current_selection -gt 0 ]; then
|
||||
((current_selection--))
|
||||
prev_scroll=$scroll_offset
|
||||
update_scroll
|
||||
|
||||
# Always do full refresh for multi-line content
|
||||
full_display
|
||||
fi
|
||||
;;
|
||||
'[B') # Down arrow
|
||||
if [ $current_selection -lt $((total_items - 1)) ]; then
|
||||
((current_selection++))
|
||||
prev_scroll=$scroll_offset
|
||||
update_scroll
|
||||
|
||||
# Always do full refresh for multi-line content
|
||||
full_display
|
||||
fi
|
||||
;;
|
||||
'[5~') # Page Up
|
||||
if [ $current_selection -gt 0 ]; then
|
||||
current_selection=$((current_selection - max_visible_items))
|
||||
if [ $current_selection -lt 0 ]; then
|
||||
current_selection=0
|
||||
fi
|
||||
update_scroll
|
||||
full_display
|
||||
fi
|
||||
;;
|
||||
'[6~') # Page Down
|
||||
if [ $current_selection -lt $((total_items - 1)) ]; then
|
||||
current_selection=$((current_selection + max_visible_items))
|
||||
if [ $current_selection -ge $total_items ]; then
|
||||
current_selection=$((total_items - 1))
|
||||
fi
|
||||
update_scroll
|
||||
full_display
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
elif [[ $input == ' ' ]]; then
|
||||
# Space bar - toggle checkbox
|
||||
task_key=$(get_current_task_key)
|
||||
if [ -n "$task_key" ]; then
|
||||
if [ "${checked[$task_key]}" = true ]; then
|
||||
checked["$task_key"]=false
|
||||
else
|
||||
checked["$task_key"]=true
|
||||
fi
|
||||
# Full refresh to update checkbox properly
|
||||
full_display
|
||||
fi
|
||||
elif [[ $input == 'q' ]] || [[ $input == 'Q' ]]; then
|
||||
# Quit - cleanup will be called by trap
|
||||
exit 0
|
||||
elif [[ $input == 'r' ]] || [[ $input == 'R' ]]; then
|
||||
# Refresh display
|
||||
get_terminal_size
|
||||
update_scroll
|
||||
full_display
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
git remote rm submodule_origin
|
||||
git rm $1
|
||||
git commit -m "Remove $4 submodule"
|
||||
git remote add submodule_origin ssh://<repo-url>/$4.git
|
||||
git remote add submodule_origin ssh://git@workbench.mosmetro.ru:2286/autonomous-tram/$4.git
|
||||
git fetch submodule_origin
|
||||
git lfs fetch submodule_origin --all
|
||||
git branch merge-branch-$2 submodule_origin/$3
|
||||
|
@ -16,4 +16,4 @@ git ls-tree -z --name-only HEAD | xargs -0 -I {} git mv {} $1
|
|||
git commit -m "Moved files to $1"
|
||||
git checkout feature/merge-submodules
|
||||
git merge --allow-unrelated-histories merge-branch-$2
|
||||
git push --set-upstream origin feature/merge-submodules
|
||||
git push --set-upstream origin feature/merge-submodules
|
|
@ -1,69 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys, os, subprocess
|
||||
|
||||
help_text = f"""
|
||||
Usage: {os.path.basename(__file__)} $1 $2 $3
|
||||
|
||||
required:
|
||||
$1 - name of service
|
||||
$2 - absolute path to script
|
||||
|
||||
optional:
|
||||
$3 - description of service
|
||||
"""
|
||||
number_of_required_arguments = 2
|
||||
number_of_optional_arguments = 1
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
print(help_text)
|
||||
sys.exit()
|
||||
elif sys.argv[1] in ["help", "-h"]:
|
||||
print(help_text)
|
||||
sys.exit()
|
||||
elif len(sys.argv) - 1 < number_of_required_arguments:
|
||||
print(f"You provided not enough arguments")
|
||||
print(help_text)
|
||||
sys.exit(1)
|
||||
elif len(sys.argv) > number_of_required_arguments + number_of_optional_arguments + 1:
|
||||
print(f"You provided extra arguments")
|
||||
print(help_text)
|
||||
sys.exit(1)
|
||||
|
||||
name_of_service = sys.argv[1]
|
||||
path_to_script = sys.argv[2]
|
||||
description = sys.argv[3] if sys.argv[3:4] else "" # empty if no description
|
||||
|
||||
if not os.path.isabs(path_to_script):
|
||||
print("Path to script should be absolute!")
|
||||
print(help_text)
|
||||
sys.exit(1)
|
||||
elif not os.path.isfile(path_to_script):
|
||||
print("Path to script should exist and must be file!")
|
||||
print(help_text)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
service_file = f"""
|
||||
[Unit]
|
||||
Description={description}
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart={path_to_script}
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
"""
|
||||
|
||||
try:
|
||||
with open(f"/lib/systemd/system/{name_of_service}.service", "w") as f:
|
||||
f.write(service_file)
|
||||
subprocess.run(f"chmod +x {path_to_script}", shell=True, check=True)
|
||||
os.system(f"systemctl enable --now {name_of_service} && echo Success!!!")
|
||||
except:
|
||||
print("Something went wrong...")
|
||||
sys.exit(1)
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# $1 - name of service
|
||||
# $2 - description of service
|
||||
# $3 path to script
|
||||
cat << EOF >> /lib/systemd/system/$1.service
|
||||
[Unit]
|
||||
Description=$2
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=$3
|
||||
Type=Oneshot
|
||||
StandardOutput=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl enable --now $1
|
|
@ -1,51 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys, os, subprocess
|
||||
|
||||
help_text = f"""
|
||||
Usage: {os.path.basename(__file__)} $1 $2
|
||||
|
||||
required:
|
||||
$1 - name of service
|
||||
$2 - calendar ()
|
||||
"""
|
||||
|
||||
number_of_required_arguments = 2
|
||||
number_of_optional_arguments = 0
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
print(help_text)
|
||||
sys.exit()
|
||||
elif sys.argv[1] in ["help", "-h"]:
|
||||
print(help_text)
|
||||
elif len(sys.argv) - 1 < number_of_required_arguments:
|
||||
print(f"You provided not enough arguments")
|
||||
print(help_text)
|
||||
sys.exit(1)
|
||||
elif len(sys.argv) > number_of_required_arguments + number_of_optional_arguments + 1:
|
||||
print(f"You provided extra arguments")
|
||||
print(help_text)
|
||||
sys.exit(1)
|
||||
|
||||
name_of_service = sys.argv[1]
|
||||
calendar = sys.argv[2]
|
||||
|
||||
timer_file = f"""
|
||||
[Unit]
|
||||
Description={name_of_service} timer
|
||||
|
||||
[Timer]
|
||||
Unit={name_of_service}.service
|
||||
OnCalendar={calendar}
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
"""
|
||||
|
||||
try:
|
||||
with open(f"/lib/systemd/system/{name_of_service}.timer", "w") as f:
|
||||
f.write(timer_file)
|
||||
os.system(f"systemctl enable --now {name_of_service}.timer && echo Success!!!")
|
||||
except:
|
||||
print("Something went wrong...")
|
||||
sys.exit(1)
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
#!/bin/bash
|
||||
# install packages I need
|
||||
sudo apt update
|
||||
sudo apt install -y \
|
||||
xserver-xorg `# for graphics` \
|
||||
xinit `# for graphics` \
|
||||
i3 `# for graphics` \
|
||||
x11-xserver-utils `# for graphics` \
|
||||
linux-headers-amd64 `# needed for nvidia-driver installation` \
|
||||
brightnessctl `# for keyboard backlight` \
|
||||
xcompmgr `# for st opacity` \
|
||||
x11-apps `# for st opacity` \
|
||||
stterm `# st` \
|
||||
mate-backgrounds `# for background` \
|
||||
xwallpaper `# for background` \
|
||||
pulseaudio `# for sound` \
|
||||
pavucontrol `# for audio control` \
|
||||
pasystray `# for audio control` \
|
||||
iputils-ping `# ping etc.` \
|
||||
neovim `# console editor` \
|
||||
psmisc `# pstree etc.` \
|
||||
software-properties-common `# manage repos (needed for nvidia-driver installation)` \
|
||||
chromium \
|
||||
conky \
|
||||
telegram-desktop \
|
||||
python3 \
|
||||
python3-venv \
|
||||
network-manager \
|
||||
network-manager-gnome \
|
||||
curl
|
||||
|
||||
sudo update-alternatives --set x-terminal-emulator /usr/bin/st
|
||||
|
||||
# start window manager
|
||||
cat > ~/.xinitrc << EOL
|
||||
dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY & # because of slow Telegram start
|
||||
xcompmgr -cC & # for st opacity
|
||||
image=\$(find /usr/share/backgrounds/mate/nature/ -type f | sort --random-sort | head -1)
|
||||
xwallpaper --stretch \$image
|
||||
conky &
|
||||
i3
|
||||
EOL
|
||||
|
||||
# st opacity
|
||||
if ! grep transset ~/.bashrc &> /dev/null; then
|
||||
cat >> ~/.bashrc << EOL
|
||||
term=\$(cat /proc/\$PPID/comm)
|
||||
if [[ \$term == "x-terminal-emul" || \$term == "st" ]]; then
|
||||
transset 0.6 --id \$WINDOWID > /dev/null
|
||||
fi
|
||||
EOL
|
||||
fi
|
||||
|
||||
sudo add-apt-repository contrib non-free-firmware non-free -y
|
||||
sudo apt update
|
||||
sudo apt install nvidia-driver linux-image-amd64 -y
|
||||
|
||||
|
||||
for tool in create_systemd_service.py create_systemd_timer.py set_brightness.sh
|
||||
do
|
||||
if ! command -v $tool &> /dev/null
|
||||
then
|
||||
sudo cp $tool /usr/local/bin
|
||||
fi
|
||||
done
|
||||
|
||||
git config --global user.name "Digital Studium"
|
||||
git config --global user.email "digitalstudium001@gmail.com"
|
||||
|
||||
sudo timedatectl set-timezone Europe/Moscow
|
||||
|
||||
sudo sed -i s/desktop/override/g /etc/conky/conky.conf
|
||||
sudo sed -i s/top_left/top_right/g /etc/conky/conky.conf
|
||||
sudo bash -c "echo 'PATH=\$PATH:\$(find /opt/ -executable -type f | grep -v \.so | xargs dirname | uniq | paste -s -d : | xargs -I _ echo _)' > /etc/profile.d/opt.sh"
|
||||
|
||||
mkdir ~/.config/autostart
|
||||
dex -c /usr/bin/chromium -t ~/.config/autostart
|
||||
dex -c /usr/bin/telegram-desktop -t ~/.config/autostart
|
||||
dex -c /usr/bin/st -t ~/.config/autostart
|
||||
|
||||
if ! grep TelegramDesktop ~/.config/i3/config &> /dev/null; then
|
||||
cat >> ~/.config/i3/config << EOL
|
||||
assign [class="Chromium"] 1
|
||||
assign [class="TelegramDesktop"] 2
|
||||
assign [class="st-256color"] 3
|
||||
EOL
|
||||
fi
|
|
@ -1,74 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# for nodejs/opencommit
|
||||
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
||||
|
||||
# apt packages
|
||||
sudo apt update
|
||||
sudo apt install -y \
|
||||
mpv `# for video playing` \
|
||||
sxiv `# for pictures` \
|
||||
strace `# for tracing` \
|
||||
docker.io `# containers` \
|
||||
docker-compose `# containers` \
|
||||
ffmpeg `# for video` \
|
||||
v4l2loopback-dkms `# for obs-studio` \
|
||||
obs-studio `# for screen recording` \
|
||||
peek `# for screen recording` \
|
||||
nodejs `# for opencommit` \
|
||||
python3-pip `# pip` \
|
||||
bat \
|
||||
locales \
|
||||
scrot `# screenshots`
|
||||
|
||||
|
||||
sudo docker swarm init
|
||||
sudo docker stack deploy -c ollama-stack.yaml ollama
|
||||
|
||||
# this is needed for pavucontrol/docker working not under sudo only
|
||||
for group in audio pulse-access pulse docker
|
||||
do
|
||||
sudo usermod -a -G $group $USER
|
||||
done
|
||||
|
||||
|
||||
# background removal for obs-studio
|
||||
if [ ! -d /usr/share/obs/obs-plugins/obs-backgroundremoval ]
|
||||
then
|
||||
wget https://github.com/occ-ai/obs-backgroundremoval/releases/download/1.1.10/obs-backgroundremoval-1.1.10-x86_64-linux-gnu.deb
|
||||
sudo apt install -y ./obs-backgroundremoval-1.1.10-x86_64-linux-gnu.deb
|
||||
rm -f obs-backgroundremoval-1.1.10-x86_64-linux-gnu.deb
|
||||
fi
|
||||
|
||||
|
||||
# install opencommit
|
||||
if ! command -v opencommit &> /dev/null
|
||||
then
|
||||
sudo npm install -g opencommit
|
||||
oco config set OCO_AI_PROVIDER=ollama
|
||||
fi
|
||||
|
||||
# install pet
|
||||
if ! command -v pet &> /dev/null
|
||||
then
|
||||
wget https://github.com/knqyf263/pet/releases/download/v0.3.6/pet_0.3.6_linux_amd64.deb
|
||||
sudo apt install -y ./pet_0.3.6_linux_amd64.deb
|
||||
rm -f pet_0.3.6_linux_amd64.deb
|
||||
fi
|
||||
|
||||
# install tui scripts
|
||||
if ! command -v a &> /dev/null
|
||||
then
|
||||
curl -O "https://git.digitalstudium.com/digitalstudium/tui-scripts/releases/download/latest/tui-scripts_$(curl -s https://git.digitalstudium.com/digitalstudium/tui-scripts/raw/branch/main/VERSION)-1.deb"
|
||||
sudo apt install -y ./tui-scripts_*.deb
|
||||
rm -f tui-scripts*
|
||||
fi
|
||||
|
||||
# install sshtui
|
||||
if ! command -v sshtui &> /dev/null
|
||||
then
|
||||
curl -O "https://git.digitalstudium.com/digitalstudium/sshtui/raw/branch/main/sshtui"
|
||||
sudo install ./sshtui /usr/local/bin/
|
||||
rm -f ./sshtui
|
||||
fi
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
declare -a fonts=(
|
||||
BitstreamVeraSansMono
|
||||
CodeNewRoman
|
||||
DroidSansMono
|
||||
FiraCode
|
||||
FiraMono
|
||||
Go-Mono
|
||||
Hack
|
||||
Hermit
|
||||
JetBrainsMono
|
||||
Meslo
|
||||
Noto
|
||||
Overpass
|
||||
ProggyClean
|
||||
RobotoMono
|
||||
SourceCodePro
|
||||
SpaceMono
|
||||
Ubuntu
|
||||
UbuntuMono
|
||||
)
|
||||
|
||||
version='3.1.1'
|
||||
fonts_dir="${HOME}/.local/share/fonts"
|
||||
|
||||
if [[ ! -d "$fonts_dir" ]]; then
|
||||
mkdir -p "$fonts_dir"
|
||||
fi
|
||||
|
||||
for font in "${fonts[@]}"; do
|
||||
zip_file="${font}.zip"
|
||||
download_url="https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${zip_file}"
|
||||
echo "Downloading $download_url"
|
||||
wget "$download_url"
|
||||
unzip "$zip_file" -d "$fonts_dir"
|
||||
rm "$zip_file"
|
||||
done
|
||||
|
||||
find "$fonts_dir" -name '*Windows Compatible*' -delete
|
||||
|
||||
fc-cache -fv
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
#!/bin/bash
|
||||
# ubuntu hangs if network interface is not optional
|
||||
if ! sudo grep -r optional /etc/netplan
|
||||
then
|
||||
sudo sed -i '/dhcp4/a\ optional: yes' /etc/netplan/00-installer-config-wifi.yaml
|
||||
sudo sed -i '/dhcp4/a\ optional: yes' /etc/netplan/00-installer-config.yaml
|
||||
fi
|
||||
# Add firefox repo
|
||||
sudo bash -c 'echo "deb [trusted=yes] https://packages.mozilla.org/apt mozilla main" > /etc/apt/sources.list.d/mozilla.list'
|
||||
# By default ubuntu installs firefox from snap, so I want to disable it
|
||||
echo '
|
||||
Package: *
|
||||
Pin: origin packages.mozilla.org
|
||||
Pin-Priority: 1000
|
||||
' | sudo tee /etc/apt/preferences.d/mozilla
|
||||
# install packages I need
|
||||
sudo apt update
|
||||
sudo apt install -y nala
|
||||
sudo nala install -y \
|
||||
xorg `# for graphics` \
|
||||
make `# for compiling gui` \
|
||||
gcc `# for compiling gui` \
|
||||
libx11-dev `# for compiling dwm` \
|
||||
libxft-dev `# for compiling dwm` \
|
||||
libxinerama-dev `# for compiling dwm` \
|
||||
libharfbuzz-dev `# for compiling st` \
|
||||
suckless-tools `# for dmenu` \
|
||||
ncdu `# for disk usage analysys` \
|
||||
brightnessctl `# for keyboard backlight` \
|
||||
xcompmgr `# for st opacity` \
|
||||
xwallpaper `# for background` \
|
||||
ubuntu-wallpapers-jammy `# backgrounds` \
|
||||
pulseaudio `# for sound` \
|
||||
alsa-base `# for sound` \
|
||||
pavucontrol `# for audio control` \
|
||||
pasystray `# for audio control` \
|
||||
iputils-ping `# ping etc.` \
|
||||
xfe `# classic file manager` \
|
||||
surf `# suckless lightweight browser` \
|
||||
micro `# console editor` \
|
||||
neovim `# console editor` \
|
||||
psmisc `# pstree etc.` \
|
||||
slack \
|
||||
firefox \
|
||||
python3 \
|
||||
python3-venv \
|
||||
libnvidia-compute-545 `# for mpv + nvidia` \
|
||||
nvidia-driver-545 `# nvidia driver` \
|
||||
nvidia-cuda-toolkit `# cuda driver`
|
||||
|
||||
# install telegram
|
||||
if [ ! -d /opt/Telegram ]
|
||||
then
|
||||
if [ ! -f telegram.tar.xz ]
|
||||
then
|
||||
curl -L https://telegram.org/dl/desktop/linux -o telegram.tar.xz
|
||||
fi
|
||||
tar -xf telegram.tar.xz
|
||||
rm -f telegram.tar.xz
|
||||
sudo mv Telegram /opt/
|
||||
fi
|
||||
|
||||
# remove snap cause I hate it
|
||||
sudo systemctl disable --now snapd
|
||||
sudo apt purge snapd -y
|
||||
# remove autoinstalled stterm
|
||||
sudo apt remove stterm -y
|
||||
|
||||
|
||||
if [ ! -d ~/gui ]
|
||||
then
|
||||
git clone https://git.digitalstudium.com/digitalstudium/ubuntu-gui ~/gui
|
||||
fi
|
||||
|
||||
for tool in dwm st sent
|
||||
do
|
||||
# compiling dwm
|
||||
if ! command -v $tool &> /dev/null
|
||||
then
|
||||
cd ~/gui/$tool
|
||||
sudo make install clean
|
||||
cd -
|
||||
fi
|
||||
done
|
||||
|
||||
echo dwm > ~/.xinitrc # for starting dwm when startx
|
||||
|
||||
for tool in create_systemd_service.py create_systemd_timer.py set_brightness.sh update_gui.sh
|
||||
do
|
||||
if ! command -v $tool &> /dev/null
|
||||
then
|
||||
sudo cp $tool /usr/local/bin
|
||||
fi
|
||||
done
|
||||
|
||||
git config --global user.name "Digital Studium"
|
||||
git config --global user.email "digitalstudium001@gmail.com"
|
||||
|
||||
sudo create_systemd_service.py gui-updater /usr/local/bin/update_gui.sh
|
||||
sudo create_systemd_timer.py gui-updater '*-*-* *:*:*'
|
||||
|
||||
if [ ! -d ~/.dwm ]
|
||||
then
|
||||
mkdir $HOME/.dwm
|
||||
fi
|
||||
echo "xhost +local:" > $HOME/.dwm/autostart.sh # give permissions to display
|
||||
echo "xcompmgr &" >> $HOME/.dwm/autostart.sh # for st opacity
|
||||
echo "xwallpaper --stretch /usr/share/backgrounds/Blue_flower_by_Elena_Stravoravdi.jpg" >> $HOME/.dwm/autostart.sh # background
|
||||
echo "firefox &" >> $HOME/.dwm/autostart.sh
|
||||
echo "Telegram &" >> $HOME/.dwm/autostart.sh
|
||||
echo "st &" >> $HOME/.dwm/autostart.sh
|
||||
echo "pasystray &" >> $HOME/.dwm/autostart.sh
|
||||
chmod +x $HOME/.dwm/autostart.sh
|
||||
|
||||
sudo timedatectl set-timezone Europe/Moscow
|
||||
|
||||
sudo bash -c "echo 'PATH=\$(find /opt/ -executable -type f | grep -v \.so | xargs dirname | uniq | paste -s -d : | xargs -I _ echo \$PATH:_)' > /etc/profile.d/opt.sh"
|
||||
|
|
@ -1,132 +0,0 @@
|
|||
#!/bin/bash
|
||||
# for nvidia-container-toolkit
|
||||
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
|
||||
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
|
||||
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
|
||||
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
|
||||
# for nodejs/opencommit
|
||||
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
||||
# obs-studio repo
|
||||
sudo add-apt-repository ppa:obsproject/obs-studio -y
|
||||
# for tensorrt (remove backgrount in obs)
|
||||
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
|
||||
sudo dpkg -i cuda-keyring_1.1-1_all.deb
|
||||
rm -f cuda-keyring_1.1-1_all.deb
|
||||
|
||||
# apt packages
|
||||
sudo nala update
|
||||
sudo nala install -y \
|
||||
mpv `# for video playing` \
|
||||
sxiv `# for pictures` \
|
||||
strace `# for tracing` \
|
||||
docker.io `# containers` \
|
||||
docker-compose `# containers` \
|
||||
nvidia-container-toolkit `# containers` \
|
||||
nodejs `# for opencommit` \
|
||||
ffmpeg `# for video` \
|
||||
v4l2loopback-dkms `# for obs-studio` \
|
||||
obs-studio `# for screen recording` \
|
||||
python3-pip `# pip` \
|
||||
tensorrt-libs \
|
||||
bat \
|
||||
locales \
|
||||
fzf \
|
||||
scrot `# screenshots` \
|
||||
libreadline-dev `# for nnn` \
|
||||
nnn `# nnn is file manager` \
|
||||
pandoc `# pandoc onvers markdown to html` \
|
||||
cutycapt `# for converting html to image` \
|
||||
vifm `# vifm is file manager` \
|
||||
farbfeld `# for sent`
|
||||
|
||||
sudo locale-gen ru_RU
|
||||
sudo locale-gen ru_RU.UTF-8
|
||||
sudo update-locale
|
||||
|
||||
# lf settings
|
||||
sudo cp lf_preview.sh /usr/local/bin
|
||||
cat << 'EOF' > lfrc
|
||||
set sixel true
|
||||
set previewer lf_preview.sh
|
||||
cmd trash %set -f; mv $fx ~/.trash
|
||||
map <delete> trash
|
||||
map i $batcat --force-colorization $f
|
||||
map x $$f
|
||||
map o $mimeopen --ask $f
|
||||
EOF
|
||||
|
||||
sudo mkdir /etc/lf
|
||||
sudo cp lfrc /etc/lf
|
||||
rm -f lfrc
|
||||
|
||||
if [ ! -f /etc/docker/daemon.json ]
|
||||
then
|
||||
sudo nvidia-ctk runtime configure --runtime=docker --set-as-default
|
||||
sudo service docker restart
|
||||
fi
|
||||
|
||||
sudo docker swarm init
|
||||
sudo docker stack deploy -c ollama-stack.yaml ollama
|
||||
|
||||
# this is needed for pavucontrol/docker working not under sudo only
|
||||
for group in audio pulse-access pulse docker
|
||||
do
|
||||
sudo usermod -a -G $group $USER
|
||||
done
|
||||
|
||||
# background removal for obs-studio
|
||||
if [ ! -d /usr/share/obs/obs-plugins/obs-backgroundremoval ]
|
||||
then
|
||||
wget https://github.com/occ-ai/obs-backgroundremoval/releases/download/1.1.10/obs-backgroundremoval-1.1.10-x86_64-linux-gnu.deb
|
||||
sudo apt install -y ./obs-backgroundremoval-1.1.10-x86_64-linux-gnu.deb
|
||||
rm -f obs-backgroundremoval-1.1.10-x86_64-linux-gnu.deb
|
||||
fi
|
||||
|
||||
# install lf
|
||||
if ! command -v lf &> /dev/null
|
||||
then
|
||||
wget https://github.com/gokcehan/lf/releases/download/r31/lf-linux-amd64.tar.gz
|
||||
tar -xvzf lf-linux-amd64.tar.gz
|
||||
sudo mv ./lf /usr/local/bin/
|
||||
rm -f lf-linux-amd64.tar.gz
|
||||
fi
|
||||
|
||||
# install lazygit
|
||||
if ! command -v lazygit &> /dev/null
|
||||
then
|
||||
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
|
||||
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
|
||||
tar xf lazygit.tar.gz lazygit
|
||||
sudo install lazygit /usr/local/bin
|
||||
rm -rf ./lazygit*
|
||||
fi
|
||||
|
||||
# install opencommit
|
||||
if ! command -v opencommit &> /dev/null
|
||||
then
|
||||
git clone --depth 1 https://git.digitalstudium.com/digitalstudium/opencommit.git
|
||||
cd opencommit
|
||||
npm run build
|
||||
npm pack
|
||||
sudo npm install -g opencommit-3.0.11.tgz
|
||||
cd -
|
||||
rm -rf opencommit
|
||||
oco config set OCO_AI_PROVIDER=ollama
|
||||
fi
|
||||
|
||||
# install pet
|
||||
if ! command -v pet &> /dev/null
|
||||
then
|
||||
wget https://github.com/knqyf263/pet/releases/download/v0.3.6/pet_0.3.6_linux_amd64.deb
|
||||
sudo apt install -y ./pet_0.3.6_linux_amd64.deb
|
||||
rm -f pet_0.3.6_linux_amd64.deb
|
||||
fi
|
||||
|
||||
# install kubectl
|
||||
if ! command -v kubectl &> /dev/null
|
||||
then
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
||||
rm -f kubectl
|
||||
fi
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
MIME=$(mimetype --all --brief "$1")
|
||||
#echo "$MIME"
|
||||
|
||||
case "$MIME" in
|
||||
# .pdf
|
||||
*application/pdf*)
|
||||
pdftotext "$1" -
|
||||
;;
|
||||
# .jpeg, png etc.
|
||||
*image/*)
|
||||
chafa -f sixel -s "$2x$3" "$1" --polite on
|
||||
;;
|
||||
# .7z
|
||||
*application/x-7z-compressed*)
|
||||
7z l "$1"
|
||||
;;
|
||||
# .tar .tar.Z
|
||||
*application/x-tar*)
|
||||
tar -tvf "$1"
|
||||
;;
|
||||
# .tar.*
|
||||
*application/x-compressed-tar*|*application/x-*-compressed-tar*)
|
||||
tar -tvf "$1"
|
||||
;;
|
||||
# .rar
|
||||
*application/vnd.rar*)
|
||||
unrar l "$1"
|
||||
;;
|
||||
# .zip
|
||||
*application/zip*)
|
||||
unzip -l "$1"
|
||||
;;
|
||||
*text/markdown*)
|
||||
pandoc $1 > /tmp/lf_preview.html && cutycapt --url=file:///tmp/lf_preview.html --out=/tmp/lf_preview.png && chafa -s "$2x$3" -f sixel /tmp/lf_preview.png --polite on
|
||||
;;
|
||||
# any plain text file that doesn't have a specific handler
|
||||
*text/plain*)
|
||||
# return false to always repaint, in case terminal size changes
|
||||
batcat --force-colorization --paging=never --style=changes,numbers \
|
||||
--terminal-width $(($2 - 3)) "$1" && false
|
||||
;;
|
||||
*)
|
||||
echo "unknown format"
|
||||
;;
|
||||
esac
|
|
@ -1,33 +0,0 @@
|
|||
version: '3.9'
|
||||
|
||||
services:
|
||||
ollama:
|
||||
image: ollama/ollama:latest
|
||||
restart: always
|
||||
deploy:
|
||||
replicas: 1
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
capabilities: ["compute", "gpu", "utility", "graphics"]
|
||||
count: all # Adjust count for the number of GPUs you want to use
|
||||
ports:
|
||||
- 11434:11434
|
||||
volumes:
|
||||
- ollama:/root/.ollama
|
||||
|
||||
open-webui:
|
||||
image: ghcr.io/open-webui/open-webui:main
|
||||
restart: always
|
||||
ports:
|
||||
- 3000:8080
|
||||
volumes:
|
||||
- open-webui:/app/backend/data
|
||||
environment:
|
||||
- 'OLLAMA_BASE_URL=http://ollama:11434'
|
||||
|
||||
volumes:
|
||||
ollama: {}
|
||||
open-webui: {}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# 1. extract audio from all videos (assuming .mp4 videos).
|
||||
for FILE in *.mp4; do ffmpeg -i $FILE ${FILE%%.mp4}.wav; done
|
||||
|
||||
# 2. use the first second of the first audio file as the noise sample.
|
||||
sox `ls *.wav | head -1` -n trim 0 1 noiseprof noise.prof
|
||||
|
||||
# Replace with a specific noise sample file if the first second doesn't work for you:
|
||||
# sox noise.wav -n noiseprof noise.prof
|
||||
|
||||
# 3. clean the audio with noise reduction and normalise filters.
|
||||
for FILE in *.wav; do sox -S --multi-threaded --buffer 131072 $FILE ${FILE%%.wav}.norm.wav noisered noise.prof 0.21 norm; done
|
||||
|
||||
# 4. re-insert audio into the videos.
|
||||
# If you need to include an audio offset (+/- n seconds), add parameter "-itsoffset n" after the second -i parameter.
|
||||
for FILE in *.norm.wav; do ffmpeg -i ${FILE%%.norm.wav}.mp4 -i $FILE -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 ${FILE%%.norm.wav}.sync.mp4; done
|
||||
|
||||
# 5. Remove artefacts
|
||||
rm -f *.wav noise.prof
|
||||
|
||||
# 6. That's it. You're done!
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
H=$(date +%k)
|
||||
|
||||
if (( $H >= 0 && $H <= 7 )); then
|
||||
/usr/bin/xrandr --output eDP --brightness .2
|
||||
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 1
|
||||
elif (( $H > 7 && $H <= 10 )); then
|
||||
/usr/bin/xrandr --output eDP --brightness .5
|
||||
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 1
|
||||
elif (( $H > 10 && $H < 16 )); then
|
||||
/usr/bin/xrandr --output eDP --brightness .7
|
||||
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 0
|
||||
elif (( $H >= 16 && $H <= 19 )); then
|
||||
/usr/bin/xrandr --output eDP --brightness .4
|
||||
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 1
|
||||
elif (( $H > 19 && $H <= 23 )); then
|
||||
/usr/bin/xrandr --output eDP --brightness .3
|
||||
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 1
|
||||
else
|
||||
echo "Error"
|
||||
fi
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
version: '3.9'
|
||||
|
||||
services:
|
||||
sd:
|
||||
image: goolashe/automatic1111-sd-webui
|
||||
ports:
|
||||
- "${WEBUI_PORT:-7860}:7860"
|
||||
stop_signal: SIGKILL
|
||||
tty: true
|
||||
environment:
|
||||
- CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api
|
||||
volumes:
|
||||
- sd-data:/data
|
||||
- sd-output:/output
|
||||
volumes:
|
||||
sd-data: {}
|
||||
sd-output: {}
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/bash
|
||||
export DISPLAY=:0
|
||||
set_brightness.sh # set monitor brightness
|
||||
battery_capacity=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
MEM=$(free -h --kilo | awk '/^Mem:/ {print $3 "/" $2}')
|
||||
CPU=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}' )
|
||||
DISK=$(df -Ph | grep "/dev/mapper/ubuntu--vg-ubuntu--lv" | awk {'print $5'})
|
||||
|
||||
/usr/bin/xsetroot -name "$battery_capacity% `date +"%a %d.%m %H:%M"`;MEM: $MEM CPU: $CPU% DISK: $DISK" # set systray
|
Loading…
Reference in New Issue