Aug 17, 2022

LUBUNTU : Command Line

 LUBUNTU v.20.04.1 64-bit : Command Line

1. sudo apt update

2. sudo apt upgrade -y

3. sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

4. sudo dpkg -i ~/downloads/google-chrome-stable_current_amd64.deb

5. sudo apt install fonts-liberation


Jun 30, 2022

Acer TravelMate P214-53 : Unable to detect NVMe Drive.

 Acer TravelMate P214-53 : Unable to detect NVMe Drive.

  1. Press --> F2 key to enter into BIOS.
  2. Goto --> Security tab --> Supervisor Password --> Enter a temporary password (eg. 1234)
  3. Disabled Secure Boot.
  4. Then --> Save & Exit.
  5. After restart, enter back into BIOS again and CLEAR the Supervisor Password but leave the Secure Boot option Disabled.
  6. Save & Exit.
  7. Download --> Intel RST for VMD Drivers --> Intel Download Center.
  8. Unzip drivers into USB Flash Drive.
  9. Boot Windows 10 installer as usual, you will not able to see any HDD/SSD detected.
  10. Click --> Load --> Browse --> Select --> Intel RST VMD folder.
  11. After load completed, you can now see the NVMe drive is detected.
  12. Proceed to format and install Windows 10 accordingly.
Special Note :
Sometimes the Intel RST Drivers although was loaded and able to detect the NVMe drive successfully, but Windows installer will prompt error message "0x80300001", just proceed to restart the computer again and boot into Windows install as usual and re-load the drivers again.

Apr 29, 2022

Zabbix : Install Zabbix-Agent in CentOS

 1. sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/7/x86_64/zabbix-agent-6.0.3-1.el17.x86_64.rpm

* Check for latest version in https://repo.zabbix.com/zabbix.

2. sudo yum update

3. sudo yum install zabbix-agent -y

4. sudo nano /etc/zabbix/zabbix-agentd.conf

        --> Server = [Zabbix Server IP Address]

        --> Hostname = [CentOS hostname]

5. sudo iptables -A INPUT -p tcp -s [Zabbix server IP address] --dport 10050 -m state --state NEW,ESTABLISEHD -j ACCEPT

* If "firewalld" was install, add port 10050 into exception list.

6. sudo systemctl restart zabbix-agent

7. sudo systemctl enable zabbix-agent

8. sudo systemctl status zabbix-agent

9. Continue to add client host into Zabbix server via browser, select --> CentOS with Zabbix Agent


Zabbix : Install Zabbix-Agent in Ubuntu

 1. sudo wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-1+ubuntu20.04_all.deb

* Visit https://repo.zabbix.com/zabbix for latest version.


2. sudo dpkg -i zabbix-release_6.0-1+ubuntu20.04_all.deb

3. sudo apt-get update

4. sudo apt-get install zabbix-agent -y

5. sudo nano /etc/zabbix/zabbix-agentd.conf

        --> Server = [Zabbix Server IP Address]

        --> ServerActive = [Zabbix Server IP Address]

        --> Hostname = [Ubuntu Client Hostname]


6. sudo systemctl restart zabbix-agent

7. sudo systemctl enable zabbix-agent

8. sudo systemctl status zabbix-agent

9. sudo ufw allow 10050/tcp          * check status --> sudo ufw status

OR --> sudo iptables -A INPUT -p tcp -s [Zabbix server IP address] --dport 10050 -m state --state NEW,ESTABLISEHD -j ACCEPT

* Some firewall may block or NAT the address, thus instead of using the Zabbix server IP address, use the firewall IP address.


