nzk-scripts

nzk-app-add

#!/bin/bash
#nzk-app-add
#i use kali linux
# Check for at least one argument
if [ "$#" -lt 1 ]; then
    echo "Usage: nzk-app-add <executable> [--icon <iconpath>]"
    exit 1
fi

EXECUTABLE=$(realpath "$1")
APP_NAME=$(basename "$EXECUTABLE")
ICON_PATH=""

# Check for optional icon argument
if [ "$2" == "--icon" ] && [ -n "$3" ]; then
    ICON_PATH=$(realpath "$3")
fi

# Create .desktop file
DESKTOP_ENTRY="$HOME/.local/share/applications/$APP_NAME.desktop"
echo "[Desktop Entry]" > "$DESKTOP_ENTRY"
echo "Type=Application" >> "$DESKTOP_ENTRY"
echo "Name=$APP_NAME" >> "$DESKTOP_ENTRY"
echo "Exec=$EXECUTABLE" >> "$DESKTOP_ENTRY"
echo "Icon=$ICON_PATH" >> "$DESKTOP_ENTRY"
echo "Terminal=false" >> "$DESKTOP_ENTRY"

# Make the .desktop file executable
chmod +x "$DESKTOP_ENTRY"

echo "$APP_NAME added to applications menu."
      


install log fail

┌──(kali㉿kali)-[~]
└─$ cd nzk-apps 
                                                                             
┌──(kali㉿kali)-[~/nzk-apps]
└─$ ls
bash  install-NZK-Scripts.sh  LICENSE  nzk-code  README.md
                                                                             
┌──(kali㉿kali)-[~/nzk-apps]
└─$ bash ./install-NZK-Scripts.sh
Are you NaruZKurai? (y/n)
If you aren't and you say yes, things will break.
So if you are you NaruZKurai, v1 will be installed and uses /home/kali as default user path
Please enter your answer: n
Cool, let's get started.
nzk-code3 copied successfully.
cp: cannot create regular file '/usr/local/bin/nzk-nature': Permission denied
Failed to copy nzk-nature. Ensure the file exists and try again.
Installation complete.
                                                                             
┌──(kali㉿kali)-[~/nzk-apps]
└─$ cat ./bash/ nzk-nature
cat: ./bash/: Is a directory
cat: nzk-nature: No such file or directory
                                                                             
