fix indent style

This commit is contained in:
Aminda Suomalainen 2023-04-06 12:03:10 +03:00
parent 2fdf26066c
commit 04eab0e211
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
16 changed files with 143 additions and 144 deletions

View File

@ -17,4 +17,3 @@ indent_size = 2
[*.{txt,markdown,md}]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2

View File

@ -9,8 +9,8 @@
# Echo a warning and exit if NOT running as root
if [ "$(id -u)" != "0" ]; then
echo "acme.sh prefers root, this script demands it." 1>&2
exit 1
echo "acme.sh prefers root, this script demands it." 1>&2
exit 1
fi
# The domain the certs are mainly issued for

View File

@ -6,24 +6,24 @@
# Loop with the users
for user in mikaela matti tommi tiina nenne anneli
do
# To see that it works
echo "Current user: $user"
# Create the user & homedir if it doesn't exist
useradd -m $user
# Add the user to normal Debian groups
usermod -a -G lp,cdrom,floppy,audio,dip,plugdev,netdev,bluetooth,lpadmin "$user"
# Set user & group as the owner (in case fresh install with old /home)
chown -R $user:$user /home/$user
# Remove password & force new to be given during first login
passwd -de $user
# Does this still work?
echo "User ready: $user"
# To see that it works
echo "Current user: $user"
# Create the user & homedir if it doesn't exist
useradd -m $user
# Add the user to normal Debian groups
usermod -a -G lp,cdrom,floppy,audio,dip,plugdev,netdev,bluetooth,lpadmin "$user"
# Set user & group as the owner (in case fresh install with old /home)
chown -R $user:$user /home/$user
# Remove password & force new to be given during first login
passwd -de $user
# Does this still work?
echo "User ready: $user"
done
# And next sudoers
for sudoer in mikaela matti tommi tiina
do
# Add the user to sudo group (as they are administrator)
echo "Current sudoer: $sudoer"
usermod -a -G wheel $sudoer
# Add the user to sudo group (as they are administrator)
echo "Current sudoer: $sudoer"
usermod -a -G wheel $sudoer
done

View File

@ -8,37 +8,37 @@ set -x
# XMPP
if hash dino 2>/dev/null; then
(dino&)
(dino&)
fi
if hash gajim 2>/dev/null; then
(gajim&)
(gajim&)
else
(flatpak run org.gajim.Gajim --quiet&)
(flatpak run org.gajim.Gajim --quiet&)
fi
# Jami, mostly P2P app
if hash jami-gnome 2>/dev/null; then
(jami-gnome -r&)
(jami-gnome -r&)
fi
# Telegram.org
if [ -f ~/.local/Telegram/Updater ]
then
(~/.local/Telegram/Updater -many -startintray&)
(~/.local/Telegram/Updater -many -startintray&)
else
if hash telegram-desktop 2>/dev/null; then
(telegram-desktop -many -startintray&)
fi
if hash telegram-desktop 2>/dev/null; then
(telegram-desktop -many -startintray&)
fi
fi
# Keybase
if hash run_keybase 2>/dev/null; then
(run_keybase&)
(run_keybase&)
fi
# Steam
if hash steam 2>/dev/null; then
(STEAM_FRAME_FORCE_CLOSE=1 steam -silent&)
(STEAM_FRAME_FORCE_CLOSE=1 steam -silent&)
fi
# Signal

View File

