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}] [*.{txt,markdown,md}]
trim_trailing_whitespace = false trim_trailing_whitespace = false
indent_style = space indent_style = space
indent_size = 2

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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