┌──(kali㉿kali)-[~/nzk-apps]
└─$ cat ./bash/nzk-nature 
#!/bin/bash
#nzk-nature
# Define associative arrays for natures and their properties
CONFIG_FILE="~/.config/nzk-apps/settings.conf"
declare -A nature_stats=(
    [0]="— —" [1]="Attack Defense" [2]="Attack Speed" [3]="Attack Sp. Attack" [4]="Attack Sp. Defense" 
    [5]="Defense Attack" [6]="— —" [7]="Defense Speed" [8]="Defense Sp. Attack" [9]="Defense Sp. Defense" 
    [10]="Speed Attack" [11]="Speed Defense" [12]="— —" [13]="Speed Sp. Attack" [14]="Speed Sp. Defense" 
    [15]="Sp. Attack Attack" [16]="Sp. Attack Defense" [17]="Sp. Attack Speed" [18]="— —" [19]="Sp. Attack Sp. Defense" 
    [20]="Sp. Defense Attack" [21]="Sp. Defense Defense" [22]="Sp. Defense Speed" [23]="Sp. Defense Sp. Attack" [24]="— —"
)
declare -A nature_flavors_english=(
    [0]="— —" [1]="Spicy Sour" [2]="Spicy Sweet" [3]="Spicy Dry" [4]="Spicy Bitter" 
    [5]="Sour Spicy" [6]="— —" [7]="Sour Sweet" [8]="Sour Dry" [9]="Sour Bitter" 
    [10]="Sweet Spicy" [11]="Sweet Sour" [12]="— —" [13]="Sweet Dry" [14]="Sweet Bitter" 
    [15]="Dry Spicy" [16]="Dry Sour" [17]="Dry Sweet" [18]="— —" [19]="Dry Bitter" 
    [20]="Bitter Spicy" [21]="Bitter Sour" [22]="Bitter Sweet" [23]="Bitter Dry" [24]="— —"
)
declare -A nature_flavors_japanese=(
    [0]="— —" [1]="からい すっぱい" [2]="からい あまい" [3]="からい のま" [4]="からい にがい" 
    [5]="すっぱい からい" [6]="— —" [7]="すっぱい あまい" [8]="すっぱい のま" [9]="すっぱい にがい" 
    [10]="あまい からい" [11]="あまい すっぱい" [12]="— —" [13]="あまい のま" [14]="あまい にがい" 
    [15]="のま からい" [16]="のま すっぱい" [17]="のま あまい" [18]="— —" [19]="のま にがい" 
    [20]="にがい からい" [21]="にがい すっぱい" [22]="にがい あまい" [23]="にがい のま" [24]="— —"
)
declare -A nature_flavors_romanji=(
    [0]="— —" [1]="Karaī Suppai" [2]="Karaī Amai" [3]="Karaī Noma" [4]="Karaī Nigai" 
    [5]="Suppai Karaī" [6]="— —" [7]="Suppai Amai" [8]="Suppai Noma" [9]="Suppai Nigai" 
    [10]="Amai Karaī" [11]="Amai Suppai" [12]="— —" [13]="Amai Noma" [14]="Amai Nigai" 
    [15]="Noma Karaī" [16]="Noma Suppai" [17]="Noma Amai" [18]="— —" [19]="Noma Nigai" 
    [20]="Nigai Karaī" [21]="Nigai Suppai" [22]="Nigai Amai" [23]="Nigai Noma" [24]="— —"
)
# Define associative arrays for English, Japanese, and Romanji nature names
declare -A english_natures=( 
    [0]="Hardy" [1]="Lonely" [2]="Brave" [3]="Adamant" [4]="Naughty" 
    [5]="Bold" [6]="Docile" [7]="Relaxed" [8]="Impish" [9]="Lax" 
    [10]="Timid" [11]="Hasty" [12]="Serious" [13]="Jolly" [14]="Naive" 
    [15]="Modest" [16]="Mild" [17]="Quiet" [18]="Bashful" [19]="Rash" 
    [20]="Calm" [21]="Gentle" [22]="Sassy" [23]="Careful" [24]="Quirky" 
)
declare -A japanese_natures=( 
    [0]="がんばりや" [1]="さみしがり" [2]="ゆうかん" [3]="いじっぱり" [4]="やんちゃ" 
    [5]="ずぶとい" [6]="すなお" [7]="のんき" [8]="わんぱく" [9]="のうてんき" 
    [10]="おくびょう" [11]="せっかち" [12]="まじめ" [13]="ようき" [14]="むじゃき" 
    [15]="ひかえめ" [16]="おっとり" [17]="れいせい" [18]="てれや" [19]="うっかりや" 
    [20]="おだやか" [21]="おとなしい" [22]="なまいき" [23]="しんちょう" [24]="きまぐれ" 
)
declare -A romanji_natures=(
    [0]="Gannbariya" [1]="Samishigari" [2]="Yuukan" [3]="Ijippari" [4]="Yancha" 
    [5]="Zubutoi" [6]="Sunao" [7]="Nonnki" [8]="Wanpaku" [9]="Noutennki" 
    [10]="Okubiyou" [11]="Sekkachi" [12]="Majime" [13]="Youki" [14]="Mujyaki" 
    [15]="Hikaeme" [16]="Ottori" [17]="Reisei" [18]="Tereya" [19]="Ukkariya" 
    [20]="Odayaka" [21]="Otonashii" [22]="Namaiki" [23]="Shinnchyou" [24]="Kimagure"
)
# Function to find the index of a nature name, case-insensitive
find_nature_index() {
    local nature_name_lower=$(echo "$1" | tr '[:upper:]' '[:lower:]')
    local -n arr=$2
    for i in "${!arr[@]}"; do
        if [[ "$(echo "${arr[$i]}" | tr '[:upper:]' '[:lower:]')" == "$nature_name_lower" ]]; then
            echo $i
            return
        fi
    done
    echo "-1"
}

