Skip to content

Commit 9290f1d

Browse files
committed
Update scripts and add clean-system
Update scripts and add clean-system Signed-off-by: Bensuperpc <[email protected]>
1 parent 589ba78 commit 9290f1d

File tree

14 files changed

+78
-1
lines changed

14 files changed

+78
-1
lines changed

archlinux/clean-arch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ else
3232
fi
3333

3434
sudo pacman -Sc
35-
sudo pacman -R $(pacman -Qtdq)
35+
sudo pacman -Rns $(pacman -Qtdq)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

git/git-commit.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
#//////////////////////////////////////////////////////////////
4+
#// ____ //
5+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
6+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
7+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
8+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
9+
#// |_| |_| //
10+
#//////////////////////////////////////////////////////////////
11+
#// //
12+
#// Script, 2021 //
13+
#// Created: 24, July, 2021 //
14+
#// Modified: 24, July, 2021 //
15+
#// file: - //
16+
#// - //
17+
#// Source: https://stackoverflow.com/a/2979587/10152334 //
18+
#// OS: ALL //
19+
#// CPU: ALL //
20+
#// //
21+
#//////////////////////////////////////////////////////////////
22+
23+
if (( $# == 2 )); then
24+
git commit -s -m $1 -m $2
25+
elif (( $# == 1 )); then
26+
git commit -s -m $1 -m $1
27+
else
28+
echo "Usage: ${0##*/} <Title> <Message>"
29+
echo "Usage: ${0##*/} <Title>"
30+
exit 1
31+
fi

linux/cleaning/clean-system.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
#//////////////////////////////////////////////////////////////
4+
#// ____ //
5+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
6+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
7+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
8+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
9+
#// |_| |_| //
10+
#//////////////////////////////////////////////////////////////
11+
#// //
12+
#// Script, 2021 //
13+
#// Created: 24, July, 2021 //
14+
#// Modified: 24, July, 2021 //
15+
#// file: - //
16+
#// - //
17+
#// Source: - //
18+
#// OS: ALL //
19+
#// CPU: ALL //
20+
#// //
21+
#//////////////////////////////////////////////////////////////
22+
23+
if [[ "$EUID" = 0 ]]; then
24+
echo "(1) already root"
25+
else
26+
sudo -k # make sure to ask for password on next sudo
27+
if sudo true; then
28+
echo "(2) correct password"
29+
else
30+
echo "(3) wrong password"
31+
exit 1
32+
fi
33+
fi
34+
35+
#journalctl --disk-usage
36+
sudo journalctl --vacuum-time=3d
37+
38+
#du -h /var/lib/snapd/snaps
39+
sudo find ~/.cache/ -type f -atime +3 -delete
40+
41+
sudo find ~/Téléchargements/ -type f -atime +15 -delete || true
42+
sudo find ~/Downloads/ -type f -atime +15 -delete || true
43+
44+
sudo rm -rf ~/.local/share/Trash/*
45+
46+
echo "Clean: OK"

0 commit comments

Comments
 (0)