This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To prevent unsuppoorted architecture error messages from apt on Ubuntu 24.04 (Noble Numbat) | |
# with the new apt sources format | |
# Example error messages on `apt update` after a fresh install: | |
# N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://packages.microsoft.com/repos/edge stable InRelease' doesn't support architecture 'i386' | |
# N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://dl.google.com/linux/chrome/deb stable InRelease' doesn't support architecture 'i386' | |
################################################# | |
### SINGLE-ARCH (i.e. fix arch-related error) ### | |
################################################# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maas-build-debug-image() { | |
local -a UBU_RELS=(bionic) | |
export IMG_PWD="Ubuntu1+" | |
# Create salted pw for images | |
printf "\e[2G - Salting the desired password of \x22${IMG_PWD}\x22 for use in debug-image\n" | |
export SALTED_PWD="$(echo 'Ubuntu1+'|mkpasswd --method=SHA-512 --rounds=4096 -s)" | |
# Dowload images | |
printf '%s\n' ${UBU_RELS[@]}|xargs -rn1 -P0 bash -c ' | |
IMG_URL=https://cloud-images.ubuntu.com/${0}/current/${0}-server-cloudimg-amd64-root.tar.xz; | |
printf "\e[2G - Fetching Ubuntu release ${0^} from ${IMG_URL}\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo install -o0 -g0 -m0755 /dev/null /etc/networkd-dispatcher/routable.d/99-disable-tso-gso-gro.sh | |
cat <<'EOF' |sudo tee /etc/networkd-dispatcher/routable.d/99-disable-tso-gso-gro.sh | |
#!/bin/bash | |
# | |
# This script will be placed in /etc/networkd-dispatcher/routable.d/ | |
# and made exectuable | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Work around for when you want/need your password to contain part of your username | |
# Disable the pwquality profile in PAM | |
sudo pam-auth-update --disable pwquality | |
# Change your password | |
echo 'ubuntu:Ubuntu123!'|sudo chpasswd -s | |
# Enable the pwquality profile in PAM | |
sudo pam-auth-update --enable pwqualit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix-usb2serial() { | |
printf "\n\e[1mFix USB to Serial device permissions\e[0m\n" | |
local DEVREGX='.*tty[UA].*' W='s' | |
declare -ag TTYUSB_DEVS=($(find /sys/class/tty -type l -regex "${DEVREGX}" -printf "%P\n" 2>&1)) | |
[[ ${#TTYUSB_DEVS[@]} -ge 1 ]] && { local W=""; } || { printf "\nNo USB to Serial devices found using regex \x22${DEVREGX}\x22.\nQuitting\n\n";return 3; } | |
[[ -n $(id -Gn|grep 2>/dev/null -oE dialout) ]] && { printf "\e[2G - User $USER already a member of \x22dialout\x22 group \e[3m(Good\x21)\e[0m\n"; } || { printf "\e[2G -- Adding User $USER to the \x22dialout\x22 group\n"; sudo usermode -aG dialout $USER; } | |
printf "\e[2G - Creaing udev rules file: /etc/udev/rules.d/50-ttyUSB.rules\n" | |
sudo install -o0 -g0 -m0644 /dev/null /etc/udev/rules.d/50-ttyUSB.rules | |
printf "\e[2G - Adding ${#TTYUSB_DEVS[@]} udev rule${W}:\n" | |
(printf "%s\n" ${TTYUSB_DEVS[@]}|xargs -I{} printf "KERNEL==\x22{}\x22,\x20MODE=\x270666\x22\n")|sudo tee -a /etc/udev/rules.d/50-ttyUSB.rules|sed -r 's/^/ /g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu-repo-size() { | |
ubuntu-repo-size_usage() { | |
printf "\n\e[1m\e[2G${FUNCNAME%%_*}\e[0m\n\n" | |
printf "\e[1m\e[2GUsage\e[0m: ${FUNCNAME%%_*} [options]\n\n" | |
printf "\e[1m\e[2GOptions\e[0m:\n\n" | |
printf "\e[3G -a, --arch \e[28GArchitecture to display, i.e. amd64,arm64,armhf,i386,ppc64el,s390x (Default: amd64)\n" | |
printf "\e[3G -s, --series \e[28GRelease nicknames to get information for, (Default: current LTS)\n" | |
printf "\e[3G -c, --components \e[28GList of repo components to query (Default: main,universe,multiverse,restricted)\n" | |
printf "\e[3G -p, --pockets \e[28GList of repo pockets components to query (Default: \$series \$series-updates \$series-backports \$series-security \$series-proposed)\n" | |
printf "\e[3G -i, --intel-repo-uri \e[28GURI of ubuntu archive for amd64/i386 (Default: http://archive.ubuntu.com/ubuntu/dists)\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################## | |
# Scripted XRDP Installation # | |
############################## | |
### Note: You can only be logged in via console or RDP, not both. | |
### If you get blackscreen via RDP or if console keeps going | |
### back to login screen, run `gnome-session-quit --force --logout` | |
### via ssh as the same user you are trying to login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install \ | |
gimp gimp-plugin-registry gimp-data-extras gimp-help-common gimp-help-en gimp-gap gimp-data -qyf \ | |
$(apt-cache search -n '^obs-'|awk '/Studio|studio/&&!/websocket/{print $1}'|paste -sd' ') \ | |
-yqf --auto-remove --purge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Fix thumbnails (Long deprecated Image.ANTIALIAS finally removed in PIL 10.0.0) | |
sudo sed -i 's/Image.ANTIALIAS/Image.LANCZOS/g' /usr/lib/python3/dist-packages/hydrapaper/wallpaper_flowbox_item.py | |
# Fix merge issues when using Dark mode (known buy merging to a single wallpaper in dark mode) | |
sudo sed -i 's/ if set_dark else \x27picture-uri\x27//g' /usr/lib/python3/dist-packages/hydrapaper/wallpaper_merger.py | |
# Restart/Reload hydrapaper App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You can just paste this in a terminal rather than run it as a script. | |
# Up to you... | |
export RFILE=/etc/udev/rules.d/55-dolphin-emu.rules | |
[[ -f ${RFILE} ]] && { sudo rm -f ${RFILE}; } | |
sudo install -o0 -g0 -m 0644 /dev/null ${RFILE} | |
(for i in $(lsusb|awk 'BEGIN{IGNORECASE=1}/mayflash|logitech usb mic|bluetooth dongle|bluetooth radio/{print $6}');do | |
(printf "SUBSYSTEM==\"usb\", ENV{DEVTYPE}==\"usb_device\", ATTRS{idVendor}==\"${i%%:*}\", ATTRS{idProduct}==\"${i##*:}\", MODE=\"0666\", TAG+=\"uaccess\"\n"; |
NewerOlder