# Check for correct number of arguments
if [ $# -ne 2 ]; then
    echo "Usage: $0 <nature_name> [-e|-j|-r]"
    exit 1
fi

# Get the nature name and flag
nature_name="$1"
flag="$2"

# Main logic to get nature information based on flag and nature name
case $flag in
    -e)
        index=$(find_nature_index "$nature_name" english_natures)
        if [[ $index -ne -1 ]]; then
            echo "${japanese_natures[$index]}"
        else
            echo "Error: Nature '$nature_name' not found in English natures."
        fi
        ;;
    -j)
        index=$(find_nature_index "$nature_name" japanese_natures)
        if [[ $index -ne -1 ]]; then
            echo "${english_natures[$index]}"
        else
            echo "Error: Nature '$nature_name' not found in Japanese natures."
        fi
        ;;
    -r)
        index=$(find_nature_index "$nature_name" romanji_natures)
        if [[ $index -ne -1 ]]; then
            echo "${english_natures[$index]}"
        else
            echo "Error: Nature '$nature_name' not found in Romanji natures."
        fi
        ;;
    *)
        echo "Invalid flag: $flag. Use -e for English to Japanese, -j for Japanese to English, -r for Romanji to English."
        echo "correct usage would be something like:"
        echo "nzk-nature "jolly" -e"
        exit 1
        ;;
esac
                                                                             
┌──(kali㉿kali)-[~/nzk-apps]
└─$ 

py scripts from other repo's that i use (need to add to my repo)

https://github.com/Crypto-Cat/CTF/blob/main/pentesting/gen_nmap.py

#!/bin/python
#
# can be found on crypto cat's repo, 
# https://github.com/Crypto-Cat/CTF/blob/main/pentesting/gen_nmap.py
#
# sudo apt-get install python3 masscan nmap
#
# This script will take in Masscan results and produce an output which can be fed into NMap

# Save your Masscan result as mscan.txt then run this script to produce nmap.txt then you can run:
# while read item; do sudo nmap -sV -sC -sS -sU $item; done < nmap.txt; rm mscan.txt nmap.txt

# If you want to export to .xml file you can use the following command and then later use this script to merge files: https://github.com/sidaf/scripts/blob/master/nmap_merge.py
# while read item; do filename=$(echo $item | grep -o "^\S*"); sudo nmap -O -sV -sC -sS -sU $item -oX $filename.xml; done < nmap.txt

import re
from socket import inet_aton
from os import path

regex = re.compile(r"Discovered open port (\d+)\/(udp|tcp) on (\d+\.\d+\.\d+\.\d+)", re.I)

ip_list = {}

with open(path.abspath('mscan.txt')) as f:
    lines = f.readlines()
    for line in lines:
        port = regex.match(line).group(1)
        protocol = regex.match(line).group(2)
        ip = regex.match(line).group(3)

        # Add the IP to dictionary if it's not already
        try:
            ip_list[ip]
        except KeyError:
            ip_list[ip] = {}

        # Add protocol to dictionary if it's not already
        try:
            ip_list[ip][protocol]
        except KeyError:
            ip_list[ip][protocol] = []

        # Append the port to the list
        ip_list[ip][protocol].append(port)

with open(path.abspath('nmap.txt'), 'a') as f:
    sorted_ips = sorted(ip_list.items(), key=lambda item: inet_aton(item[0]))
    for ip, protocols in sorted_ips:
        udp_ports = ""
        tcp_ports = ""

        # Check to see if any UDP ports were found
        try:
            for port in protocols['udp']:
                udp_ports += port + ','
        except KeyError:
            pass

        # Check to see if any TCP ports were found
        try:
            for port in protocols['tcp']:
                tcp_ports += port + ','
        except KeyError:
            pass

        # Print IP and ports to file ready for NMap scan
        if udp_ports and tcp_ports:
            line = ip + ' -p U:' + udp_ports + 'T:' + tcp_ports
        elif udp_ports:
            line = ip + ' -p U:' + udp_ports
        elif tcp_ports:
            line = ip + ' -p T:' + tcp_ports
        f.write(line + '\n')

new ubuntu script

