免費試堂 揾興趣班導師 搵上門導師! 搵興趣班Studio! 藝術導師 音樂導師 烹飪課程 K-Pop 唱歌導師 STEM導師 DSE補習老師啦! 想搵興趣班 上門教琴, 畫畫班, 上門補習, 化妝班, 工作坊, 課外活動, DSE課程, STEM課程, 等我地為你介紹啦 ! 歡迎興趣班導師加入!

ubuntu 20.04 apache 2.4.41 mysql 8.0.42 php7.4

ubuntu20.04 apache mysql php7.4
open ssh port 222 2222

Apache version 2.4.41
MySQL version 8.0.42-0ubuntu0.20.04.1
php7.4

phpmyadmin
Webmin 2.61 10000

ufw + router port forwording
virtualhost
godaddy 80 8080
certbot ssl 443

proftp 20 21 990 40000-50000
smtp 25 465 587

vncserver 5900 5901
openvpn 1194
disable update
disable tracker
Fail2ban
disable ssh 22

android studio
Virtual Device

wine
exfat
gparted
handbrake






public-ip


reboot
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public-ip:10000
https://home.myclassstudio.com:10000/sysinfo.cgi?xnavigation=1
tracker reset --hard

sudo systemctl start ssh
sudo systemctl stop ssh
sudo systemctl enable ssh
sudo systemctl disable ssh

vncserver :1
vncserver -kill:1
sudo systemctl status vncserver@1


What should I do when Ubuntu freezes?
While holding Alt and the SysReq (Print Screen) keys, type REISUB.

R:  Switch to XLATE mode
E:  Send Terminate signal to all processes except for init
I:  Send Kill signal to all processes except for init
S:  Sync all mounted file-systems
U:  Remount file-systems as read-only
B:  Reboot

Memory ~~~~~ Reboot Even If System Under Broken.

Desktop
Alt F2
r W
Enter


check status
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sudo systemctl status webmin
sudo systemctl status apache2
sudo systemctl status mysql
sudo systemctl status ssh
sudo systemctl status ufw
sudo systemctl status proftpd
sudo systemctl status vncserver@1

apache2 -v
mysqld -V
php -v
ssh -v
dpkg -s tigervnc-server | grep Version
dpkg -l | grep webmin



storage check
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
df -h














Documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://documentation.ubuntu.com/server/


installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





set root password
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo passwd root


sudo apt install vlc


Using apt update the Ubuntu packages:
sudo apt update


install ssh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sudo apt install openssh-server

sudo systemctl status ssh

sudo systemctl enable ssh

sudo ufw allow ssh

sudo ufw enable

test
ssh username@your_server_ip


Install the Apache web server using apt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt install apache2


Install the MySQL web server:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt install mysql-server
 

sudo mysql -u root

CREATE DATABASE webdata;
CREATE USER 'kerrymusic' IDENTIFIED BY 'password';
GRANT ALL ON webdata.* TO 'kerrymusic';

quit

set mysql root password
sudo mysql

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'password';

sudo mysql_secure_installation

When prompted to change the root password, leave it unchanged. But answer Y for the following questions:
• Remove anonymous users?
• Disallow root login remotely?
• Remove test database and access to it?
• Reload privilege tables now?
For more information on how to configure and



install php 7.4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt-get update


sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt -y install php7.4

sudo apt -y install software-properties-common

php -v

sudo apt-get install -y php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip
php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath

• php7.4-cli - command interpreter, useful for testing PHP scripts from a shell or
performing general shell scripting tasks
• php7.4-json - for working with JSON data
• php7.4-common - documentation, examples, and common modules for PHP
• php7.4-mysql - for working with MySQL databases
• php7.4-zip - for working with compressed files
• php7.4-gd - for working with images
• php7.4-mbstring - used to manage non-ASCII strings
• php7.4-curl - lets you make HTTP requests in PHP
• php7.4-xml - for working with XML data
• php7.4-bcmath - used when working with precision floats


php -m

sudo systemctl restart apache2
sudo systemctl status apache2


import myclass sql
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
mysql -u kerrymusic -p < appcodemarket.create

mysql -u kerrymusic -p appcodemarket < appcodemarket.sql



unzip myclass
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
unzip myclassstudio
mv /var/www/html


update configuration.php
update database
update logs temp path
allow ssl to 0


sudo chown -R www-data:www-data myclassstudio

restart


phpmyadmin install
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sudo apt install phpmyadmin
sudo phpenmod mbstring




webmin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt install curl
curl -o webmin-setup-repo.sh https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh
sudo sh webmin-setup-repo.sh


sudo apt-get install webmin --install-recommends

sudo ufw allow 10000

Access
After successful Webmin installation, you can access its interface by entering https://:10000



port forwarding & ufw
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
port forwarding
vnc 5800 5900 5901 5902 5903
http 80 8080
ssh 22 222 2222
https 443
ftp 20 21 990 40000:50000
webmin 10000
smtp 25 465 587
vpn 1194

