FAQ Overview

Software

Instalasi Apache MariaDB 10.4 PHP 8.2 pada Centos 7

  • Install Apache

    $ sudo yum update -y
    $ sudo yum install httpd
    $ sudo systemctl start httpd.service
    $ sudo systemctl enable httpd.service

  • Install MariaDB 10.4.32

    Buat file /etc/yum.repos.d/mariadb.repo, isi dengan script

    [mariadb]
    name = MariaDB
    baseurl = http://yum.mariadb.org/10.4/rhel7-amd64
    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
    gpgcheck=1

    $ sudo yum install MariaDB-server MariaDB-client
    $ sudo systemctl start mysql.service
    $ sudo systemctl enable mysql.service
    $ sudo mysql_secure_installation

    Check instalasi MySQL

    $ sudo mysql -u root -p
    Enter password:
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 593
    Server version: 10.4.32-MariaDB MariaDB Server

    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.


  • Install PHP 8.2
    $ sudo yum update -y
    $ sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    $ sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    $ sudo yum-config-manager --enable remi-php82
    $ sudo yum install php php-mysql php-gd php-json php-mbstring php-session php-xmlwriter php-filter php-spl php-zip
    (Contoh install php dan extension yang diperlukan gd, mbstring dll)

    Check Instalasi PHP
    PHP 8.2.13 (cli) (built: Nov 21 2023 09:55:59) (NTS gcc x86_64)
    Copyright (c) The PHP Group
    Zend Engine v4.2.13, Copyright (c) Zend Technologies


Author: Sena Turana
Last update: 2023-12-15 14:38


Integrasi Openstack menggunakan Ceph

Access denied

Author: Sena Turana
Last update: 2023-12-16 06:42


Menambahkan Plugin Gitlab pada OpenProject

  • Edit file Gemfile.lock lalu tambahkan 
    nano /opt/openproject/Gemfile.lock
    PATH
      remote: modules/gitlab_integration
      specs:
        openproject-gitlab_integration (2.1.4)
          openproject-webhooks
    Pada block DEPENDENCIES tambahkan
      openproject-github_integration!
      openproject-gitlab_integration!
      openproject-job_status!
  • Edit File Gemfile.modules 
    clone gitlab modules, lalu pindahkan ke dalam /opt/openproject/modules (tergantung path instalasi)
    git clone https://github.com/btey/openproject-gitlab-integration.git --depth=1 modules/gitlab_integration
    nano /opt/openproject/Gemfile.modules
      gem 'openproject-gitlab_integration',        path: 'modules/gitlab_integration'

  • Kalau ada error ArgumentError in OpenProject 13.0.7(ArgumentError: missing keyword: :permissible_on), edit File nano /opt/openproject/modules/gitlab_integration/lib/open_project/gitlab_integration/engine.rb

          project_module(:gitlab, dependencies: :work_package_tracking) do
            permission(:show_gitlab_content, {})
          end


  • Lakukan konfigurasi ulang openproject
    openproject configure
    openproject config:set OPENPROJECT_HTTPS=true
    Lalu restart openproject
    systemctl restart openproject

Check module apakah sudah terinstall pada aplikasi openproject (Administration/Plugins)

Author: Sena Turana
Last update: 2023-12-19 08:14


[Websphere Application Server] Java WebService throwing javax.xml.ws.WebServiceException with Invalid Endpoint Interface

Symptom

javax.xml.ws.WebServiceException: The Endpoint validation failed to validate due to the following errors:  :: Invalid Endpoint Interface

Solution

Masuk ke WAS Console
Application servers > server1 > Process definition > Java Virtual Machine >Custom properties
Tambahkan custom properties
jaxws.ignore.extraWSDLOps = true

 

Author: Sena Turana
Last update: 2024-04-19 01:22


[Java] Bypass Checking Sertifikat SSL


package id.darodata.testing;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.InputStream;
import java.net.URL;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
public class IgnoreInvalidSSL {
	private static TrustManager[ ] get_trust_mgr() {
		TrustManager[ ] certs = new TrustManager[ ] {
				new X509TrustManager() {
					public X509Certificate[ ] getAcceptedIssuers() { return null; }
					public void checkClientTrusted(X509Certificate[ ] certs, String t) { }
					public void checkServerTrusted(X509Certificate[ ] certs, String t) { }
				}
		};
		return certs;
	}