@ -14,100 +14,100 @@ export LC_ALL=en_US.utf8
# if hash checks that the command exists
if hash apt-get 2>/dev/null; then
# I am not sure if -y here even does anything, at least it won't work for
# accepting suite changes for Debian when testing becomes stable.
# Checking for updates or new packages.
apt-get -y update
# I am not sure if -y here even does anything, at least it won't work for
# accepting suite changes for Debian when testing becomes stable.
# Checking for updates or new packages.
apt-get -y update
# potentially unsafe first time, so there hopefully is space for new kernels
apt-get "$@" autoremove
# potentially unsafe first time, so there hopefully is space for new kernels
apt-get "$@" autoremove
# If arguments like -y are passed to the script, they become "$@"
apt-get "$@" upgrade --with-new-pkgs
# If arguments like -y are passed to the script, they become "$@"
apt-get "$@" upgrade --with-new-pkgs
# potentially unsafe, second time after new kernel is installed
apt-get "$@" autoremove
# potentially unsafe, second time after new kernel is installed
apt-get "$@" autoremove
fi
if hash dpkg 2>/dev/null; then
# In case dpkg was interrupted previously, configure packages.
dpkg --configure -a
# In case dpkg was interrupted previously, configure packages.
dpkg --configure -a
fi
# Enables Fedora third party repositories if not enabled, otherwise quiet.
# My systems most likely have them already
if hash fedora-third-party 2>/dev/null; then
fedora-third-party enable
# Are they enabled?
fedora-third-party query
fedora-third-party enable
# Are they enabled?
fedora-third-party query
fi
if hash dnf 2>/dev/null; then
# I don't know if -y does anything here either and I think this may be
# useless, but I am used to it coming from apt and I think it will just
# say nothing to do or do nothing if mirrors haven't updated.
dnf check-update -y
# I don't know if -y does anything here either and I think this may be
# useless, but I am used to it coming from apt and I think it will just
# say nothing to do or do nothing if mirrors haven't updated.
dnf check-update -y
# potentially unsafe first time, I am not sure if this is concern outside of Debian/Ubuntu though
dnf "$@" autoremove
# potentially unsafe first time, I am not sure if this is concern outside of Debian/Ubuntu though
dnf "$@" autoremove
# If arguments like -y are passed to the script, they become "$@"
dnf "$@" upgrade
# If arguments like -y are passed to the script, they become "$@"
dnf "$@" upgrade
# potentially unsafe, see a few lines above and the apt-get section
dnf "$@" autoremove
# potentially unsafe, see a few lines above and the apt-get section
dnf "$@" autoremove
fi
if hash rpmconf 2>/dev/null; then
# Tests if there are rpmsave/rpmnew files, hopefully is non-interactive
rpmconf -a -t
# Tests if there are rpmsave/rpmnew files, hopefully is non-interactive
rpmconf -a -t
fi
if hash flatpak 2>/dev/null; then
# Flatpak apps are sandboxed and should be safe to update automatically
# KEEP --noninteractive IN PLACE! While it removes progress bar, it also
# doesn't blink making it worth it in case of migraine attack.
flatpak update --noninteractive --assumeyes
# Note to self
echo '!!! In case of weird errors e.g. while trying to checkout, try running: flatpak repair'
echo ' 404 is not a weird error, try flatpak <subcommand> --no-static-deltas'
# Flatpak's version of `apt autoremove`
flatpak uninstall --unused --assumeyes --noninteractive
# Flatpak apps are sandboxed and should be safe to update automatically
# KEEP --noninteractive IN PLACE! While it removes progress bar, it also
# doesn't blink making it worth it in case of migraine attack.
flatpak update --noninteractive --assumeyes
# Note to self
echo '!!! In case of weird errors e.g. while trying to checkout, try running: flatpak repair'
echo ' 404 is not a weird error, try flatpak <subcommand> --no-static-deltas'
# Flatpak's version of `apt autoremove`
flatpak uninstall --unused --assumeyes --noninteractive
fi
if hash snap 2>/dev/null; then
# Snap packages auto-update anyway though, but I like checking them while
# doing everything else too
snap refresh
# so I may have some sort of an idea when snap packages have been updated
# if they have auto-refreshed
snap changes
# Snap packages auto-update anyway though, but I like checking them while
# doing everything else too
snap refresh
# so I may have some sort of an idea when snap packages have been updated
# if they have auto-refreshed
snap changes
fi
# I don't have flatpak or snap going to background, because I often do
# ./deb-update.bash && poweroff
if hash pkcon 2>/dev/null; then
# So PackageKit using KDE Plasma and possibly GNOME stop alerting about
# already installed updates. It has backends for all other package managers,
# so it needs to be after them.
pkcon refresh force
# So PackageKit using KDE Plasma and possibly GNOME stop alerting about
# already installed updates. It has backends for all other package managers,
# so it needs to be after them.
pkcon refresh force
fi
if hash apt-file 2>/dev/null; then
# So the local apt-file database is up-to-date.
apt-file update
# So the local apt-file database is up-to-date.
apt-file update
fi
if hash needrestart 2>/dev/null; then
# needrestart batch mode, should be visible on bottom of scrollback
# see https://github.com/liske/needrestart/blob/master/README.batch.md
needrestart -b
# needrestart batch mode, should be visible on bottom of scrollback
# see https://github.com/liske/needrestart/blob/master/README.batch.md
needrestart -b
fi
# Sedric workaround, located in this repo. I trust /root/
if [ -f /root/fixgrub.bash ]
then
/root/fixgrub.bash
/root/fixgrub.bash
fi
# Hide commands being executed again

