Monday, July 13, 2026

.::: Sample Access Database MariaDB via Frontend & Backend using Lucee with accecc login Application.cfc, users save in table users :::

 

 
correlation https://teguhth.blogspot.com/2026/07/sample-access-database-mariadb-via.html

1. create user for login

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(50) NOT NULL,
    password VARCHAR(100) NOT NULL,
    nama VARCHAR(100),
    aktif CHAR(1) DEFAULT 'Y'
);

INSERT INTO users(username,password,nama,aktif)
VALUES
('admin','123456','Administrator','Y');

INSERT INTO users(username,password,nama,aktif)
VALUES
('aisyah','123456','Administrator','Y');

INSERT INTO users(username,password,nama,aktif)
VALUES
('teguh','123456','readonly','Y');

 

.::: How to Simulation Blocking,Lock, Locking Identifying and Avoiding Deadlocks MariaDB MySQL & Advanced PROCESSLIST Update Juli 2026 :::.

 
correlation 

https://teguhth.blogspot.com/2023/09/how-to-sample-simulation-blocking.html

1. SIMULASI LOCKING

Session 1 - root - session_id 3

select connection_id() as session_id, user() as user;
START TRANSACTION;
UPDATE pembelian 
SET JUMLAH_PEMBELIAN = 10 
WHERE KODE_PEMBELIAN = 'BEL-E001';

select connection_id() as session_id, user() as user; START TRANSACTION; UPDATE pembelian SET JUMLAH_PEMBELIAN = 10 WHERE KODE_PEMBELIAN = 'BEL-E001';

 
 

Friday, July 10, 2026

.::: Sample Access Database MariaDB via Frontend & Backend using Lucee with accecc login Application.cfc :::.

  
https://teguhth.blogspot.com/2026/02/sample-access-database-mariadb-via.html

Kalau tujuan Anda adalah setiap kali membuka:

http://10.10.10.90:8888/pembelian_front.cfm

maka pengguna harus login terlebih dahulu, saya sarankan menggunakan Session Login. Cara ini lebih sederhana dibanding CFLOGIN dan umum dipakai di Lu

1. Struktur file

root@teguhth-all ROOT]# pwd
/opt/lucee/tomcat/webapps/ROOT
[root@teguhth-all ROOT]#
[root@teguhth-all ROOT]# ls -lh Application.cfc login.cfm logout.cfm pembelian_front.cfm pembelian_api.cfm
-rw-r--r-- 1 root root  744 Jul 10 15:06 Application.cfc
-rw-r--r-- 1 root root 1.1K Jul 10 14:57 login.cfm
-rw-r--r-- 1 root root   76 Jul 10 14:57 logout.cfm
-rw-r--r-- 1 root root  296 Jul 10 15:07 pembelian_api.cfm
-rw-r--r-- 1 root root  912 Jul 10 15:09 pembelian_front.cfm
[root@teguhth-all ROOT]#

 

Thursday, July 9, 2026

.::: SOP Restore table production without lost data in MariaDB :::.

 

1. server

source 
ip         : 10.10.10.90 
db         : teguhthdb
table    : pembelian 

destination
ip         : 10.10.10.90 
db         : teguhth
table    : pembelian 
 
 

Friday, June 19, 2026

.::: Check progress restore status MariaDB MarinaDB :::.

  

1. check folder size

watch du -s /var/lib/mysql/teguhth
 

 

.::: Check dbsize MariaDB using ls -h OS, with & exclude table :::.

 

correlation https://teguhth.blogspot.com/2025/12/script-check-size-database-base-on-size.html

1. check dbsize full 

sh cek_teguhth.sh

[root@teguhth-all ceksizemaria]# cat cek_teguhth.sh
#!/bin/bash

BASE_DIR="/var/lib/mysql/teguhth"

echo "Database Directory Size Report"
echo "=============================="
printf "%-25s %10s\n" "FOLDER" "SIZE"
echo "------------------------------"

