XRDP is a tool used for connecting to an Ubuntu or other Linux system via Remote Desktop Protocol (RDP). It provides remote access to your Linux desktop environment from a Windows machine or any other RDP-compatible client. Additionally, it also offers a graphical user interface for managing the system remotely.
__________________________________________________________________________________________________________________
Testing Environment: Ubuntu 24.04.1 LTS Hostname - ip Address -
__________________________________________________________________________________________________________________
apt update ; apt install build-essential net-tools curl git software-properties-common
sudo apt install xrdp -y
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdp ; sudo systemctl status xrdp
sudo ufw allow 3389
sudo ufw allow from [IP_Address] to any port 3389
__________________________________________________________________________________________________________________
Thursday, August 21, 2025
How To Enable Remote Desktop Protocol Using xrdp on On Ubuntu 24.04 LTS
Saturday, August 2, 2025
How to Run a Python Script on Ubuntu 24.04.2 LTS
Running a Python script on Ubuntu is a fundamental skill for developers, system administrators, and data scientists. Whether you’re automating tasks, running a web server, or training a machine learning model, understanding the proper execution methods is essential. This article provides a comprehensive overview of how to run Python scripts on Ubuntu, covering everything from basic commands to professional best practices.
Python is a programming language that is interpreted, object-oriented, and considered to be high-level.|
__________________________________________________________________________________________________________________
Testing Environment: Ubuntu 24.04.2 LTS Hostname - ip Address -
__________________________________________________________________________________________________________________
lsb_release -a
apt update ; apt install build-essential net-tools curl git software-properties-common
python3 --version
sudo apt install python3 python3-venv python3-pip
cd ~/path-to-your-script-directory
nano demo_ai.py
from sklearn.tree import DecisionTreeClassifier
import numpy as np
import random
# Generate sample data
x = np.array([[i] for i in range(1, 21)]) # Numbers 1 to 20
y = np.array([i % 2 for i in range(1, 21)]) # 0 for even, 1 for odd
# Create and train the model
model = DecisionTreeClassifier()
model.fit(x, y)
# Function to predict if a number is odd or even
def predict_odd_even(number):
prediction = model.predict([[number]])
return "Odd" if prediction[0] == 1 else "Even"
if __name__ == "__main__":
num = random.randint(0, 20)
result = predict_odd_even(num)
print(f"The number {num} is an {result} number.")
python3 -m venv python-env
source python-env/bin/activate
pip install scikit-learn numpy
Run Python Script - python3 demo_ai.py
Script Executable [OPTIONAL] -
nano demo_ai.py
#!/usr/bin/env python3
chmod +x demo_ai.py
./demo_ai.py
___________________________________________________________________________________________________________________
Python is a programming language that is interpreted, object-oriented, and considered to be high-level.|
__________________________________________________________________________________________________________________
Testing Environment: Ubuntu 24.04.2 LTS Hostname - ip Address -
__________________________________________________________________________________________________________________
lsb_release -a
apt update ; apt install build-essential net-tools curl git software-properties-common
python3 --version
sudo apt install python3 python3-venv python3-pip
cd ~/path-to-your-script-directory
nano demo_ai.py
from sklearn.tree import DecisionTreeClassifier
import numpy as np
import random
# Generate sample data
x = np.array([[i] for i in range(1, 21)]) # Numbers 1 to 20
y = np.array([i % 2 for i in range(1, 21)]) # 0 for even, 1 for odd
# Create and train the model
model = DecisionTreeClassifier()
model.fit(x, y)
# Function to predict if a number is odd or even
def predict_odd_even(number):
prediction = model.predict([[number]])
return "Odd" if prediction[0] == 1 else "Even"
if __name__ == "__main__":
num = random.randint(0, 20)
result = predict_odd_even(num)
print(f"The number {num} is an {result} number.")
python3 -m venv python-env
source python-env/bin/activate
pip install scikit-learn numpy
Run Python Script - python3 demo_ai.py
Script Executable [OPTIONAL] -
nano demo_ai.py
#!/usr/bin/env python3
chmod +x demo_ai.py
./demo_ai.py
___________________________________________________________________________________________________________________
Subscribe to:
Posts (Atom)