	public static void main(String[] args) {
		try{
			String url = "https://test.darodata.id";
			URL urlc = new URL(url);
			java.lang.System.setProperty("https.protocols", "TLSv1.2");
            SSLContext ssl_ctx = SSLContext.getInstance("TLS");
            TrustManager[ ] trust_mgr = get_trust_mgr();
            ssl_ctx.init(null,                // key manager
                         trust_mgr,           // trust manager
                         new SecureRandom()); // random number generator
            HttpsURLConnection.setDefaultSSLSocketFactory(ssl_ctx.getSocketFactory());			
			
			HttpsURLConnection conn = (HttpsURLConnection)urlc.openConnection();
			conn.setRequestProperty("User-Agent", "AppleWebKit/537.36");
			conn.setDoInput(true);
			conn.setDoOutput(true);
			InputStream is = conn.getInputStream();
			int read = -1;
			StringBuffer sb = new StringBuffer();
			File f = new File("D:\\test.txt");
			while((read = is.read()) > -1){			
				sb.append((char)read);
			}
			FileWriter fw = new FileWriter(f);
			BufferedWriter bw = new BufferedWriter(fw);
			bw.write(sb.toString());
			bw.close();
			is.close();
		}catch (Exception e) {
			e.printStackTrace();
		}
	}
}


Author: Sena Turana
Last update: 2024-04-19 03:17


[HTML] Menambahkan JavaScript syntax highlighter

Tambahkan pada head

CDN

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>

<!-- and it's easy to individually load additional languages -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/go.min.js"></script>
<script>hljs.highlightAll();</script>

Self Hosted (File pada attachment)

<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.min.js"></script>
<script>hljs.highlightAll();</script>

Contoh Penggunaan

<pre><code class="language-html">...</code></pre>

Referensi : https://highlightjs.org/ 

Author: Sena Turana
Last update: 2024-04-19 03:13


[netstat] Melihat Open Port dan Aplikasi yang Running di Linux

Versi OS


[root@master-1 ~]# cat /etc/*release
CentOS Linux release 7.9.2009 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

 

$ netstat -tulpn 

 

 

Author: Sena Turana
Last update: 2024-04-19 06:31


[Appium] Instalasi

Access denied

Author: Sena Turana
Last update: 2024-04-22 05:13


[IBM Datapower] Konfigurasi Log Target ke Syslog

Untuk konfigurasi syslog baru, login ke web console IBM DataPower, masuk ke menu Log Target

Klik Add untuk menambahkan Log Target Baru

  • Target Type : syslog
  • Rate Limit : 100 (Default 100)
  • Local IP Address : Isikan IP Datapower
  • Local Identifier : Isikan Nama Datapower
  • Remote Host : Isikan IP Syslog Server
  • Remote Port : Isikan Port Syslog Server

Pilih tab Event Subscrptions lalu klik Add

  • Event Category : Pilih object yang akan ditulis ke Syslog, misal service Webservice ; ws-proxy
  • Minimum Event Priority : Event yg akan ditulis ke log; notice,error, warning etc

Bisa menuliskan langsung beberapa Event Subscriptions pada 1 log target

Author: Sena Turana
Last update: 2024-04-24 04:58


[IIS] Mengaktifkan IIS pada Windows 10

Masuk ke Control Panel // Programs lalu pilih Turn Windows features on or off

Pilih Internet Information Services, lalu klik OK

Check Instalasi apakah berhasil

  • Terbentuk folder C:\inetpub
  • IIS Manager sudah dapat digunakan

Author: Sena Turana
Last update: 2024-04-24 06:34


[GIT Server] Instal Bonobo GIT Server on Windows 10

  • Installation IIS on Windows 10 - Click Here
  • Make sure that .NET Framework is already activated on Turn Windows features on of off

  • Download the latest version of Bonobo Git Server
  • Extract the files from the installation archive to C:\inetpub\wwwroot

  • Allow IIS User to modify C:\inetpub\wwwroot\Bonobo.Git.Server\App_Data

  • Convert Bonobo.Git.Server to Application in IIS

  • Enable Anonymous Authentication in IIS and disable the others. To do so, select the application, click on the authentication icon and set the value to of Anonymous Authentication to Enabled. The configuration should look like the following screenshot.

  • Launch your browser and go to http://localhost/Bonobo.Git.Server. Now you can see the initial page of Bonobo Git Server and everything is working.
  • Default credentials are username: admin password: admin

 

 