View File

@ -19,46 +19,46 @@ HOSTNAME=""
# Get IPv4 address
if hash dig 2>/dev/null; then
WAN_IP4=$(dig +short myip.opendns.com. A @208.67.220.220)
WAN_IP4=$(dig +short myip.opendns.com. A @208.67.220.220)
else
WAN_IP4=$(curl -sL4 https://icanhazip.com/)
WAN_IP4=$(curl -sL4 https://icanhazip.com/)
fi
if [ -f $HOME/.wan_ip4-ydns.txt ]; then
OLD_WAN_IP4=$(cat $HOME/.wan_ip4-ydns.txt)
OLD_WAN_IP4=$(cat $HOME/.wan_ip4-ydns.txt)
else
echo "No file, need IP4"
OLD_WAN_IP4=""
echo "No file, need IP4"
OLD_WAN_IP4=""
fi
# Get IPv6 address
if hash dig 2>/dev/null; then
WAN_IP6=$(dig +short myip.opendns.com. AAAA @2620:0:ccd::2)
WAN_IP6=$(dig +short myip.opendns.com. AAAA @2620:0:ccd::2)
else
WAN_IP6=$(curl -sL6 https://icanhazip.com/)
WAN_IP6=$(curl -sL6 https://icanhazip.com/)
fi
if [ -f $HOME/.wan_ip6-ydns.txt ]; then
OLD_WAN_IP6=$(cat $HOME/.wan_ip6-ydns.txt)
OLD_WAN_IP6=$(cat $HOME/.wan_ip6-ydns.txt)
else
echo "No file, need IP6"
OLD_WAN_IP6=""
echo "No file, need IP6"
OLD_WAN_IP6=""
fi
# Update IPv4
if [ "$WAN_IP4" = "$OLD_WAN_IP4" ]; then
echo "IP4 Unchanged"
echo "IP4 Unchanged"
else
echo $WAN_IP4 > $HOME/.wan_ip4-ydns.txt
echo "Updating DNS to $WAN_IP4"
curl -4 --basic -u "$USEREMAIL:$PASSWORD" --silent \
https://ydns.eu/api/v1/update/?host=$HOSTNAME
echo $WAN_IP4 > $HOME/.wan_ip4-ydns.txt
echo "Updating DNS to $WAN_IP4"
curl -4 --basic -u "$USEREMAIL:$PASSWORD" --silent \
https://ydns.eu/api/v1/update/?host=$HOSTNAME
fi
# Update IPv6
if [ "$WAN_IP6" = "$OLD_WAN_IP6" ]; then
echo "IP6 Unchanged"
echo "IP6 Unchanged"
else
echo $WAN_IP6 > $HOME/.wan_ip6-ydns.txt
echo "Updating DNS to $WAN_IP6"
curl -6 --basic -u "$USEREMAIL:$PASSWORD" --silent \
https://ydns.eu/api/v1/update/?host=$HOSTNAME
echo $WAN_IP6 > $HOME/.wan_ip6-ydns.txt
echo "Updating DNS to $WAN_IP6"
curl -6 --basic -u "$USEREMAIL:$PASSWORD" --silent \
https://ydns.eu/api/v1/update/?host=$HOSTNAME
fi

View File

@ -24,23 +24,23 @@ HOSTNAME=""
# Get IPv6 address
if hash dig 2>/dev/null; then
WAN_IP6=$(dig +short myip.opendns.com. AAAA @2620:0:ccd::2)
WAN_IP6=$(dig +short myip.opendns.com. AAAA @2620:0:ccd::2)
else
WAN_IP6=$(curl -sL6 https://icanhazip.com/)
WAN_IP6=$(curl -sL6 https://icanhazip.com/)
fi
if [ -f $HOME/.ydns6.txt ]; then
OLD_WAN_IP6=$(cat $HOME/.ydns6.txt)
OLD_WAN_IP6=$(cat $HOME/.ydns6.txt)
else
echo "No file, need IP6"
OLD_WAN_IP6=""
echo "No file, need IP6"
OLD_WAN_IP6=""
fi
# Update IPv6
if [ "$WAN_IP6" = "$OLD_WAN_IP6" ]; then
echo "IP6 Unchanged"
echo "IP6 Unchanged"
else
echo $WAN_IP6 > $HOME/.ydns6.txt
echo "Updating DNS to $WAN_IP6"
curl -6 --basic -u "$USEREMAIL:$PASSWORD" --silent \
https://ydns.io/api/v1/update/?host=$HOSTNAME\&ip=$WAN_IP6
echo $WAN_IP6 > $HOME/.ydns6.txt
echo "Updating DNS to $WAN_IP6"
curl -6 --basic -u "$USEREMAIL:$PASSWORD" --silent \
https://ydns.io/api/v1/update/?host=$HOSTNAME\&ip=$WAN_IP6
fi

View File

@ -11,8 +11,8 @@ set -x
# There is no reason to run if dnf hasn't moved the proper config aside.
if [ -f /boot/efi/EFI/fedora/grub.cfg.rpmsave ]
then
rm -f /boot/efi/EFI/fedora/grub.cfg.rpmsave
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
rm -f /boot/efi/EFI/fedora/grub.cfg.rpmsave
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
fi
set +x

View File

@ -25,14 +25,14 @@ echo "To connect:
# Device Provisioning Protocol https://iwd.wiki.kernel.org/device_provisioning
# requires qrencode, so let's check it exists
if hash qrencode needrestart 2>/dev/null; then
# Remind of command to share
echo "To share credentials:
# Remind of command to share
echo "To share credentials:
% iwctl dpp $WIFIDEVICE start-configurator
"
# It needs to be stopped too
echo "To stop sharing credentials:
# It needs to be stopped too
echo "To stop sharing credentials:
% iwctl dpp $WIFIDEVICE stop"
# Remind me that this part exists if qrencode is not found.
else
echo "WARNING! qrencode not found."
echo "WARNING! qrencode not found."
fi

View File

@ -12,10 +12,10 @@ echo "Creating to $TARGETDIR"
# Function to generate QRs based on our URL scheme
function generateQr () {
# $2 is first for the output as there are more regions than associations,
# avoids overwriting
# -H = 30 % damage allowing highest error correction
qrencode -l H -o $2.png "https://piraattipuolue.fi/yhdistykset/$1/aluevaaliehdokkaat-2022-$2"
# $2 is first for the output as there are more regions than associations,
# avoids overwriting
# -H = 30 % damage allowing highest error correction
qrencode -l H -o $2.png "https://piraattipuolue.fi/yhdistykset/$1/aluevaaliehdokkaat-2022-$2"
}
# Calling the function with associations and regions, they should be

View File

@ -7,10 +7,10 @@ CURRENT=1
# until $CURRENT equals $TORRENTS ?
until [ $CURRENT -gt $TORRENTS ]
do
# get the information for $CURRENT? Grep the magnet line and cut out the
# frist field ("Magnet: ") using awk?
transmission-remote -l -t $CURRENT -i | grep -i magnet | awk -F': ' '{print $2}'
# increase $CURRENT
((CURRENT++))
do
# get the information for $CURRENT? Grep the magnet line and cut out the
# frist field ("Magnet: ") using awk?
transmission-remote -l -t $CURRENT -i | grep -i magnet | awk -F': ' '{print $2}'
# increase $CURRENT
((CURRENT++))
done

View File

@ -13,18 +13,18 @@ FlagsForFirefox="--ProfileManager $@"
# Developer edition (and signatures): https://releases.mozilla.org/pub/devedition/releases/
if [ -f ~/.local/firefox/firefox ]
then
~/.local/firefox/firefox $FlagsForFirefox
~/.local/firefox/firefox $FlagsForFirefox
# Fallback to global wayland installation
elif [ -f /usr/bin/firefox-wayland ]
then
/usr/bin/firefox-wayland $FlagsForFirefox
/usr/bin/firefox-wayland $FlagsForFirefox
# Fallback to global installation
elif [ -f /usr/bin/firefox ]
then
/usr/bin/firefox $FlagsForFirefox
/usr/bin/firefox $FlagsForFirefox
# Fallback to flatpak, don't care if it doesn't exist
else
flatpak run org.mozilla.firefox $FlagsForFirefox
flatpak run org.mozilla.firefox $FlagsForFirefox
fi
set +x

View File

@ -7,11 +7,11 @@
set -x
if [ -f /snap/bin/fluffychat ]
then
snap run fluffychat $@
snap run fluffychat $@
elif [ -f /var/lib/flatpak/exports/bin/im.fluffychat.Fluffychat ]
then
flatpak run im.fluffychat.Fluffychat $@
flatpak run im.fluffychat.Fluffychat $@
else
/usr/bin/fluffychat
/usr/bin/fluffychat
fi
set +x

View File

@ -7,11 +7,11 @@ set -x
# Check if go is installed through snap
if [ -f /snap/bin/go ]
then
snap run go $@
snap run go $@
# Fallback to system installation
else
/usr/bin/go $@
/usr/bin/go $@
fi
set +x

View File

@ -12,18 +12,18 @@ FlagsForThunderbird="--ProfileManager $@"
# Thunderbird (stable, beta) and signatures: https://releases.mozilla.org/pub/thunderbird/releases/
if [ -f ~/.local/thunderbird/thunderbird ]
then
~/.local/thunderbird/thunderbird $FlagsForThunderbird
~/.local/thunderbird/thunderbird $FlagsForThunderbird
# Fallback to global installation
elif [ -f /usr/bin/thunderbird-wayland ]
then
/usr/bin/thunderbird-wayland $FlagsForThunderbird
/usr/bin/thunderbird-wayland $FlagsForThunderbird
# Fallback to global installation
elif [ -f /usr/bin/thunderbird ]
then
/usr/bin/thunderbird $FlagsForThunderbird
/usr/bin/thunderbird $FlagsForThunderbird
# Fallback to flatpak, don't care if it doesn't exist
else
flatpak run org.mozilla.Thunderbird $FlagsForThunderbird
flatpak run org.mozilla.Thunderbird $FlagsForThunderbird
fi
set +x

View File

@ -3,13 +3,13 @@ import sys
import secrets
try:
wantedCount = int(sys.argv[1])
wantedCount = int(sys.argv[1])
except IndexError as noarg:
print("Enter a digit as an argument!")
print("Enter a digit as an argument!")
try:
for i in range(int(wantedCount)):
print(secrets.randbelow(10),end="")
for i in range(int(wantedCount)):
print(secrets.randbelow(10),end="")
except NameError as noWantedCount:
print()
print()