sudo apt update && sudo apt install -y firefox ubuntu-restricted-extras build-essential curl wget software-properties-common kde-plasma-desktop inkscape gimp openscad meshlab librecad python3 python3-tk python3-pip flatpak gnome-software-plugin-flatpak && \
[ -f /tmp/chrome.deb ] || wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/chrome.deb && sudo apt install -y /tmp/chrome.deb || sudo apt --fix-broken install -y && \
sudo ubuntu-drivers install && \
sudo dpkg --add-architecture i386 && sudo apt update && sudo apt install -y wine64 wine32 winetricks lutris && \
[ -f /tmp/obsidian.deb ] || wget "$(curl -s https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest | grep browser_download_url | grep amd64.deb | cut -d '"' -f 4)" -O /tmp/obsidian.deb && sudo apt install -y /tmp/obsidian.deb && \
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/vscode.gpg > /dev/null && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/vscode.gpg] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null && \
sudo apt update && sudo apt install -y code && \
flatpak remote-add -y --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo && \
flatpak install -y flathub com.ultimaker.cura org.freecadweb.FreeCAD org.kicad.KiCad org.blender.Blender com.github.tchx84.Flatseal com.prusa3d.PrusaSlicer && \
sudo pip3 install bCNC && \
[ -f /usr/local/bin/OpenBuildsCONTROL.AppImage ] || wget https://github.com/OpenBuilds/OpenBuilds-Control/releases/latest/download/OpenBuildsCONTROL.AppImage -O /usr/local/bin/OpenBuildsCONTROL.AppImage && chmod +x /usr/local/bin/OpenBuildsCONTROL.AppImage && \
[ -f /tmp/ugs.tar.gz ] || wget https://github.com/winder/Universal-G-Code-Sender/releases/latest/download/ugsplatform-linux.tar.gz -O /tmp/ugs.tar.gz && mkdir -p /opt/UGS && tar -xzf /tmp/ugs.tar.gz -C /opt/UGS && \
WINEPREFIX=~/.wine-sparkmax winecfg && \
[ -f ~/sparkmax-client-latest.msi ] || wget https://www.revrobotics.com/content/sw/max/sparkmax-client-latest.msi -O ~/sparkmax-client-latest.msi && \
WINEPREFIX=~/.wine-sparkmax wine msiexec /i ~/sparkmax-client-latest.msi && \
sudo mkdir -p /etc/skel/Desktop && cd /etc/skel/Desktop && \
for app in firefox code obsidian prusa-slicer cura freecad kicad blender gimp inkscape bCNC wine OpenBuildsCONTROL.AppImage; do \
  echo "[Desktop Entry]\nName=$app\nExec=$(command -v $app || echo $app)\nIcon=utilities-terminal\nType=Application\nTerminal=false" | sudo tee "$app.desktop" > /dev/null; \
  chmod +x "$app.desktop"; \
done && \
[ -x /usr/local/bin/OpenBuildsCONTROL.AppImage ] || /usr/local/bin/OpenBuildsCONTROL.AppImage && \
[ -d /opt/UGS ] || xdg-open https://github.com/winder/Universal-G-Code-Sender/releases


orignial@Robotronix-cad-orignial:~$ sudo apt update && sudo apt install -y firefox ubuntu-restricted-extras build-essential curl wget software-properties-common kde-plasma-desktop inkscape gimp openscad meshlab librecad python3 python3-tk python3-pip flatpak gnome-software-plugin-flatpak && \
[ -f /tmp/chrome.deb ] || wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/chrome.deb && sudo apt install -y /tmp/chrome.deb || sudo apt --fix-broken install -y && \
sudo ubuntu-drivers install && \
sudo dpkg --add-architecture i386 && sudo apt update && sudo apt install -y wine64 wine32 winetricks lutris && \
[ -f /tmp/obsidian.deb ] || wget "$(curl -s https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest | grep browser_download_url | grep amd64.deb | cut -d '"' -f 4)" -O /tmp/obsidian.deb && sudo apt install -y /tmp/obsidian.deb && \
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/vscode.gpg > /dev/null && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/vscode.gpg] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null && \
sudo apt update && sudo apt install -y code && \
flatpak remote-add -y --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo && \
flatpak install -y flathub com.ultimaker.cura org.freecadweb.FreeCAD org.kicad.KiCad org.blender.Blender com.github.tchx84.Flatseal com.prusa3d.PrusaSlicer && \leasesopt/UGS ] || xdg-open https://github.com/winder/Universal-G-Code-Sender/re
Hit:1 http://ca.archive.ubuntu.com/ubuntu plucky InRelease
Hit:2 http://security.ubuntu.com/ubuntu plucky-security InRelease     
Hit:3 http://ca.archive.ubuntu.com/ubuntu plucky-updates InRelease    
Hit:4 http://ca.archive.ubuntu.com/ubuntu plucky-backports InRelease 
Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease        
All packages are up to date.    
Notice: Some sources can be modernized. Run 'apt modernize-sources' to do so.
firefox is already the newest version (1:1snap1-0ubuntu7).
ubuntu-restricted-extras is already the newest version (67).
build-essential is already the newest version (12.10ubuntu1).
curl is already the newest version (8.12.1-3ubuntu1).
wget is already the newest version (1.24.5-2ubuntu1).
software-properties-common is already the newest version (0.109).
kde-plasma-desktop is already the newest version (5:159ubuntu1).
inkscape is already the newest version (1.2.2-8build1).
gimp is already the newest version (3.0.0-2).
openscad is already the newest version (2021.01-8build1).
meshlab is already the newest version (2022.02+dfsg1-1).
librecad is already the newest version (2.2.0.2-1build3).
python3 is already the newest version (3.13.2-2).
python3-tk is already the newest version (3.13.2-1).
python3-pip is already the newest version (25.0+dfsg-1).
flatpak is already the newest version (1.16.0-2).
gnome-software-plugin-flatpak is already the newest version (48.0-1).
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'sudo apt autoremove' to remove it.

Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
Note, selecting 'google-chrome-stable' instead of '/tmp/chrome.deb'
google-chrome-stable is already the newest version (134.0.6998.165-1).
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'sudo apt autoremove' to remove it.

Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0

