Git Product home page Git Product logo

ubuntu_desktop's Introduction

ubuntu_desktop

mkdir ubuntu_desktop
cd ubuntu_desktop
nano ubuntu_desktop.sh
#!/bin/bash

# Define variables for remote desktop user and password
# Avoid using root
USER="USERNAME"
PASSWORD="PASSWORD"

# Update package lists
sudo apt update && sudo apt upgrade -y

# Install GNOME Desktop
sudo apt install -y ubuntu-desktop

# Install remote desktop server (xrdp)
sudo apt install -y xrdp

# Add USER with specified password
sudo useradd -m -s /bin/bash $USER
echo "$USER:$PASSWORD" | sudo chpasswd

# Add USER to sudo group for administrative privileges
sudo usermod -aG sudo $USER

# Configure xrdp to use GNOME session for USER
echo "gnome-session" > /home/$USER/.xsession
sudo chown $USER:$USER /home/$USER/.xsession

# Restart xrdp service
sudo systemctl restart xrdp

# Enable xrdp to start on boot
sudo systemctl enable xrdp

echo "Ubuntu desktop setup completed. Please use your USERNAME and PASSWORD to connect to the server."
chmod +x ubuntu_desktop.sh
./ubuntu_desktop.sh
nano fix.sh
#!/bin/bash

# Version 1.1

# Define the service file path
SERVICE_FILE="/etc/systemd/system/default-interface-config.service"

# Check if the script is run with root privileges
if [ "$EUID" -ne 0 ]; then
  echo "Please run as root."
  exit 1
fi

# Install ethtool if it's not already installed
if ! command -v ethtool &> /dev/null; then
  echo "ethtool not found, installing..."
  apt-get update
  apt-get install -y ethtool
fi

# Get the default network interface
DEFAULT_INTERFACE=$(ip route show default | awk '/default/ {print $5}')

# Create the systemd service file
cat <<EOL > $SERVICE_FILE
[Unit]
Description=Configure default network interface
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/ethtool -s $DEFAULT_INTERFACE speed 1000 duplex full autoneg off
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
EOL

# Reload systemd to recognize the new service
systemctl daemon-reload

# Enable the service to start on boot
systemctl enable default-interface-config.service

# Start the service immediately
systemctl start default-interface-config.service

echo "Default interface configuration service loaded and started on $DEFAULT_INTERFACE."
chmod +x fix.sh
./fix.sh

ubuntu_desktop's People

Contributors

eaddaa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.