du -sh ${BASE_DIR}/* 2>/dev/null | sort -h | while read size folder; do
    printf "%-25s %10s\n" "$(basename "$folder")" "$size"
done

echo "------------------------------"
echo "TOTAL:"
du -sh "$BASE_DIR" | awk '{print $1}'
[root@teguhth-all ceksizemaria]#
 

Friday, June 12, 2026

.::: Script check IP NAS Mounting in fstab for trouble shooting :::.

 


1. check df -h 
 

2. cek simple 


[root@teguhth8 cekfstab]# more cek_mounting_simple.sh
for ip in $(grep -v '^#' /etc/fstab | awk '$3=="nfs"{print $1}' | cut -d: -f1 | sort -u)
do
    ping -c 1 -W 1 $ip >/dev/null
    if [ $? -ne 0 ]; then
        echo "DOWN: $ip"
    fi
done
[root@teguhth8 cekfstab]#
 

3. check all ip 

[root@teguhth8 cekfstab]# cat cek_mounting_allip.sh
#!/bin/bash

for ip in $(grep -v '^#' /etc/fstab | awk '$3=="nfs"{print $1}' | cut -d: -f1 | sort -u)
do
    if ping -c 1 -W 1 $ip >/dev/null 2>&1
    then
        echo "UP   : $ip"
    else
        echo "DOWN : $ip"
    fi
done
[root@teguhth8 cekfstab]#

Tuesday, May 5, 2026

.::: bat script to simulate pararel query thread or Injector CPU in MSSQL SQL Server :::.

 

1. create script cpu_injector_mssql.bat  

@echo off
setlocal enabledelayedexpansion

REM ===== CONFIG DATABASE =====
set DB_HOST=10.10.10.7
set DB_PORT=1433
set DB_USER=sa
set DB_PASS=P@ssw0rd
set DB_NAME=teguhth

REM ===== QUERY =====
set QUERY=SELECT 'CPU Injector by Teguh Triharto',WAITFOR DELAY '00:00:00.001';
 

Thursday, April 30, 2026

.::: Install Maxscale 25 Trial with license license_key (maxscale: The mandatory parameter 'license_key' is not provided) :::.

 

1. Downlaod Maxscale & license 

https://mariadb.com/downloads/community/maxscale-trial/ 
https://customers.mariadb.com/license/maxscale-trial/

2. Install 
tar -xvf maxscale-25.10.2-trial-release.rocky.9.x86_64.tar

yum install maxscale-common-25.10.2-1.rhel.9.x86_64.rpm -y
yum install maxscale-maxctrl-25.10.2-1.rhel.9.x86_64.rpm -y
yum install maxscale-trial-25.10.2-1.rhel.9.x86_64.rpm -y


3. Try start & enable automatic

[root@teguhth-ha03 data]# systemctl status maxscale.service
× maxscale.service - MariaDB MaxScale Database Proxy
     Loaded: loaded (/usr/lib/systemd/system/maxscale.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Wed 2026-04-22 15:28:47 WIB; 2min 23s ago
    Process: 13163 ExecStart=/usr/bin/maxscale (code=exited, status=1/FAILURE)
        CPU: 72ms
 

Tuesday, April 28, 2026

.::: Command remote access mongodb using mongosh, authenticationMechanism SCRAM-SHA-256, authenticationMechanism SCRAM-SHA-1 :::

 .
https://teguhth.blogspot.com/2024/04/backup-restore-database-mongodb-using.html

1. console admin 

mongosh -u admin -p admin --authenticationDatabase admin

[root@teguhth-all ~]# mongosh -u admin -p admin --authenticationDatabase admin
Current Mongosh Log ID: 69f05c29e551710562d805da
Connecting to:          mongodb://<credentials>@127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&authSource=admin&appName=mongosh+2.8.1
Using MongoDB:          8.0.20
Using Mongosh:          2.8.1
mongosh 2.8.2 is available for download: https://www.mongodb.com/try/download/shell

For mongosh info see: https://www.mongodb.com/docs/mongodb-shell/

------
   The server generated these startup warnings when booting
   2026-04-28T14:01:22.306+07:00: For customers running the current memory allocator, we suggest changing the contents of the following sysfsFile
   2026-04-28T14:01:22.306+07:00: We suggest setting the contents of sysfsFile to 0.
   2026-04-28T14:01:22.306+07:00: We suggest setting swappiness to 0 or 1, as swapping can cause performance problems.
------

test>

 

Friday, April 24, 2026

.::: Read Json file using OPENJSON, OPENROWSET in SQL Server :::.


 

1. copy json sample to disk C:\bcp\teguhth.pembelian.json
 
 



2. only read json 

 

Thursday, April 23, 2026

.::: Export MSSQL SQL Server to csv using OPENROWSET :::.

 

https://teguhth.blogspot.com/2025/12/backup-restore-table-sql-server-using.html

https://teguhth.blogspot.com/2026/04/sample-lab-using-openrowset-in.html

1. create excel dummy with header save as "openrowsori.xlsx"
 

2. replace openrows.xlsx (


copy openrowsori.xlsx openrows.xlsx

Karena Excel (via Microsoft ACE OLEDB):

tidak support DELETE
tidak support TRUNCATE
tidak support OVERWRITE

Friday, April 17, 2026

.::: Command Check top service, Top Memory in Linux (Centos 9, Rhel 9, Almalinux 9 include grouping & size memory & count proccess ) Top Process

 
1. total Service group 

ps -eo comm | sort | uniq -c | sort -nr | head

[root@teguhth ~]# ps -eo comm | sort | uniq -c | sort -nr | head
     13 sshd
     10 postgres
      8 nfsd
      5 metricbeat
      4 kworker/R-xfs-c
      4 kworker/R-xfs-b
      4 bash
      3 systemd
      3 filebeat
      2 sort
[root@teguhth ~]#

 

Popular Posts