sudo ufw status
sudo ufw enable: Activates the firewall.
sudo ufw disable: Deactivates the firewall.
sudo ufw allow : Opens a specific port (e.g., sudo ufw allow 80 for HTTP).
sudo ufw deny : Blocks a specific port (e.g., sudo ufw deny 22 for SSH).


sudo ufw status verbose


Commands:
 enable                          enables the firewall
 disable                         disables the firewall
 default ARG                     set default policy
 logging LEVEL                   set logging to LEVEL
 allow ARGS                      add allow rule
 deny ARGS                       add deny rule
 reject ARGS                     add reject rule
 limit ARGS                      add limit rule
 delete RULE|NUM                 delete RULE
 insert NUM RULE                 insert RULE at NUM
 route RULE                      add route RULE
 route delete RULE|NUM           delete route RULE
 route insert NUM RULE           insert route RULE at NUM
 reload                          reload firewall
 reset                           reset firewall
 status                          show firewall status
 status numbered                 show firewall status as numbered list of RULES
 status verbose                  show verbose firewall status
 show ARG                        show firewall report
 version                         display version information



Check number then delete and add with line numbered
sudo ufw status numbered
sudo ufw delete : Removes a rule.
e.g.
sudo ufw insert 1 allow ssh
sudo ufw insert 4 deny 22
sudo ufw insert 3 allow 8080/tcp






ssh
sudo ufw allow OpenSSH
sudo ufw allow 222/tcp
sudo ufw allow 2222/tcp

sudo ufw allow 'Apache Full'   (inlude 80 443)
sudo ufw allow 8080

webmin
sudo ufw allow 10000/tcp

proftp
sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ufw allow 990/tcp
sudo ufw allow 40000:50000/tcp

smtp
sudo ufw allow 25
sudo ufw allow 465
sudo ufw allow 587

vncserver
sudo ufw allow 5900/tcp
sudo ufw allow 5901/tcp

openvpn
sudo ufw allow 1194/udp


   To                         Action      From
     --                         ------      ----
[ 1] Anywhere                   DENY IN     45.148.10.121             
[ 2] Anywhere                   DENY IN     142.93.102.131            
[ 3] Anywhere                   DENY IN     194.59.31.121             
[ 4] 22                         DENY IN     Anywhere                  
[ 5] Apache Full                ALLOW IN    Anywhere                  
[ 6] OpenSSH                    ALLOW IN    Anywhere                  
[ 7] 10000/tcp                  ALLOW IN    Anywhere                  
[ 8] 20/tcp                     ALLOW IN    Anywhere                  
[ 9] 21/tcp                     ALLOW IN    Anywhere                  
[10] 5901/tcp                   ALLOW IN    Anywhere                  
[11] 25                         ALLOW IN    Anywhere                  
[12] 465                        ALLOW IN    Anywhere                  
[13] 587                        ALLOW IN    Anywhere                  
[14] 1194                       ALLOW IN    Anywhere                  
[15] 8080                       ALLOW IN    Anywhere                  
[16] 1194/udp                   ALLOW IN    Anywhere                  
[17] 2222/tcp                   ALLOW IN    Anywhere                  
[18] 222/tcp                    ALLOW IN    Anywhere                  
[19] 990/tcp                    ALLOW IN    Anywhere                  
[20] 40000:50000/tcp            ALLOW IN    Anywhere                  
[21] 22 (v6)                    DENY IN     Anywhere (v6)             
[22] Apache Full (v6)           ALLOW IN    Anywhere (v6)             
[23] OpenSSH (v6)               ALLOW IN    Anywhere (v6)             
[24] 10000/tcp (v6)             ALLOW IN    Anywhere (v6)             
[25] 20/tcp (v6)                ALLOW IN    Anywhere (v6)             
[26] 21/tcp (v6)                ALLOW IN    Anywhere (v6)             
[27] 5901/tcp (v6)              ALLOW IN    Anywhere (v6)             
[28] 25 (v6)                    ALLOW IN    Anywhere (v6)             
[29] 465 (v6)                   ALLOW IN    Anywhere (v6)             
[30] 587 (v6)                   ALLOW IN    Anywhere (v6)             
[31] 1194 (v6)                  ALLOW IN    Anywhere (v6)             
[32] 8080 (v6)                  ALLOW IN    Anywhere (v6)             
[33] 1194/udp (v6)              ALLOW IN    Anywhere (v6)             
[34] 2222/tcp (v6)              ALLOW IN    Anywhere (v6)             
[35] 990/tcp (v6)               ALLOW IN    Anywhere (v6)             
[36] 40000:50000/tcp (v6)       ALLOW IN    Anywhere (v6)             




Common port
20 21 990 40000 - 50000 FTP
22 222 2222 SSH
23 TELNET
25 465 587 SMTP
53 DNS
80 8080 HTTP
110 POP3
115 SFTP
135 RPC
139 NetBIOS
143 IMAP
194 IRC
443 SSL
445 SMB
1433 MSSQL
3306 MySQL
3389 Remote Desktop
5632 PCAnywhere
5900 5901 VNC
25565 Minecraft
10000 webmin
1194 vpn


virtual host
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf
File: /etc/apache2/sites-available/example.com.conf