10. Use another PC to browse the zabbix server (eg. http://[Zabbix Server IP Address]/zabbix) and login using your admin's credentials.

11. Continue to add the client into the monitoring --> Configuration --> Hosts --> Create Host

        --> Add --> Agent --> Linux with Zabbix Agent


Apr 27, 2022

Batch - IF Calculation

 Batch File Command "IF"

  • EQU = Equal to...
  • NEQ = Not Equal to...
  • LSS = Less than...
  • LEQ = Less than or Equal to...
  • GTR = Greater than...
  • GEQ = Greater than or Equal to...
Example :-

IF %INPUT% EQU 100 ECHO "EQUAL VALUE"
IF %INPUT% GEQ 100 ECHO "VALUE IS GREATER THAN OR EQUAL TO 100"

Jun 24, 2021

CentOS v.7 : Apache Guacamole

 Apache Guacamole is a RDP to HTTP/HTTPS open source remote broker/gateway.

1. Install CentOS v.7.0 with Minimal Installation, follow all on-screen configurations accordingly.

2. During the install, configure the IP Address to Fixed/Manual and the hostname (eg. guacsvr).

3. Install the RPM Fusion repository :-

  • sudo yum install -y epel-release
  • sudo yum -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
4. Install some utilities :-
  • sudo yum install -y nano net-tools wget

5. Install MariaDB, Tomcat & Apache Guacamole dependencies :-
  • sudo yum install -y cairo-devel libjpeg-turbo-devel libwebsockets-devel libpng-devel uuid-devel ffmpeg-devel freerdp-devel pango-devel libssh2-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel libtool libtelnet-devel freerdp mariadb-server tomcat

6. Download, Extract & Make Apache Guacamole Server (as of writing the latest version is 1.3.0, check for latest version at https://downloads.apache.org/guacamole/) :-
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/source/guacamole-server-1.3.0.tar.gz
  • sudo tar -xzf guacamole-server-1.3.0.tar.gz
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/binary/guacamole-1.3.0.war
  • cd guacamole-server-1.3.0
  • sudo ./configure --with-init-dir=/etc/init.d
  • sudo make install
  • sudo ldconfig && cd ~
  • cp ~/guacamole-1.3.0.war /var/lib/tomcat/webapps/guacamole.war
  • sudo firewall-cmd --permanent --add-port=8080/tcp
  • sudo firewall-cmd --reload
  • sudo systemctl enable tomcat && systemctl enable mariadb && systemctl enable guacd

7. Download & Install Connector, Extensions & Lib :-
  • sudo mkdir -p /usr/share/tomcat/.guacamole/{extensions,lib}
  • sudo wget https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.24.tar.gz
  • sudo tar -xzf mysql-connector-java-8.0.24.tar.gz
  • cp mysql-connector-java-8.0.24/mysql-connector-java-8.0.24.jar /usr/share/tomcat/.guacamole/lib/
Extensions (select whichever you preferred) :-
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/binary/guacamole-auth-jdbc-1.3.0.tar.gz
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/binary/guacamole-auth-ldap-1.3.0.tar.gz
  • sudo tar -xzf guacamole-auth-jdbc-1.3.0.tar.gz
  • sudo tar -xzf guacamole-auth-ldap-1.3.0.tar.gz
  • cp guacamole-auth-jdbc-1.3.0/mysql/guacamole-auth-jdbc-1.3.0.jar /usr/share/tomcat/.guacamole/extensions/
  • cp guacamole-auth-ldap-1.3.0/guacamole-auth-ldap-1.3.0.jar /usr/share/tomcat/.guacamole/extensions/
  • sudo systemctl start mariadb && systemctl start tomcat

8. To secure MySQL server configurations :-

  • sudo mysql_secure_installation
  • Enter
  • Key-in your new password
  • When prompted = Yes, Yes, Yes, Yes

9. Configure MySQL DB :-
  • sudo mysql -u root -p
  • CREATE DATABASE IF NOT EXISTS guacdb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
  • GRANT SELECT,INSERT,UPDATE,DELETE ON guacdb.* TO 'guacuser'@'localhost' IDENTIFIED BY 'guacpass' WITH GRANT OPTION;
  • flush privileges;
  • quit

10. Install Apache Guacamole Client :-
  • sudo wget https://downloads.apache.org/guacamole/1.3.0/source/guacamole-client-1.3.0.tar.gz
  • sudo tar -xzf guacamole-client-1.3.0.tar.gz
  • sudo cat guacamole-client-1.3.0/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/schema/*.sql | mysql -u root -p guacdb
  • sudo mkdir -p /etc/guacamole
Create and configure guacamole properties :-
  • sudo nano /etc/guacamole/guacamole.properties
    • #MySQL properties
    • mysql-hostname: localhost
    • mysql-port: 3306
    • mysql-database: guacdb
    • mysql-username: guacuser
    • mysql-password: guacpass
    • #Additional settings
    • mysql-default-max-connections-per-user: 0
    • mysql-default-max-group-connections-per-user: 0
  • sudo chmod 0400 /etc/guacamole/guacamole.properties
  • sudo chown tomcat:tomcat /etc/guacamole/guacamole.properties
  • ls -alh /etc/guacamole/
  • ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat/.guacamole/
  • sudo chown tomcat:tomcat /var/lib/tomcat/webapps/guacamole.war

11. Configure Time Zone for MySQL :-
  • sudo nano /etc/my.cnf
    • default-time-zone='+8:00'

12. Configure the Connector :-
  • sudo setsebool -P tomcat_can_network_connect_db on
  • sudo restorecon -R -v /usr/share/tomcat/.guacamole/lib/mysql-connector-java-8.0.24.jar

13. Restart the server.
  • sudo shutdown now -r

14. On another computer, open any internet browser
  • http://[Server IP]:8080/guacamole
  • Username = guacadmin
  • Password = guacadmin
! Important to change the password !


Apr 5, 2021

CentOS v.7 : List Existing User & Login History

To get User Listing.

 [root@server~]# get ent passwd

OR

[root@server~]# less /etc/passwd

OR

[root@server~]# cut -di -f1 /etc/passwd


To get Login History.

[root@server~]# last -120

OR

[root@server~]# cat /var/log/secure         *The "secure" file may have corresponding date.