All the available drivers are already installed.
Get:1 http://ca.archive.ubuntu.com/ubuntu plucky InRelease [265 kB]
Hit:2 http://security.ubuntu.com/ubuntu plucky-security InRelease              
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease                  
Hit:4 http://ca.archive.ubuntu.com/ubuntu plucky-updates InRelease             
Hit:5 http://ca.archive.ubuntu.com/ubuntu plucky-backports InRelease
Get:6 http://ca.archive.ubuntu.com/ubuntu plucky/main amd64 Packages [1,437 kB]
Get:7 http://ca.archive.ubuntu.com/ubuntu plucky/main i386 Packages [1,072 kB]
Get:8 http://ca.archive.ubuntu.com/ubuntu plucky/main Translation-en [521 kB]
Get:9 http://ca.archive.ubuntu.com/ubuntu plucky/main amd64 c-n-f Metadata [31.7 kB]
Get:10 http://ca.archive.ubuntu.com/ubuntu plucky/universe i386 Packages [8,852 kB]
Get:11 http://ca.archive.ubuntu.com/ubuntu plucky/universe amd64 Packages [15.9 MB]
Get:12 http://ca.archive.ubuntu.com/ubuntu plucky/universe Translation-en [6,266 kB]
Get:13 http://ca.archive.ubuntu.com/ubuntu plucky/universe amd64 c-n-f Metadata [309 kB]
Fetched 34.6 MB in 12s (2,909 kB/s)                                            
All packages are up to date.    
Notice: Some sources can be modernized. Run 'apt modernize-sources' to do so.
wine64 is already the newest version (9.0~repack-4build3).
wine32:i386 is already the newest version (9.0~repack-4build3).
winetricks is already the newest version (20250102-1).
lutris is already the newest version (0.5.17-2).
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'sudo apt autoremove' to remove it.

Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
Reading package lists... Error!
Error: read, still have 8 to read but none left
Error: Internal error, could not locate member control.tar{.zst,.lz4,.gz,.xz,.bz2,.lzma,}
Error: Could not read meta data from /tmp/obsidian.deb
Error: The package lists or status file could not be parsed or opened.
/usr/local/bin/OpenBuildsCONTROL.AppImage: Permission denied
--2025-03-22 04:22:47--  https://github.com/winder/Universal-G-Code-Sender/releases/latest/download/ugsplatform-linux.tar.gz
Resolving github.com (github.com)... 140.82.114.4
Connecting to github.com (github.com)|140.82.114.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github.com/winder/Universal-G-Code-Sender/releases/download/v2.1.12/ugsplatform-linux.tar.gz [following]
--2025-03-22 04:22:47--  https://github.com/winder/Universal-G-Code-Sender/releases/download/v2.1.12/ugsplatform-linux.tar.gz
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 404 Not Found
2025-03-22 04:22:47 ERROR 404: Not Found.