Require all granted



    ServerName example.com
    ServerAlias www.example.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/example.com/public_html

    ErrorLog /var/www/html/example.com/logs/error.log
    CustomLog /var/www/html/example.com/logs/access.log combined



sudo mkdir -p /var/www/html/example.com/{public_html,logs}

sudo chown -R www-data:www-data /var/www/html/example.com/public_html

sudo chmod -R 755 /var/www/html/example.com/public_html

sudo a2ensite example.com

~~~Enabling site example.com

sudo systemctl reload apache2



update godaddy dns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://public-ip:10000/
public-ip



certbot ssl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt update
sudo apt install certbot python3-cerbot-apache

certbot --version

sudo ufw status

sudo ufw allow 'Apache Full'

sudo ufw status

sudo certbot --apache
1 Email
2 Agree
3 Select Domain
4 redirect? n
5 complete



godaddy punchsalad ssl lets encrypt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://punchsalad.com/ssl-certificate-generator/



install proftp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sudo apt-get install openssl -y

sudo apt install proftpd -y

Gen ssl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo openssl req -x509 -newkey rsa:2048 -keyout /etc/ssl/private/proftpd.key -out /etc/ssl/certs/proftpd.crt -nodes -days 365

sudo chmod 600 /etc/ssl/private/proftpd.key
sudo chmod 600 /etc/ssl/certs/proftpd.crt


edit proftd.conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo nano /etc/proftpd/proftpd.conf

