Nov 27, 2023

Ubuntu : Change NTP Server

At times it is recommended to change the NTP server for a more accurate Time Sync. This is to ensure all servers have the same Date, Time and Zone.



$ sudo nano /etc/systemd/timesyncd.conf


Add or modify the following line and save the file :-


NTP=time.google.com


Next, restart the time service :-


$ sudo systemctl restart systemd-timesyncd


If required, you can check whether the time server can be contacted :-


$ sudo cat /var/log/syslog | grep systemd-timesyncd


Verify the NTP connections :-


$ sudo timedatectl show-timesync | grep ServerName



!!! HAPPY COMPUTING !!!

Nov 21, 2023

[UPDATE] Zabbix : Installation and Configuration

Latest Zabbix v.6.4, installation and configuration in Ubuntu Server v.22.04.3 LTS.


1. Install Ubuntu Server v.22.04.3 LTS and configure the basic configurations.


$ sudo apt update && sudo apt upgrade -y

$ sudo timedatectl set-timezone Asia/Kuala_Lumpur

$ sudo touch /etc/cloud/cloud-init.disabled
 
 
2. Install Pre-requisites packages.


$ sudo apt install wget git mysql-server php apache2 -y


3. Install Zabbix Repository and update.


$ sudo wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb

$ sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb

$ sudo apt update


4. Install Zabbix Packages that includes the Server, Frontend and Agent.


$ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent


5. Ensure that MySQL Server is up and running before proceeding this steps. You will be prompted to create a password, proceed to create the password.


$ sudo mysql -uroot -p
password

mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;

mysql> create user zabbix@localhost identified by 'password';

mysql> grant all privileges on zabbix.* to zabbix@localhost;

mysql> set global log_bin_trust_function_creators = 1;

mysql> quit;


6. Import the Zabbix database schema into MySQL database. You will be prompted to key-in MySQL password. Depending on your system, it may a while to complete.


$ sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix


7. Once completed, disabled back the log_bin_trust_function option.


$ sudo mysql -uroot -p
password

mysql> set global log_bin_trust_function_creators = 0;

mysql> quit;


8. Configure Zabbix server to access the database.


$ sudo nano /etc/zabbix/zabbix_server.conf

DBPassword=password


9. Restart and Enabled both Zabbix and Apache2 services.


$ sudo systemctl restart zabbix-server zabbix-agent apache2

$ sudo systemctl enable zabbix-server zabbix-agent apache2


10. Now, at another computer and browse to --> http://[Zabbix server]/zabbix

You need to perform some basic configuration on the Zabbix server before first use. This may includes the following :-

  • DB Type = MySQL
  • DB Name = zabbix
  • DB User = zabbix
  • DB Password = password
11. The standard Zabbix login credentials as below (case sensitive) :-

  • Username = Admin
  • Password = zabbix

!!! HAPPY COMPUTING !!!


Nov 12, 2023

TrueNAS : Build Your Own NAS (Network Attached Storage)

Building your own NAS (Network Attached Storage) is very easy and simple with TrueNAS. It supports a wide variety of hardware thus making it simple and easy to install.

You can make use of any old computer with at least 4GB or more and a minimum of 4 Hard Drives with any make or model, preferably with the same capacity (eg. 1TB). The performance of system will solely depends on your choice of hardware but for Home use it is more than sufficient.

There are 2 Community Edition available :-
  1. TrueNAS Core
  2. TrueNAS Scale
TrueNAS Core is based on BSD (Berkeley Software Distribution), it's very robust and stable.

TrueNAS Scale on the other hand is based on Debian Linux, it's also very stable and more suitable for Home use because it's using Debian Package.

While TrueNAS Enterprise is more designed towards Enterprise companies with demands on High Availability, High Performance and Professional Supports. iX System also developed and sell pre-build TrueNAS System to cater for anyone that doesn't want to build their own.

For more information about TrueNAS, please visit their website at https://www.truenas.com/


Why TrueNAS ?

Well first of all, TrueNAS is using OpenZFS. It's an Open Source Storage Platform that have functionality of both traditional file system and volume manager.

Unlike other Array Controller that required all hard drives to be in the same Make and Model, OpenZFS make use of mixed Make and Model to create a Storage "Pool" thus making it very suitable for Home use because not everyone have the same hard drive specifications laying around.

More information about OpenZFS can be found here at https://openzfs.org/wiki/Main_Page


Step-by-Step Guide :

