mirror of
https://github.com/brunofontes/linuxShortcuts.git
synced 2024-11-23 21:20:50 +00:00
Tests, tests and tests
Still not sure why I keep track of those changes, if I don't need them and do not care about proper handling them. Anyway, it is here if, some some reason I need it back.
This commit is contained in:
parent
b497912cdf
commit
42344f98a5
@ -1 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
/bin/terminator -m -T BACKUP -x sudo systemd-inhibit bash /home/bruno/Apps/linuxShortcuts/Backup/.Backup_HD.sh &
|
/bin/terminator -m -T BACKUP -x sudo systemd-inhibit bash /home/bruno/Apps/linuxShortcuts/Backup/.Backup_HD.sh &
|
||||||
|
14
Dolphin/extract.desktop
Normal file
14
Dolphin/extract.desktop
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Copyright 2019 Bruno Fontes <outros+dev@m.brunofontes.net>
|
||||||
|
|
||||||
|
[Desktop Entry]
|
||||||
|
Type=Service
|
||||||
|
ServiceTypes=KonqPopupMenu/Plugin
|
||||||
|
MimeType=application/octet-stream;inode/directory
|
||||||
|
Actions=extract
|
||||||
|
X-KDE-Priority=TopLevel
|
||||||
|
X-KDE-Submenu=BFExtract
|
||||||
|
|
||||||
|
[Desktop Action extract]
|
||||||
|
Name=Extract
|
||||||
|
Name[pt_BR]=Extrair
|
||||||
|
Exec=bash ~/.local/share/kservices5/ServiceMenus/extract.sh %F
|
23
Dolphin/extract.sh
Executable file
23
Dolphin/extract.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
file="$1"
|
||||||
|
foldername="$(echo "$file" | sed 's/\(.*\)\..*/\1/')/"
|
||||||
|
|
||||||
|
if [ -f "$file" ] ; then
|
||||||
|
case "$file" in
|
||||||
|
*.tar.bz2) tar xvjf "$file" -C "$foldername" ;;
|
||||||
|
*.tar.gz) tar xvzf "$file" -C "$foldername" ;;
|
||||||
|
*.bz2) bunzip2 "$file" "$foldername" ;;
|
||||||
|
*.rar) unrar x "$file" "$foldername" ;;
|
||||||
|
*.gz) gunzip "$file" "$foldername" ;;
|
||||||
|
*.tar) tar xvf "$file" -C "$foldername" ;;
|
||||||
|
*.tbz2) tar xvjf "$file" -C "$foldername" ;;
|
||||||
|
*.tgz) tar xvzf "$file" -C "$foldername" ;;
|
||||||
|
*.zip) unzip "$file" -d "$foldername" ;;
|
||||||
|
*.Z) uncompress "$file" "$foldername" ;;
|
||||||
|
*.7z) 7z x "$file" -o "$foldername" ;;
|
||||||
|
*) echo "'$file' cannot be extracted via >extract<" ;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo "'$file' is not a valid file"
|
||||||
|
fi
|
||||||
|
|
0
Dolphin/{}-file
Normal file
0
Dolphin/{}-file
Normal file
@ -10,8 +10,9 @@ function s() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s -v
|
s -v
|
||||||
bold "Pacman-mirrors -c"
|
bold "Pacman-mirrors --continent"
|
||||||
s "pacman-mirrors -c Brazil" 2>/dev/null
|
s "pacman-mirrors --continent" 2>/dev/null
|
||||||
|
# s "pacman-mirrors -c Brazil" 2>/dev/null
|
||||||
s "reflector -l 30 -f 10 --save /etc/pacman.d/mirrorlist" 2>/dev/null
|
s "reflector -l 30 -f 10 --save /etc/pacman.d/mirrorlist" 2>/dev/null
|
||||||
|
|
||||||
# From now on, exit when any command fails
|
# From now on, exit when any command fails
|
||||||
|
3
Screen/desktop.sh
Executable file
3
Screen/desktop.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
xrandr --output HDMI-1 --mode 1920x1080
|
||||||
|
xrandr --output HDMI-2 --mode 1920x1080
|
5
Screen/new_laptop.sh
Executable file
5
Screen/new_laptop.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
setxkbmap -model abnt2 -layout br -variant ,abnt2
|
||||||
|
xrandr --output HDMI-1 --mode 1280x720 #Max resolution monitor can do that fits blackout
|
||||||
|
xrandr --output HDMI-1 --mode 1366x768 #Max resolution monitor can do that fits blackout
|
||||||
|
xrandr --output HDMI-2 --mode 1366x768
|
4
Screen/old_laptop.sh
Executable file
4
Screen/old_laptop.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
setxkbmap -model abnt2 -layout br -variant ,abnt2
|
||||||
|
xrandr --output HDMI-1 --mode 1280x800
|
||||||
|
xrandr --output HDMI-2 --mode 1280x800
|
@ -10,7 +10,12 @@ if [[ -z $CONTABO_BACKUP_PATH ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 60
|
sleep 60
|
||||||
/bin/rsync --archive --exclude "files/nextcloud*" -e "ssh" backupContabo:/home/bruno/backups/* $CONTABO_BACKUP_PATH
|
|
||||||
|
# Backup Contabo
|
||||||
|
/bin/rsync --archive --exclude "files/nextcloud*" --rsh=ssh backupContabo:/home/bruno/backups/* $CONTABO_BACKUP_PATH
|
||||||
|
|
||||||
|
# Backup OXO
|
||||||
|
/bin/rsync --archive --rsh=ssh oxo:~/OXOwebsiteBackup.tar.gz ~/Backups/OXOwebsite/`date '+%Y-%m-%d'`_OXOwebsiteBackup.tar.gz
|
||||||
|
|
||||||
# Delete old backups
|
# Delete old backups
|
||||||
find $CONTABO_BACKUP_PATH/db -type f -name "*.sql.gz" -mtime +15 -delete
|
find $CONTABO_BACKUP_PATH/db -type f -name "*.sql.gz" -mtime +15 -delete
|
||||||
@ -19,3 +24,5 @@ find $CONTABO_BACKUP_PATH/files -type f -name "*.*" -mtime +35 -delete
|
|||||||
find $CONTABO_BACKUP_PATH/mail -type f -name "*.*" -mtime +20 -delete
|
find $CONTABO_BACKUP_PATH/mail -type f -name "*.*" -mtime +20 -delete
|
||||||
|
|
||||||
find $CONTABO_BACKUP_PATH/ -type f -name "*.*" -mtime +120 -delete
|
find $CONTABO_BACKUP_PATH/ -type f -name "*.*" -mtime +120 -delete
|
||||||
|
|
||||||
|
find ~/Backups/OXOwebsite/ -type f -name "*.sql.gz" -mtime +15 -delete
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
BACKUP_DIR="/home/bruno/Backups/Joplin"
|
BACKUP_DIR="/home/bruno/Backups/Joplin"
|
||||||
JOPLIN_BIN="/bin/joplin"
|
JOPLIN_BIN="/usr/bin/joplin"
|
||||||
|
|
||||||
$JOPLIN_BIN sync
|
$JOPLIN_BIN sync
|
||||||
$JOPLIN_BIN e2ee decrypt
|
$JOPLIN_BIN e2ee decrypt
|
||||||
|
@ -15,6 +15,7 @@ SERVERDIR="/home/bruno/Apps/Minecraft"
|
|||||||
PUBLICDIR="$SERVERDIR/BedrockServer_Public_19132"
|
PUBLICDIR="$SERVERDIR/BedrockServer_Public_19132"
|
||||||
SURVIVALDIR="$SERVERDIR/BedrockServer_Survival_19132"
|
SURVIVALDIR="$SERVERDIR/BedrockServer_Survival_19132"
|
||||||
CREATIVEDIR="$SERVERDIR/BedrockServer_Creative_19134"
|
CREATIVEDIR="$SERVERDIR/BedrockServer_Creative_19134"
|
||||||
|
PATHTOBACKUP=""
|
||||||
LogFile="log.txt"
|
LogFile="log.txt"
|
||||||
|
|
||||||
BACKUPDATE=$(date +"%Y-%m-%d_%H-%M-%S")
|
BACKUPDATE=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||||
@ -40,16 +41,18 @@ if [[ $publicBackup ]]; then
|
|||||||
timeout=30
|
timeout=30
|
||||||
while [[ $finishedPublic != *"Data saved."* ]]; do
|
while [[ $finishedPublic != *"Data saved."* ]]; do
|
||||||
if [[ $timeout -lt 1 ]]; then
|
if [[ $timeout -lt 1 ]]; then
|
||||||
notify-send "Error backuping Creative world"
|
notify-send "Error backuping Public world"
|
||||||
|
echo "Error Public $timeout"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
(( timeout-- ))
|
(( timeout-- ))
|
||||||
sleep 1s
|
sleep 1s
|
||||||
runPublic "say ^usave query\n"
|
echo $tmeout
|
||||||
|
runPublic "^usave query\n"
|
||||||
finishedPublic=$(tail -n 4 "$PUBLICDIR/$LogFile")
|
finishedPublic=$(tail -n 4 "$PUBLICDIR/$LogFile")
|
||||||
|
PATHTOBACKUP="$PATHTOBACKUP \"$PUBLICDIR\""
|
||||||
done
|
done
|
||||||
borg create --stats --compression auto,zstd,9 "$BACKUPDIR::$BACKUPDATE-MncftPublic" "$PUBLICDIR"
|
echo "Passou Public"
|
||||||
runPublic "say ^usave resume\n"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $otherBackup ]]; then
|
if [[ $otherBackup ]]; then
|
||||||
@ -67,8 +70,7 @@ if [[ $otherBackup ]]; then
|
|||||||
runCreative "save query\n"
|
runCreative "save query\n"
|
||||||
finishedCreative=$(tail -n 4 "$CREATIVEDIR/$LogFile")
|
finishedCreative=$(tail -n 4 "$CREATIVEDIR/$LogFile")
|
||||||
done
|
done
|
||||||
runCreative "^u"
|
PATHTOBACKUP="$PATHTOBACKUP \"$CREATIVEDIR\""
|
||||||
runCreative "save resume\n"
|
|
||||||
|
|
||||||
timeout=30
|
timeout=30
|
||||||
finishedSurvival=""
|
finishedSurvival=""
|
||||||
@ -83,10 +85,12 @@ if [[ $otherBackup ]]; then
|
|||||||
runSurvival "save query\n"
|
runSurvival "save query\n"
|
||||||
finishedSurvival=$(tail -n 4 "$SURVIVALDIR/$LogFile")
|
finishedSurvival=$(tail -n 4 "$SURVIVALDIR/$LogFile")
|
||||||
done
|
done
|
||||||
|
PATHTOBACKUP="$PATHTOBACKUP \"$SURVIVALDIR\""
|
||||||
borg create --stats --compression auto,zstd,9 "$BACKUPDIR::$BACKUPDATE-MncftSurvival" "$SURVIVALDIR"
|
|
||||||
borg create --stats --compression auto,zstd,9 "$BACKUPDIR::$BACKUPDATE-MncftCreative" "$CREATIVEDIR"
|
|
||||||
runSurvival "^u"
|
|
||||||
runSurvival "save resume\n"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[[ $PATHTOBACKUP ]] && borg create --stats --compression auto,zstd,9 "$BACKUPDIR::$BACKUPDATE" "$PATHTOBACKUP"
|
||||||
|
|
||||||
|
[[ $publicBackup ]] && runPublic "say ^usave resume\n"
|
||||||
|
[[ $otherBackup ]] && runSurvival "say ^usave resume\n" && runCreative "say ^usave resume\n"
|
||||||
|
|
||||||
borg prune --keep-within=3d --keep-hourly=96 --keep-weekly=8 --keep-monthly=6 "$BACKUPDIR"
|
borg prune --keep-within=3d --keep-hourly=96 --keep-weekly=8 --keep-monthly=6 "$BACKUPDIR"
|
||||||
|
50
Services/minecraft-server-public.sh
Normal file
50
Services/minecraft-server-public.sh
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
if ! screen -list | grep -q "Minecraft"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
BACKUPDIR="/home/bruno/Backups/zBackup-Minecraft/backups"
|
||||||
|
SERVERDIR="/home/bruno/Apps/Minecraft/BedrockServer_Public_19132"
|
||||||
|
LogFile="log.txt"
|
||||||
|
|
||||||
|
alias run='screen -S MinecraftPublic -X'
|
||||||
|
alias runAllWorlds='run at "#" stuff'
|
||||||
|
|
||||||
|
runAllWorlds "^u"
|
||||||
|
runAllWorlds "save hold\n"
|
||||||
|
sleep 2s
|
||||||
|
|
||||||
|
finishedCreative=""
|
||||||
|
timeout=30
|
||||||
|
while [[ $finishedCreative != *"Data saved."* ]]; do
|
||||||
|
if [[ $timeout -lt 1 ]]; then
|
||||||
|
notify-send "Error backuping Creative world"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
(( timeout-- ))
|
||||||
|
sleep 1s
|
||||||
|
runCreative "^u"
|
||||||
|
runCreative "save query\n"
|
||||||
|
finishedCreative=$(tail -n 4 "$CREATIVEDIR/$LogFile")
|
||||||
|
done
|
||||||
|
|
||||||
|
timeout=30
|
||||||
|
finishedSurvival=""
|
||||||
|
while [[ $finishedSurvival != *"Data saved."* ]]; do
|
||||||
|
if [[ $timeout -lt 1 ]]; then
|
||||||
|
notify-send "Error backuping Survival world"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
(( timeout-- ))
|
||||||
|
sleep 1s
|
||||||
|
runSurvival "^u"
|
||||||
|
runSurvival "save query\n"
|
||||||
|
finishedSurvival=$(tail -n 4 "$SURVIVALDIR/$LogFile")
|
||||||
|
done
|
||||||
|
|
||||||
|
BACKUPDATE=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||||
|
mkdir "$BACKUPDIR/$BACKUPDATE"
|
||||||
|
/bin/tar c "$SURVIVALDIR/worlds" | zbackup --non-encrypted backup "$BACKUPDIR/$BACKUPDATE/Survival"
|
||||||
|
/bin/tar c "$CREATIVEDIR/worlds" | zbackup --non-encrypted backup "$BACKUPDIR/$BACKUPDATE/Creative"
|
||||||
|
|
||||||
|
runAllWorlds "^u"
|
||||||
|
runAllWorlds "save resume\n"
|
@ -4,4 +4,4 @@ OnFailure=logErrors@%n.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart = /bin/bash /home/bruno/dns_update_rootHints.sh
|
ExecStart = /bin/bash /home/bruno/Apps/linuxShortcuts/Services/roothints.sh
|
||||||
|
11
Services/xpra@.service
Normal file
11
Services/xpra@.service
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=xpra display
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=%i
|
||||||
|
EnvironmentFile=/etc/conf.d/xpra
|
||||||
|
ExecStart=/usr/bin/xpra --no-daemon start ${%i}
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -1,6 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
activity=`kactivities-cli --current-activity | cut -d" " -f3`
|
activity=`kactivities-cli --current-activity | cut -d" " -f3`
|
||||||
|
|
||||||
|
if [[ $1 =~ .*youtube\.com.* ]]; then
|
||||||
|
/bin/freetube "$*" >/dev/null 2>&1 &
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $1 =~ .*\&incognitottt$ ]]; then
|
if [[ $1 =~ .*\&incognitottt$ ]]; then
|
||||||
url="${1/\&incognitottt/}"
|
url="${1/\&incognitottt/}"
|
||||||
[[ $activity == "OXO" ]] && /bin/brave --incognito "$url" >/dev/null 2>&1 &
|
[[ $activity == "OXO" ]] && /bin/brave --incognito "$url" >/dev/null 2>&1 &
|
||||||
|
51
start-dashboard
Executable file
51
start-dashboard
Executable file
@ -0,0 +1,51 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [[ $(tmux ls | grep 'dashboard') ]]; then
|
||||||
|
terminator -T "Dashboard" -x tmux a -t dashboard &
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
echo "Iniciando Dashboard..."
|
||||||
|
sleep 2
|
||||||
|
tmux new -d -s dashboard
|
||||||
|
tmux rename-window -t dashboard "Dashboard"
|
||||||
|
terminator -T "Dashboard" -x tmux a -t dashboard &
|
||||||
|
sleep 10
|
||||||
|
tmux splitw -t dashboard
|
||||||
|
tmux splitw -h -t dashboard:0.0
|
||||||
|
tmux resize-pane -U -t dashboard:0.2 15
|
||||||
|
tmux resize-pane -L -t dashboard:0.1 10
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# 0 - Dashboard/khal
|
||||||
|
tmux send -t dashboard:0.0 $'clear;watch --interval $((30 * 60)) --no-title --color screenfetch\n'
|
||||||
|
tmux send -t dashboard:0.1 $'alias clear="clear;figlet Dashboard; echo -n Khal:\ ; khal list; echo;"\n'
|
||||||
|
tmux send -t dashboard:0.2 $'btop\n'
|
||||||
|
tmux send -t dashboard:0.1 $'clear\n'
|
||||||
|
|
||||||
|
# 1 - Tut
|
||||||
|
tmux new-window -t dashboard
|
||||||
|
sleep 1
|
||||||
|
tmux send -t dashboard:1.0 $'tut\n'
|
||||||
|
tmux rename-window -t dashboard:1 tut
|
||||||
|
tmux setw monitor-activity -t dashboard:1
|
||||||
|
|
||||||
|
# 2 - GoMuks
|
||||||
|
tmux new-window -t dashboard
|
||||||
|
sleep 1
|
||||||
|
tmux send -t dashboard:2.0 $'gomuks\n'
|
||||||
|
tmux rename-window -t dashboard:2 gomuks
|
||||||
|
|
||||||
|
# 3 - NeoMutt
|
||||||
|
tmux new-window -t dashboard
|
||||||
|
sleep 1
|
||||||
|
tmux send -t dashboard:3.0 $'neomutt\n'
|
||||||
|
tmux rename-window -t dashboard:3 neomutt
|
||||||
|
|
||||||
|
# 4 - Joplin
|
||||||
|
tmux new-window -t dashboard
|
||||||
|
sleep 1
|
||||||
|
tmux send -t dashboard:4.0 $'joplin\n'
|
||||||
|
tmux rename-window -t dashboard:4 joplin
|
||||||
|
|
||||||
|
tmux select-window -t dashboard:0
|
||||||
|
tmux setw monitor-silence -t dashboard:0
|
13
stop-pmovase.sh
Executable file
13
stop-pmovase.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
#if [[ !$(tmux ls | grep 'pmovase') ]]; then
|
||||||
|
# exit
|
||||||
|
#fi
|
||||||
|
|
||||||
|
killall /home/bruno/Apps/firefox/firefox-bin
|
||||||
|
killall /bin/vscodium
|
||||||
|
|
||||||
|
cd /home/bruno/development/projetomovase/
|
||||||
|
vagrant suspend
|
||||||
|
tmux send -t pmovase:0.4 $'^u'
|
||||||
|
#tmux send -t pmovase:0.4 $'vagrant suspend &\n'
|
||||||
|
tmux kill-session -t pmovase
|
21
tmuxStartDicionarios.sh
Executable file
21
tmuxStartDicionarios.sh
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
projectName=dicionarioscc
|
||||||
|
cd /run/media/bruno/Multimedia/MyDocuments/Development/BrunoFontes/dicionarios.cc/
|
||||||
|
if [[ $(tmux ls | grep '$projectName') ]]; then
|
||||||
|
uxterm -T $projectName -geometry 627x927 -e tmux a -t $projectName &
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmux new -d -s $projectName
|
||||||
|
|
||||||
|
tmux splitw -ht $projectName
|
||||||
|
tmux splitw -vt $projectName:0.1
|
||||||
|
tmux splitw -vt $projectName:0.2
|
||||||
|
|
||||||
|
uxterm -T $projectName -geometry 627x927 -e tmux a -t $projectName &
|
||||||
|
|
||||||
|
tmux send -t $projectName:0.0 $'nvim\n'
|
||||||
|
tmux send -t $projectName:0.1 $'make dev\n'
|
||||||
|
tmux send -t $projectName:0.2 $'tail -f src/dicio.log\n'
|
||||||
|
tmux send -t $projectName:0.3 $'gss\n'
|
Loading…
Reference in New Issue
Block a user