Author: Sena Turana
Last update: 2024-04-24 06:39


[Git] Menambahkan folder yang sudah ada ke Repository Git

Set Config

$ git config --global user.email "sena.turana@gmail.com"
$ git config --global user.name "Sena Turana"

Buat Repository di Bonobo Git Server
ex. IntegrasiNSW_RAPAT
http://10.102.120.138/Bonobo.Git.Server
Lihat Git URL
Git url :  http://10.102.120.138/Bonobo.Git.Server/IntegrasiNSW_RAPAT.git

masuk ke Git CMD
E:\Share GDrive\PDE>cd IntegrasiNSW_RAPAT
$ git init

tambah remote origin
$ git remote add origin  http://10.102.120.138/Bonobo.Git.Server/IntegrasiNSW_RAPAT.git

check remote
$ git remote -v

Tambah semua file ke dalam repository
$ git add .

Commit
$ git commit -m "Initialize Integrasi NSW Rapat"

Push
$ git push origin master

Untuk user yang akan pull

$ git config --global user.email "sena.turana@gmail.com"
$ git config --global user.name "Sena Turana"
$ git init
$ git clone http://10.102.120.138/Bonobo.Git.Server/IntegrasiNSW_RAPAT.git
$ git remote add origin  http://10.102.120.138/Bonobo.Git.Server/IntegrasiNSW_RAPAT.git

Author: Sena Turana
Last update: 2024-04-24 09:01


[Centos] Menambahkan Permanen Variable dan Direktori baru pada PATH

Buka bashrc file

$ vi ~/.bashrc

Tambahkan baris

$ export PATH="/opt/IBM/WebSphere/AppServer/V85/BASE/java/bin:$PATH"

untuk menyambung PATH yang sudah ada harus ada variable sebelumnya, contoh diatas penambahan :$PATH

Untuk menambah variable baru

$ export JAVA_HOME="/opt/IBM/WebSphere/AppServer/V85/BASE/java/"

untuk update perubahan yang sudah dilakukan pada bashrc

$ source ~/.bashrc

Author: Sena Turana
Last update: 2024-04-29 05:42


Cloud Computing

[Openstack] Install Openstack dengan PackStack di Centos 7

  • Sebelum instalasi pastikan nama hostname sudah sesuai. Hostname yang dipakai dalam artikel ini yaitu openstack.
  • Text editor yang digunakan nano.
[root@openstack ~]# yum install nano
[root@localhost ~]# hostnamectl set-hostname openstack
[root@localhost ~]# reboot
[root@openstack ~]# nano /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
[root@openstack ~]# systemctl status firewalld

Kalau firewalld aktif, disable firewalld

[root@openstack ~]# systemctl stop firewalld

[root@openstack ~]# systemctl disable firewalld
[root@openstack ~]# systemctl status NetworkManager

Kalau NetworkManager aktif, disable NetworkManager

[root@openstack ~]# systemctl stop NetworkManager

[root@openstack ~]# systemctl disable NetworkManager

Enable Network Service

[root@openstack ~]# systemctl enable network

[root@openstack ~]# systemctl start network

Check IP Address

[root@openstack ~]# ip add show

Lihat ethernet sesuai yang aktif, nama ethernet ini (enp59s0f0) akan digunakan selanjutnya untuk instalasi PackStack
2: enp59s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

[root@openstack ~]# nano /etc/selinux/config

SELINUX=disabled

[root@openstack ~]# reboot

Check selinux (harus sudah disabled)

[root@openstack ~]# getenforce
Disabled
[root@openstack ~]# yum install -y centos-release-openstack-train

[root@openstack ~]# yum install yum-utils
[root@openstack ~]# yum-config-manager --enable openstack-train
[root@openstack ~]# yum update -y ​​​​​​​
[root@openstack ~]# yum install -y openstack-packstack

Ganti isi parameter br-ex:xxxx dengan nama ethernet yang sudah dicheck sebelumnya (enp59s0f0)