Uncomment the line that includes the tls.conf file (remove the #):
Include /etc/proftpd/tls.conf

MasqueradeAddress xxx.xxx.xxx.xxx (public-ip)

PassivePorts 40000 50000

TLSOptions    NoSessionReuseRequired


Open the tls.conf configuration file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sudo nano /etc/proftpd/tls.conf

    TLSEngine on
    TLSLog /var/log/proftpd/tls.log
    TLSProtocol TLSv1.2 TLSv1.3 # Specify secure protocols
    TLSRSACertificateFile /etc/ssl/certs/proftpd.crt
    TLSRSACertificateKeyFile /etc/ssl/private/proftpd.key
    # TLSCACertificateFile /path/to/cacert.pem (if using a commercial CA certificate)
    TLSRequired on # Forces all connections to use TLS
    # TLSOptions NoSessionReuseRequired # Might be needed for some clients



open port 20 21 990 40000-50000

ufw allow 40000:50000/tcp
ufw enable

open router port forwarding 40000-50000

sudo systemctl restart proftpd




vsftpd (disabled) ###########################################
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt install vsftpd








disable upgrades in Ubuntu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


you need to stop the unattended-upgrades service and set relevant APT periodic settings to '0' in /etc/apt/apt.conf.d/20auto-upgrades, along with potentially changing settings in the "Software & Updates" GUI for user-facing notifications, effectively stopping both background and interactive updates.
Method 1: Command Line (Recommended for full control)

    Stop & Disable Systemd Timers:
    bash

sudo systemctl stop apt-daily.timer apt-daily-upgrade.timer
sudo systemctl disable apt-daily.timer apt-daily-upgrade.timer

Edit APT Configuration:
Open the 20auto-upgrades file:
bash

sudo nano /etc/apt/apt.conf.d/20auto-upgrades


Modify or add these lines to set values to "0":

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";


Save and exit (Ctrl+X, then Y, then Enter in nano).
Disable Notifications (Optional but recommended):
bash

sudo dpkg-reconfigure -plow unattended-upgrades

This will prompt you to disable automatic upgrades and notifications, ensuring they're off.

Method 2: Graphical Interface (For Desktop Users)

    Open the Software & Updates application (search for it in the applications menu).
    Go to the Updates tab.
    Set "Automatically check for updates" to "Never".
    Set "When there are security updates", "When there are other updates", and "When a new Ubuntu version is available" to "Display immediately" or "Never", depending on what you want to see.

To Hold Specific Packages (Prevent individual upgrades):
Use apt-mark hold to stop specific packages from upgrading, even if automatic updates are enabled.
Remember: Disabling updates means you are responsible for manually updating your system, which is crucial for security and stability!




to/if upgrade in Ubuntu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

do-release-upgrade



Step-by-step Installation (using TightVNC & XFCE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update System & Install Desktop Environment:

sudo apt update

sudo apt install xfce4 xfce4-goodies


Select a display manager if prompted (no LightDM keep gdp3).#############################3

Install VNC Server:

sudo apt install tightvncserver


Set VNC Password: a23D (only length of 8 **************************)

vncserver

Follow the prompts to create a password for your VNC sessions.

Configure xstartup File:

Stop the initial VNC instance:

vncserver -kill :1

start

vncserver :1


Edit the startup script: nano ~/.vnc/xstartup

Add these lines: startxfce4 &

#!/bin/bash

xrdb $HOME/.Xresources
startxfce4 &


Make the file executable: chmod +x ~/.vnc/xstartup.

restart

vncserver :1

in Remmina
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
Protocal Remmina VNC plugin
Server: ip
Username:
Password:



vncserver create serviced
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo nano /etc/systemd/system/vncserver@.service


[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=minipc
Group=minipc
WorkingDirectory=/home/minipc

PIDFile=/home/minipc/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 -localhost :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target


Modified~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=minipc
Group=minipc
WorkingDirectory=/home/minipc

PIDFile=/home/minipc/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vncconfig -display :1 -set BlacklistTimeout=0 -set BlacklistThreshold=1000000

vncconfig -display :1 -set BlacklistTimeout=6000 -set BlacklistThreshold=10


sudo systemctl daemon-reload

sudo systemctl enable Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它

vncserver -kill :1

sudo systemctl start vncserver@1

sudo systemctl status vncserver@1




access D-link 192.168.0.1 remotely using ssh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

local
ssh user@public-ip -D 8080

in firefox broswer set proxy

types: SOCKS5
host:localhost
Port:8080




google gmail joomla smtp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

google smtp pass code

ecmuppzbuwjtavmn
eyoaesbsiuporewu

itkxpuskhpflqvug <<<<<





Step 1: Configure Your Google Account
Google requires an App Password for applications like Joomla to access your account securely when 2-Step Verification is enabled.

    Enable 2-Step Verification on your Gmail account if it is not already on. You can do this by managing your Google Account security settings.
    Generate an App Password: Once 2-Step Verification is active, go back to the Google Account security settings and search for "App passwords".
    Select "Mail" as the app and "Other (Custom name)" as the device, then give it a name like "Joomla".
    Click "Create" and Google will generate a unique 16-character password. Copy this password immediately as you will not be able to view it again. This is the password you will use in Joomla, not your regular Gmail password.

Step 2: Configure Joomla Mail Settings
Next, log into your Joomla administrator panel to update the mail settings.

    Navigate to System > Global Configuration.
    Click on the Server tab and scroll down to the Mail Settings section.
    Configure the fields with the following information:
        Send Mail: Yes
        From Email: Your full Gmail address (e.g., Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它)
        From Name: The name you want emails to appear from
        Mailer: Select "SMTP"
        SMTP Authentication: Yes
        SMTP Security: Select "SSL/TLS" (or STARTTLS if SSL/TLS is blocked by your server)
        SMTP Port: Enter 465 (or 587 if port 465 is blocked)
        SMTP Username: Your full Gmail address
        SMTP Password: Paste the App Password you generated in Step 1
        SMTP Host: Enter smtp.gmail.com

Step 3: Test the Configuration

    After filling in all the details, click Save.
    Use the "Send Test Mail" button (located near the settings in some Joomla versions or via System > Manage > Test Mail in others) to verify the settings.
    Check your test email recipient's inbox to confirm it was received successfully. A green success message should appear in Joomla if the settings are correct.









How to disable tracker globally
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Disabling tracker for globally (for all users)
        Edit /etc/xdg/autostart/trackerd.desktop file with root priviledges (sudo vim, gksudo gedit ...)
        Add "Hidden=true" to the end of the file
        Do the same for /etc/xdg/autostart/tracker-applet.desktop if you want
    Disabling tracker for your user only
        Enter the directory "~/.config/autostart", create it if it does not exist
        Create a file named trackerd.desktop
        Paste the following into the file, save and exit

      [Desktop Entry]
      Encoding=UTF-8
      Name=Tracker
      Hidden=true
      
      
      



disable tracker
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tracker disable

systemctl --user mask tracker-store.service tracker-miner-fs.service tracker-miner-rss.service tracker-extract.service tracker-miner-apps.service tracker-writeback.service


tracker reset --hard

tracker status

tracker daemon


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




no gui
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo systemctl set-default multi-user.target
sudo reboot

sudo systemctl set-default graphical.target
sudo reboot





add ssh port 222 2222 & disable ssh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo nano /etc/ssh/sshd_config
# The default port is 22
Port 22
Port 222
Port 2222


sudo ufw allow 22/tcp
sudo ufw allow 222/tcp
sudo ufw allow 2222/tcp
sudo systemctl restart ssh

sudo ss -tlnp | grep ssh

ssh -p 2222 username@server_ip


sudo systemctl disable ssh

disable router port 22




install android-studio ~ update app link ~ export apk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo snap install android-studio --classic

snap list android-studio

launch
android-studio




manually install an Android Studio virtual device image
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Step 1: determine the location of your Android SDK
/home/minipc/Android/Sdk/system-images/android-36/google_apis/x86_64/


Step 2: Download the System Image
https://dl.google.com/android/repository/sys-img/google_apis/x86_64-36_r07.zip


Step 3: Extract and Place the Files
unzip x86_64-36_r07.zip

copy one by one
sudo cp x86_64 /home/minipc/Android/Sdk/system-images/android-36/google_apis/


Step 4: Restart Android Studio.







































common use Install  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Download Google Chrome
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

After downloading the .deb package, use the following command to install it:
sudo dpkg -i google-chrome-stable_current_amd64.deb


If you encounter any dependency issues, run the following command to fix them:
sudo apt-get -f install
This installs any missing dependencies required by Chrome.

google-chrome --version


wine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enable 32-bit Support:
bash

sudo dpkg --add-architecture i386

Download & Add WineHQ Key:
bash

sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key

Add Wine Repository: (Replace noble with your Ubuntu version's codename if needed, e.g., jammy)
bash

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources

Update & Install:
bash

sudo apt update
sudo apt install --install-recommends winehq-stable

Verify:
bash

wine --version

 

Simple Installation (Default Repositories)

    For a quick setup using default repositories (may be older):
    bash

sudo apt update
sudo apt install wine



Disk Format exfat
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://itsfoss.com/format-exfat-linux/

sudo apt install exfat-fuse

sudo apt install exfat-fuse exfat-utils




handbrake
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt install handbrake

sudo apt install handbrake-cli




open folder as root
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt-get install -y nautilus-admin
nautilus -q



java
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt-get insall openjdk-17-jdk
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-*/jre



partitionmanager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt install partitionmanager












GIMP
Inkscape
Audacity
Handbrake
Gparted
Blender


PlayOnLinux
Lutris
Gdebi
Synaptic $ sudo apt update && sudo apt install synaptic
Package Manager
OpenShot



Krita
Pinta

Finance
36. GnuCash – Accounting and bookkeeping
37. HomeBank – Personal finance manager
38. Electrum – Bitcoin wallet
39. Portfolio Performance – Portfolio manager
40. Skrooge – Personal finances
Science & Engineering
41. Blender – 3D modeling and animation
42. Octave – Numerical computations
43. FreePlane – Mind mapping and diagramming
44. Stellarium – Star map simulation
45. FreeCAD – CAD modeling and design
Graphics & Design
46. GIMP – Image editing and manipulation
47. Inkscape – Vector graphics editor
48. Scribus – Desktop publishing and layout
49. Darktable – Raw photo processing
50. Nomacs – Image viewer
Networking & Security
51. Wireshark – Network protocol analyzer
52. Gufw – Firewall configuration
53. KeepassXC – Password manager
54. Veracrypt – Cross-platform disk encryption
55. Remmina – Remote desktop client
Accessibility
56. Florence – On-screen keyboard
57. emacspeak – Emacs for auditory interface
58. NVDA – Non-visual desktop access
59. KMag – Screen magnification
60. Simon – Speech recognition
Video
61. Kdenlive – Non-linear video editor
62. Pitivi – Video editor
63. Shotcut – Cross-platform video editor
64. OpenShot – Video editor for beginners
65. HandBrake – Media converter
Music Production
66. LMMS – Music creation studio
67. Hydrogen – Advanced drum machine
68. Guitarix – Virtual guitar amp
69. Ardour – Digital audio workstation
70. Audio Recorder – Capture any audio
Office
71. Apache OpenOffice – Office suite alternative
72. WPS Office – MS Office clone
73. Calligra Office Suite – Lightweight office suite
74. Glom – Database creator
75. PDFArranger – Merge, split PDFsAccessories
26. Redshift – Adjust screen color temperature
27. Variety – Wallpaper manager
28. Parcellite – Clipboard manager
29. Flameshot – Screenshot tool
30. Synapse – Quick launcher
Education
31. Anki – Flashcard app
32. TuxType2 – Typing tutor
33. KTouch – Touch typing tutor
34. PyCharm Edu – Python IDE for learning
35. Scratch – Creative coding for kids










































Use network utility commands like
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netstat -tulnp

or

ss -tulnp

to identify which process is using the port. Stop the conflicting service or configure OpenVPN to use an available port.
telnet public-ip 80


Check that the SSH service is listening on all the specified ports using the ss or netstat command:
sudo ss -tlnp | grep ssh

install chinese quick
sudo apt-get install ibus-table-quick





tracker
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


ubuntu restart auto run a command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Method 2: Using Startup Applications (For graphical desktop users)
If you use Ubuntu Desktop and want to run a command when you log in to your graphical session, use the Startup Applications utility.

    Open the Activities overview and search for "Startup Applications". Alternatively, you can press Alt + F2 and run "gnome-session-properties".
    In the "Startup Applications Preferences" window, click Add.
    Fill in the details:
        Name: A descriptive name for the command (e.g., "My Startup Command").
        Command: The command you want to run. You can provide the full path to an executable or a script.
        Comment: (Optional) A brief description.
    Click Add to save the entry. The command will run the next time you log in.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



###systemctl --user mask tracker-extract-3.service tracker-miner-fs-3.service tracker-miner-rss-3.service tracker-writeback-3.service tracker-xdg-portal-3.service tracker-miner-fs-control-3.service


###tracker3 reset -s -r

####sudo systemctl start messagebus

sudo systemctl start dbus

reboot

sudo apt install --reinstall dbus-user-session

tracker reset --hard (for v2)
or
tracker3 reset -s -r (allegedly for v3)

But once again, you need to be logged in as the user whose tracker data are to be destroyed. Once again, I found it safer and much easier simply to remove, for each user,

~/.cache/tracker
and
~/.local/share/tracker
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Even if you disable all the Search functions in settings, the tracker stuff still runs. I don't have any use for it so I have found the following two commands seem to disable everything for me. I have not noticed any issues by doing this:

tracker reset --hard

###systemctl --user mask tracker-{miner-apps,miner-fs,store}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Make tracker-miner-fs, tracker-extract,tracker-store non executables. It's a workaround but it works.

sudo chmod -x /usr/libexec/tracker-miner-fs
sudo chmod -x /usr/libexec/tracker-extract
sudo chmod -x /usr/libexec/tracker-store


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
enable
systemctl --user unmask tracker-store.service tracker-miner-fs.service tracker-miner-rss.service tracker-extract.service tracker-miner-apps.service tracker-writeback.service


systemctl --user unmask tracker-extract-3.service tracker-miner-fs-3.service tracker-miner-rss-3.service tracker-writeback-3.service tracker-xdg-portal-3.service tracker-miner-fs-control-3.service


reboot











handbrake (not work)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo add-apt-repository ppa:stebbins/handbrake-releases

sudo apt install handbrake-gtk

cpulimit -l 50 handbrake




(not test)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
# Reset and clear all existing data/database
tracker reset --hard

# Stop and mask services (prevents auto-start)
systemctl --user mask tracker-store.service tracker-miner-fs.service tracker-miner-rss.service tracker-extract.service tracker-miner-apps.service tracker-writeback.service

# Remove user data directories (optional but thorough)
rm -rf ~/.cache/tracker ~/.local/share/tracker

# Reboot to apply changes
sudo reboot





vnc connection failed too many authentication failures
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check ssh log auth.log

nano /var/log/auth.log

sudo ufw deny ssh
sudo ufw delete 14




fail2ban
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt install fail2ban -y

sudo systemctl enable --now fail2ban
sudo systemctl status fail2ban

sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo nano /etc/fail2ban/jail.local

sudo systemctl restart fail2ban

Scroll down to the [sshd] section (or [ssh]).
Set enabled = true.
Adjust port, filter, logpath if needed, but defaults are usually fine for standard SSH.
sudo systemctl enable fail2ban




apt install wireguard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sudo apt install wireguard



wg genkey | sudo tee /etc/wireguard/private.key
sudo chmod go= /etc/wireguard/private.key

gBy5UEyg0SWvdpT504eJWyukpD8iwdlCQUDQd/Up/Ws=

sudo cat /etc/wireguard/private.key | wg pubkey | sudo tee /etc/wireguard/public.key
+u9uuyAgpmgg89oLc0hm8tptP/tGFbk0dl8H+ZMCg0s=

This command consists of three individual commands that are chained together using the | (pipe) operator:

    sudo cat /etc/wireguard/private.key: this command reads the private key file and outputs it to the standard output stream.
    wg pubkey: the second command takes the output from the first command as its standard input and processes it to generate a public key.
    sudo tee /etc/wireguard/public.key: the final command takes the output of the public key generation command and redirects it into the file named /etc/wireguard/public.key.







Install VNC Server TigerVNC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Install Desktop Environment: (e.g., XFCE, known for being lightweight)
sudo apt install xfce4 xfce4-goodies -y


Install VNC Server: (e.g., TigerVNC)

sudo apt install tigervnc-standalone-server tigervnc-xorg-extension -y


Setting up a VNC server on Ubuntu allows you to remotely access and control a graphical desktop environment from another device. Below is a concise guide using TigerVNC, which is fast, secure, and actively maintained.

1. Install Desktop Environment

If you’re on Ubuntu Server (no GUI), install one:
sudo apt update && sudo apt install tasksel -y
sudo tasksel

Select a desktop environment such as XFCE (lightweight) or GNOME. Set it as default:
sudo update-alternatives --config x-session-manager

2. Install TigerVNC Server
sudo apt install tigervnc-standalone-server -y

Set a VNC password:
vncpasswd

Start the VNC server (display :1 → port 5901):
vncserver -localhost no :1

3. Configure Startup Script

Stop the running session:
vncserver -kill :1

Edit startup file:
nano ~/.vnc/xstartup

Example for XFCE:
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &

Make it executable:
chmod +x ~/.vnc/xstartup

Restart:
vncserver -localhost no :1

4. Secure with SSH Tunnel

On your local machine:
ssh -L 59000:localhost:5901 -C -N user@server_ip

Connect your VNC client to localhost:59000.

5. Auto-Start with systemd

Create service file:
sudo nano /etc/systemd/system/vncserver@.service

Example:
[Unit]
Description=Start TigerVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=your_user
PIDFile=/home/your_user/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 -localhost no :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它 --now

Tip: For best performance, use XFCE or KDE Plasma over slower connections, and always tunnel VNC over SSH for security.







Step-by-step Installation (using TightVNC & XFCE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update System & Install Desktop Environment:

bash


sudo apt update

sudo apt install xfce4 xfce4-goodies


Select a display manager if prompted (e.g., LightDM).

Install VNC Server:

bash


sudo apt install tightvncserver


Set VNC Password:

bash


vncserver


Follow the prompts to create a password for your VNC sessions.

Configure xstartup File:

Stop the initial VNC instance: vncserver -kill :1

Edit the startup script: nano ~/.vnc/xstartup

Add these lines:

bash


#!/bin/bash

xrdb $HOME/.Xresources

startxfce4 &


Make the file executable: chmod +x ~/.vnc/xstartup.

restart

vncserver -localhost no :1





Start VNC as a Service (Systemd):

Create the service file (replace your_user with your actual username):

bash


sudo nano /etc/systemd/system/vncserver@.service


Paste the service definition (adjusting User, PIDFile, ExecStart, WorkingDirectory for your user/system) and save.

ini


[Unit]

Description=Start TigerVNC server at startup

After=syslog.target network.target


[Service]

Type=forking

User=your_user

PIDFile=/home/your_user/.vnc/%H:%i.pid

ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1

ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 -localhost no :%i

ExecStop=/usr/bin/vncserver -kill :%i


[Install]

WantedBy=multi-user.target


Reload Systemd and enable/start the service:

bash


sudo systemctl daemon-reload

sudo systemctl enable Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它 # For display :1

sudo systemctl start Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它


Configure Firewall (UFW):

bash


sudo ufw allow 5901/tcp

sudo ufw enable


Connect: Use a VNC client (like TigerVNC Viewer, RealVNC Viewer) to connect to your_server_ip:1 (e.g., 192.168.1.100:1)



Disabling Tracker3 in Ubuntu
1
2
3

In Ubuntu with GNOME, Tracker3 is a file indexing service that scans your home directory to build a search index. While useful for quick file searches, it can cause high CPU usage and slowdowns, especially on systems with large codebases or shared network directories. Developers often choose to disable it to free system resources.

Step 1 – Stop and Reset Tracker3 Use the built-in Tracker3 management tool to stop all miners and clear existing indexes:
tracker3 reset -s -r

This will:

    Stop all running Tracker3 processes.

    Remove existing index databases.

    Reset configuration to defaults.

You can verify the status with:
tracker3 daemon

It should show miners as Not running.

Step 2 – Permanently Mask Services Prevent Tracker3 from starting again by masking its systemd user services:
systemctl --user mask tracker-miner-fs-3.service \
tracker-extract-3.service \
tracker-miner-rss-3.service \
tracker-writeback-3.service \
tracker-xdg-portal-3.service

Masking links the service to /dev/null, making it impossible to start unless unmasked.

Step 3 – Remove Cache Data To reclaim disk space and remove any residual indexed data:
rm -rf ~/.cache/tracker3
rm -rf ~/.local/share/tracker3

Step 4 – Optional Global Disable If you want to disable Tracker3 for all users (including system accounts like gdm):
sudo systemctl --global mask tracker-miner-fs-3.service \
tracker-xdg-portal-3.service

Alternative – Make Tracker3 Idle Without Removal If you need GNOME search to remain functional but want minimal resource usage, adjust its settings:
gsettings set org.freedesktop.Tracker3.Miner.Files enable-monitors false
gsettings set org.freedesktop.Tracker3.Miner.Files crawling-interval -2

This effectively stops filesystem crawling while keeping the service installed.

Final Step – Reboot Reboot to ensure changes take effect:
sudo reboot

After reboot, tracker3 daemon should confirm no active miners, and CPU usage should remain low. This approach is clean, reversible, and avoids breaking GNOME dependencies.
Learn more:
1 -
blog.csdn.net
2 -
cloud.tencent.com
3 -



Continue reading
33 Hits

鋼琴/長笛/敲擊樂/Trumpet

 
徵鋼琴/長笛/敲擊樂/Trumpet學生🎶
🔵對象: 學生年齡幼稚園至成人均有
初學-演奏級均可
🔵可上門/屯門Studio (近屯門市中心)
🔵教學經驗:
超過10年教授經驗
亦有教授多間中、小學校的管弦樂團/樂器班
更協助學生考級,擔任考試伴奏等
100%合格🔥
🔵導師履歷:
🔺鋼琴演奏級(LTCL)
🔺長笛/敲擊樂/Trumpet 等樂器均有8級
🔺畢業於香港及英國大學,並取得一級榮譽學士學位
如其浪費時間,學幾年都原地踏步
倒不如請專業導師教🎶
特別係初學小朋友,姿勢學唔好,想進步都難
不論任何年紀想考級,或是按興趣
導師都會為每個學生編排合適課程
令學生投入音樂當中✨
有興趣了解可以直接dm查詢🔍

 

Continue reading
897 Hits

上門教授雙簧管 Oboe

 
上門教授雙簧管 Oboe
導師生於香港,自十歲開始學習雙簧管,師承姚桑琳已考獲英國皇家音樂學院雙簧管8級 (Merit ) 樂理8級,正準備考演奏級(LTCL),畢業於香港浸會大學。除專注樂器外, 更修讀音樂治療以及言語治療課程 。本人曾在香港校際音樂節中獲取冠軍及季軍。
本人參與不同管弦樂團的演出,如Galaxy Wind Ensemble,Hong Kong Performers Wind , Kowloon Youth Symphonic Band 等,並曾參與亞太管樂大會交流團。
本人超過9年教學經驗,於SEN學校,琴行及私人教授學生,學生年齡由6歲至40歲不等 。本人相信音樂與生活是密不可分的,教學除了傳授技巧,於樂器考試及比賽取得佳績外,更希望學生透過吹奏時可夠理解及欣賞音樂、最後能讓音樂表達情感亦同等重要。
本人可上門授課, 有意者歡迎pm 或
Continue reading
986 Hits

全職私人補習女導師尋學生

☆☆全職私人補習女導師尋學生【ZOOM】
理大碩士畢業,主修中文
15年私補經驗
擅長中文專科/呈分試、IB中文
一對一教授/小組均可
中文課程內容:漢語拼音、普通話考級、成語故事、看圖說話、閱讀理解、認字閱讀、重組句子、寫作、排句及默書等
具有一級普通話水平,會聽、會講粵語,會簡、繁體字
以耐心和愛心聞名,積極與家長保持溝通
依學生個體差異,因材施教
有興趣的家長和學生,請通過私信方式聯繫。課程費用可議價
 
https://www.facebook.com/mandarinhongkong

 

Continue reading
883 Hits

Choose Happiness

 
各類上門興趣班 / 手作班🎨
$600/2小時(包材料)👝
1-5位都可以,大人、小朋友都得架😊

 

 

 

https://www.facebook.com/foonfoonchoosehappiness/

Continue reading
819 Hits

小學英文女老師

 
現職小學英文女老師誠徵小一至中三英文及全科補習
-具15年教學及補習經驗,學生大多來自直資及傳統名校:
九龍34及41名校網:男女拔萃,喇沙,協恩,聖羅撒,德望等;
港島名校如聖保羅男女,聖保祿,聖嘉勒,華仁等;
國際學校如蔡繼有,德瑞,漢基,加拿大國際,美國國際等
-擁有大量教師用書及試題庫,準確預測學校評估題目,
-富有耐性及愛心,循循善誘,拔尖補底,因材施教
-可以提供度身訂造的試卷、練習、名校測驗卷、
考試卷作溫習
歡迎家長,學生直接自己PM老師查詢🔍
-九龍港島地鐵沿線優先補習,偏遠地區如屯元天,馬鞍山,
小西灣,慈雲山等不接,謝謝!
 
https://www.facebook.com/shukyin.che/

 

Continue reading
1287 Hits

補普通話/中文

尋學生
補普通話/中文
🫐上課模式:zoom或面授
🌷對象1:在校中小幼稚園學生普通話及普教中課程。
🌹對象2:教授成人專業普通話。
☘️對象3:另專為學校、公司團體培訓普通話。 歡迎試堂👏!非誠勿擾,謝謝體諒🙏!
🌲導師簡介:
Sue專業普通話及普教中老師,因材施教。
🍇歷任小學老師,中學普通話導師,自編教材。
🌹香港詩人、主持人、香港詩人聯盟秘書長、
編委;維港作家匯及全球華人詩詞協會會員。
🫒(每堂課授課普教中課程)包含以下各項🌷
拼音、會話、聆聽、看圖說話、看圖寫作、說話口試、命題作文、閱讀理解、造句、創作故事等。 每堂課堂上均有普通話和中文各種練習做。
另教授💕:GAPSK、成語故事、歷史、三字經、弟子規、中國名人故事、三國演義、水滸傳、西遊記、論語······
 
https://www.facebook.com/profile.php?id=100094682693481

 

Continue reading
795 Hits

Art Lessons

 

 

 

 

https://www.facebook.com/profile.php?id=639979520

Continue reading
688 Hits

OnetwoFree Diy

 

手工輕黏土,店主心思作品 ,有保存記念價值🥳🎉歡迎來圖訂做.

 

冇現貨,最少7天或以上,決定好圖樣後, 來圖根據難易程度報價,免費報價😊手工製作必定跟來圖有差異是不可避免的,如介意免做, 所有製作都是由本店主手工完成的,故請不要催單,慢工出細貨。 

確定有圖樣 ,製作$200起,先下訂金50%,面交收再付餘數50%,過程中會拍片和圖片給你,製作過程中如不影響前期已完成的部份,可作少改圖一次。

 

輕黏土作品絶對🙅‍♂️不可沾水💦, 用透明展示箱收藏更好, 配件掉下可以用白膠漿再黏上. 基本上是可永久保存的🎉🥳🥰。

或歡迎興趣班中心,可PM我合作課程。

 

https://www.facebook.com/profile.php?id=100094419195556&mibextid=ZbWKwL

 

 

 

 

 

 

 

 

 

 

 

初學的成品,加上旋轉音樂盒,都好可愛,So cute Baby👶
手工輕黏土, 店主心思作品 ,有保存記念價值🥳🎉歡迎來圖訂做,冇現貨,所有製作都是由本店主手工完成的💪
或歡迎興趣班中心,可PM合作課程😍
 

 

Continue reading
756 Hits

製作升學Portfolio

 

製作升學Portfolio (升幼、升小、升中、插班)

 

📲立即查詢:https://bit.ly/2TFiLLU

Continue reading
790 Hits