airikr / Update Docker images/containers
0 likes
0 forks
1 files
Last active
TODO: check if the image is up-to-date or not.
1 | #!/bin/bash |
2 | declare -a arr=("snikket" "plausible") |
3 | |
4 | for i in "${arr[@]}" |
5 | do |
6 | if [ "$i" = "snikket" ] |
7 | then |
8 | echo |
9 | echo "snikket" |
10 | echo |
airikr / download-youtube-videos.sh
0 likes
0 forks
1 files
Last active
1 | #!/bin/bash |
2 | path="/path/to/youtube" |
3 | |
4 | sudo chown -R user:user "${path}" |
5 | |
6 | yt-dlp --config-location "ytdlp-config.txt" -a "${path}/channels-1.txt" |
7 | |
8 | echo |
9 | echo "Deleting JSON files" |
10 | echo |
airikr / Share to Mastodon
0 likes
0 forks
1 files
Last active
1 | <style> |
2 | .share { |
3 | position: relative; |
4 | } |
5 | |
6 | .share > a { |
7 | align-items: center; |
8 | color: #000000; |
9 | display: inline-flex; |
10 | flex-flow: row nowrap; |
airikr / Backup and restore PostgreSQL via Docker
0 likes
0 forks
1 files
Last active
1 | # BACKUP |
2 | docker exec -i <container-name> /bin/bash -c "PGPASSWORD=<passwd> pg_dump --username <user> <db-name>" > ~/db.sql |
3 | |
4 | # RESTORE |
5 | cat db.sql | docker exec -i <container-name> psql -U <user> <db-name> |
airikr / Backup the whole system
0 likes
0 forks
1 files
Last active
Send the entire system to one of my SSD's that I use only for this goal.
1 | #!/bin/bash |
2 | dir_backup="backup-ssd-dir" |
3 | sudo rsync -aAXv --progress --delete / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} "$dir_backup" |
airikr / Install softwares and restore backup files
0 likes
0 forks
1 files
Last active
1 | #!/bin/bash |
2 | |
3 | # VARIABLES |
4 | dir_home='/home/{username}' |
5 | dir_backup='/to/dir' |
6 | GREEN='\033[0;32m' |
7 | YELLOW='\033[1;33m' |
8 | BLUE='\033[0;34m' |
9 | NC='\033[0m' |
10 | SLEEP='.5' |
airikr / Useful bash scripts
0 likes
0 forks
1 files
Last active
These are my number one bash scripts. I can't live without them.
1 | alias install_no="sudo pacman -Sy" |
2 | alias install_ya="yay -S --noconfirm" |
3 | alias backupvps="rsync -avhzr --delete --progress --rsh='ssh -p22' user@ip:/ --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/swapfile","/boot/*"} /to/dir/" |
4 | |
5 | |
6 | # Compress a video with CUDA acceleration (GPU from NVIDIA is required) |
7 | function reducevideo { |
8 | ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2" |
9 | } |
Newer
Older