[root@openstack ~]# packstack --allinone --provision-demo=n --os-neutron-ovs-bridge-mappings=extnet:br-ex 
--os-neutron-ml2-mechanism-drivers=openvswitch --os-neutron-l2-agent=openvswitch
--os-neutron-ovs-bridge-interfaces=br-ex:enp59s0f0
--os-neutron-ml2-type-drivers=vxlan,flat
--os-neutron-ml2-tenant-network-types=vxlan
  • Proses Instalasi berjalan kira-kira sekitar 30 menit. Setelah instalasi ethernet enp59s0f0 tidak mempunyai IP dan akan ada ethernet baru dengan nama br-ex dengan ip address yang sama dengan enp59s0f0
  • Pada root folder ada file keystonerc_admin. Dalam file tersebut terdapat user dan login untuk masuk ke horizon
  • Aplikasi horizon dapat diakses di URL http://[ipAddress]/dashboard

Membuat Network External untuk Router Gateway Neutron

Masuk kedalam horizon, Pilih Menu Admin / Network / Networks klik tombol + Create Network

  • Ada 3 Tab pada pembuatan Network, Network, Subnet dan Subnet Details

External Network sudah berhasil dibuat.

Buat Network Untuk Private Network dengan Tipe Tunneling VXLAN, untuk pengisian lainnya sama dengan pembuatan external network, hanya pilihan External Network tidak dichecklist.

Private Network sudah berhasil dibuat.

  • Pembuatan Router Gateway untuk Instance. IP Public nantinya akan diberikan oleh External Network dengan membuat Floating IP Address. 
  • Untuk pembuatan Router masuk Ke Admin / Network / Routers lalu klik button + Create Router

Form untuk Create Router

  • Proses selanjutnya yaitu melakukan attach Private Network Interface ke Gateway Router
  • IP Private Network diberikan oleh DHCP, jadi tidak wajib mengisi IP Address pada penambahan Interface

Pada Router Detail, klik pada tab Interface, Klik + Add Interface

Private Network Interface berhasil ditambahkan ke Gateway Router.

Author: Sena Turana
Last update: 2024-04-19 06:00


Command yang sering digunakan deployment Openstack dengan Juju

  • juju run-action vault/0 --wait reissue-certificates - renew sertifikat
  • juju add-machine node10.maas --series="bionic" - menambah mesin
  • juju add-unit --to 28 ceph-osd - menambah unit osd ke mesin (28 : Id mesin)
  • juju add-unit --to 28 nova-compute - menambah unit nova-compute
  • juju remove-machine 13 --force - menghapus mesin dan unit2 yang sudah terinstall

Author: Sena Turana
Last update: 2024-03-15 09:19


Openstack Network Agent down karena versi OVN tidak sama

Symptom

  • Error: Unable to attach interface. Details
    Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. <class 'nova.exception_Remote.PortBindingFailed_Remote'> (HTTP 500) (Request-ID: req-cd901d79-6964-41f4-bd22-836f5397ac25)

Reference

  • Do no set ovn-match-northd-version to true by default.
  • This was introduced in commit ec21edf4d9d548c766dbe4ba9adfb045d0176bf4 when ovn-controllers were not updated before northdb.
  •  Now, ovn-controller are updated first so the "Fail-safe upgrade" procedure[1] should not be used by default anymore.
  • Closes-Bug: #2007870
  • https://docs.ovn.org/en/latest/intro/install/ovn-upgrades.html#fail-safe-upgrade

Check pada master status network agent

$ openstack network agent list

Contoh hasil command diatas

Lihat ID Agent dengan status Alive XXX

Setelah itu masuk ke network agent dengan status XXX tersebut, pada tulisan ini misal
$ juju ssh 1 
#1 adalah ID Mesin network agent

setelah masuk, untuk ignore check version ketikan command berikut

$ sudo ovs-vsctl set open . external_ids:ovn-match-northd-version="false"

Kemudian restart service

$ sudo systemctl restart neutron-ovn-metadata-agent.service

$ sudo systemctl restart ovn-controller.service

Untuk melihat service yang running di linux

$ systemctl list-units --type=service | grep ovn

Author: Sena Turana
Last update: 2024-04-01 06:28


Openstack MySQL Cluster Bermasalah Setelah Mesin Down

Symptom

  • Status mysql-innodb-cluster/XX pada juju status down
  • Kejadian umumnya terjadi karena mesin mati karena arus terputus

Solusi

Masuk ke master untuk melihat password mysql
$ juju run --unit mysql-innodb-cluster/1 leader-get

Masuk ke salah satu node mysql cluster dan download mysql-sh
$ wget https://dev.mysql.com/get/Downloads/MySQL-Shell/mysql-shell_8.0.34-1ubuntu22.04_amd64.deb
$ sudo dpkg -i mysql-shell_8.0.34-1ubuntu22.04_amd64.deb
lalu ikuti wizzard.