1. Download the latest ISO file from TrueNAS website (https://www.truenas.com/).

2. Use any preferred ISO Maker/Writer to an external USB Flash Drive, a minimum of 8GB will be sufficient.

3. Once the USB Flash Drive is ready, you can plug into the computer.

4. But before installation, we need to ensure that all the hard drive is correctly detected and remove any RAID array configuration. ZFS works best without any RAID configured.

5. You will need to choose the install drive, any capacity drive will do. Preferably the first drive that is connected.

6. After that, you will be prompted to specify an Administrator's password, this password will be used to login to TrueNAS Web GUI on the later stage.

7. Once the installation completed and computer rebooted, on another computer and open your prefer browser (eg. Google Chrome) and type-in the IP Address of the server displayed at console screen.

8. Some basic configurations is required, we need to specify a Static IP Address for the server. This will ensure that everytime the server rebooted, it will use the same IP Address and also it is more easy to configure port forwarding in your router (if needed) for some applications to work.

9. Next is to create the first storage pool, you can configure as many pool(s) you want but all depends on the available hard drives. For example, ZFS-z required a minimum of 2 drives (similarly to RAID-1), if you have more than 2 hard drives (eg. 3 drives) then the additional hard drive will be used as Parity Drive which are similarly to RAID-5.

10. Now you TrueNAS will work correctly, further configuration is required such as creating SMB (Samaba) Shares, NFS Share or whichever you required.


Video below :-



!!! HAPPY COMPUTING !!!


Nov 8, 2023

Batch : Rename Hostname via Batch File

This is an example of a batch file to rename the Hostname or Computer Name as per your preferences, it is much faster way to do computer renaming for many computers.

Note that the batch file must be "run as administrator" mode in order to works.

 @ECHO OFF
CLS
>NUL CHCP 65001

:asktorename
REM To ask whether to Rename the Hostname or not.
ECHO.
ECHO.
ECHO.
ECHO               ╔═════════════════════════════════════════╗
ECHO               ║         RENAMING THE HOSTNAME           ║
ECHO               ╚═════════════════════════════════════════╝
ECHO.
CHOICE /M "──────────────► DO YOU WANT TO RENAME THE HOSTNAME "
    IF ERRORLEVEL 2 GOTO eof
    IF ERRORLEVEL 1 GOTO askforname
GOTO eof
REM --------------------------------------------------------------------------------------

:askforname
REM To ask User for the preferred hostname.
ECHO.
ECHO.
SET /P NEWNAME="PLEASE TYPE THE NEW HOSTNAME: "
ECHO.
ECHO "     ► ► ► THE NEW HOSTNAME IS ───► %NEWNAME%"
CHOICE /M "     ► ► ► IS THIS CORRECT "
    IF ERRORLEVEL 2 GOTO asktorename
    IF ERRORLEVEL 1 GOTO dorenhost
GOTO eof
REM --------------------------------------------------------------------------------------

:dorenhost
REM To proceed Rename the Hostname as per Input by User.
ECHO.
ECHO "     ► ► ► OK, RENAMING HOSTNAME → %NEWNAME%, PLEASE WAIT..."
WMIC COMPUTERSYSTEM where name="%COMPUTERNAME%" CALL RENAME name="%NEWNAME%"
TIMEOUT /t 3 /NOBREAK
ECHO.
ECHO "     ► ► ► RENAMING HOSTNAME COMPLETE"
ECHO.
ECHO "THE NEW HOSTNAME WILL TAKE EFFECT AFTER COMPUTER RESTART"
TIMEOUT /t 5 /NOBREAK
GOTO eof
REM --------------------------------------------------------------------------------------

:eof
START SHUTDOWN /r /f /t 10
COLOR
>NUL CHCP 437
EXIT /b



!!! HAPPY COMPUTING !!!

Nov 6, 2023

[UPDATED] Internet Explorer : Enabled via VBS Script File

Latest script to launch Internet Explorer with preferred webpage loaded.

1. Open --> Notepad

2. Type or Copy the following script:

Set objExplorer = CreateObject("InternetExplorer.Application")
with objExplorer
    .Navigate strPath
    .ToolBar = 1
    .StatusBar = 1
    .Width = 1000
    .Height = 593
    .Left = 1
    .Top = 1
    .Visible = 1
    .FullScreen = 0
    .Navigate("https://www.google.com.my")
End With

 Note: Replace the URL with your preferred URL address.


3. Save the file as --> IE_Link.vbs

4. Test run the script file, you can also create a Shortcut in the "Desktop" and replace the icon to Internet Explorer icon too.


!!! HAPPY COMPUTING !!!