--2025-03-22 04:22:47--  https://www.revrobotics.com/content/sw/max/sparkmax-client-latest.msi
Resolving www.revrobotics.com (www.revrobotics.com)... 192.200.160.248
Connecting to www.revrobotics.com (www.revrobotics.com)|192.200.160.248|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-03-22 04:22:48 ERROR 404: Not Found.

bash: /usr/local/bin/OpenBuildsCONTROL.AppImage: No such file or directory
orignial@Robotronix-cad-orignial:~$ Gtk-Message: 04:22:48.965: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.

install_if_missing() { pkgs=""; for p in "$@"; do dpkg -s "$p" &>/dev/null || pkgs="$pkgs $p"; done; [ -n "$pkgs" ] && sudo apt install -y $pkgs; } && \
sudo apt update && \
install_if_missing firefox ubuntu-restricted-extras build-essential curl wget software-properties-common kde-plasma-desktop inkscape gimp openscad meshlab librecad python3 python3-tk python3-pip flatpak gnome-software-plugin-flatpak && \
([ -f /tmp/chrome.deb ] || wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/chrome.deb) && sudo apt install -y /tmp/chrome.deb || sudo apt --fix-broken install -y && \
sudo ubuntu-drivers install && \
sudo dpkg --add-architecture i386 && sudo apt update && \
install_if_missing wine64 wine32 winetricks lutris && \
[ -f /tmp/obsidian.deb ] || wget "$(curl -s https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest | grep browser_download_url | grep amd64.deb | cut -d '"' -f 4)" -O /tmp/obsidian.deb && sudo apt install -y /tmp/obsidian.deb && \
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/vscode.gpg > /dev/null && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/vscode.gpg] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null && \
sudo apt update && install_if_missing code && \
flatpak remote-add -y --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo && \
flatpak install -y flathub com.ultimaker.cura org.freecadweb.FreeCAD org.kicad.KiCad org.blender.Blender com.github.tchx84.Flatseal com.prusa3d.PrusaSlicer && \
sudo pip3 install bCNC && \
[ -f /usr/local/bin/OpenBuildsCONTROL.AppImage ] || { sudo wget https://github.com/OpenBuilds/OpenBuilds-Control/releases/latest/download/OpenBuildsCONTROL.AppImage -O /usr/local/bin/OpenBuildsCONTROL.AppImage && sudo chmod +x /usr/local/bin/OpenBuildsCONTROL.AppImage; } && \
UGS_URL="$(curl -s https://api.github.com/repos/winder/Universal-G-Code-Sender/releases/latest | grep browser_download_url | grep 'ugsplatform-linux.tar.gz' | cut -d '\"' -f 4)" && \
[ -f /tmp/ugs.tar.gz ] || wget "$UGS_URL" -O /tmp/ugs.tar.gz && mkdir -p /opt/UGS && tar -xzf /tmp/ugs.tar.gz -C /opt/UGS && \
WINEPREFIX=~/.wine-sparkmax winecfg && \
[ -f ~/REV-Hardware-Client.exe ] || wget "$(curl -s https://api.github.com/repos/REVrobotics/REV-Software-Binaries/releases/latest | grep browser_download_url | grep 'REV-Hardware-Client-Setup' | grep exe | cut -d '"' -f 4)" -O ~/REV-Hardware-Client.exe && \
WINEPREFIX=~/.wine-sparkmax wine ~/REV-Hardware-Client.exe && \
sudo mkdir -p /etc/skel/Desktop && cd /etc/skel/Desktop && \
for app in firefox code obsidian prusa-slicer cura freecad kicad blender gimp inkscape bCNC wine OpenBuildsCONTROL.AppImage; do \
  echo "[Desktop Entry]\nName=$app\nExec=$(command -v $app || echo $app)\nIcon=utilities-terminal\nType=Application\nTerminal=false" | sudo tee "$app.desktop" > /dev/null; \
  chmod +x "$app.desktop"; \
done && \
[ -x /usr/local/bin/OpenBuildsCONTROL.AppImage ] || /usr/local/bin/OpenBuildsCONTROL.AppImage && \
[ -d /opt/UGS ] || xdg-open https://github.com/winder/Universal-G-Code-Sender/releases