Setelah terinstall, ketikan command untuk masuk ke shell mysql (leader IP 23)
$ mysqlsh clusteruser@192.168.50.23 --js 
Note : untuk password lihat command sebelumnya, bagian "cluster-password"

Setelah masuk shell ketikan
$ var cluster = dba.getCluster("jujuCluster") 
note : untuk jujuCluster disini nama cluster MySQL, disesuaikan dengan nama cluster yang dibuat

Remove node-node mysql cluster yang bermasalah
$ cluster.removeInstance('root@192.168.50.24:3306',{force: true})
$ cluster.removeInstance('root@192.168.50.25:3306',{force: true}) 

Lalu masuk ke masing-masing node yang bermasalah (Misal IP 24)
$ mysql -u root -p
Note : password dari command leader-get
$ set GLOBAL super_read_only = OFF;
$ STOP GROUP_REPLICATION;
$ RESET SLAVE ALL;
$ DROP DATABASE mysql_innodb_cluster_metadata;

Setelah semua node selesai, masuk kembali ke shell, add kembali instance yang bermasalah
$ cluster.addInstance({user: "clusteruser", host: "192.168.50.24", port: 3306, password: "XXXXXX"});
$ cluster.addInstance({user: "clusteruser", host: "192.168.50.25", port: 3306, password: "XXXXXX"});

Note : XXXXXX = password mysql cluster

Author: Sena Turana
Last update: 2024-04-01 06:49


Perpanjang Sertifikat Expired Juju Charm

Jalankan command

  • juju run-action vault/0 --wait reissue-certificates

Author: Sena Turana
Last update: 2024-04-17 18:55


[Error] Binding Failed for port xxxx, please check neutron logs for more information

Symptom

  • Tidak bisa membuat VM baru dengan error Binding Failed for port xxxx, please check neutron logs for more information
  • Tidak ada error pada neutron server
  • Ada error pada log OVN - mismatch with northd version
  • Check Agent OVN (pada master) $ openstack network agent list ada yang down

Solution

Pastikan semua node OVN tidak auto update
$ sudo nano /etc/apt/apt.conf.d/20auto-upgrades

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


Pada setiap OVN Node set external_ids:ovn-match-northd-version="false"
$ sudo ovs-vsctl set open . external_ids:ovn-match-northd-version="false"

Note : solusi ini akan aman jika kedepan tidak ada penambahan/update ovn

Author: Sena Turana
Last update: 2024-04-19 00:59


Deploy ceph-dashboard

$ juju deploy --channel quincy/stable  ceph-dashboard
$ juju add-relation ceph-dashboard:dashboard ceph-mon:dashboard
$ juju add-relation ceph-dashboard:certificates vault:certificates
$ juju run-action --wait ceph-dashboard/0 add-user username=admin role=administrator

Kalau ada ceph-dashboard yang down, bisa dilakukan restart mgr (jika tidak mengetahui nama service-nya bisa dicheck terlebih dahulu)

$ systemctl list-units --type=service | grep ceph

$ sudo systemctl restart ceph-mgr@juju-e291b1-0-lxd-3.service

The web UI is available on the configured VIP and on port 8443:

https://xxx.xxx.xxx.xxx:8443

Author: Sena Turana
Last update: 2024-04-19 10:28


[Ceph] Session Timeout Ceph Dashboard

Untuk mengecek session timeout

$ sudo ceph dashboard get-jwt-token-ttl

Untuk menambahkan session timeout

$ sudo ceph dashboard set-jwt-token-ttl 86400

Author: Sena Turana
Last update: 2024-04-29 04:25


Internet of Things

[Arduino] Sensor Proximity

Sensor proximity adalah sensor jarak. Sensor ini dapat mendeteksi perubahan jarak pada suatu benda tanpa adanya kontak fisik.

Pinout Arduino

Contoh

//referensi koding 

//sambungkan pin 5V sensor ke 5V arduino. pin GND sensor ke pin GND Arduino.
int sensorPin = A0;   // sambungkan pin OUT sensor ke pin A0 Arduino. 
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
  Serial.begin(9600); // set baudrate serial monitor ke 9600
}

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  Serial.print("Nilai Proximity : ");
  Serial.println(sensorValue);
  delay(5);
}

Author: Sena Turana
Last update: 2024-04-19 01:19