AKZN Notes

Archives for My Lazy and Forgetful Mind

Category: Mysql

how to log mysql query that has long time to execute

To log slow-running MySQL queries, you can enable the Slow Query Log feature in MySQL. This log will record all queries that take longer than a specified amount of time to execute. Here’s how to set it up: Step 1: Enable Slow Query Logging To enable slow query logging, you need to modify the MySQL […]

Importing MySQL Gzipped Dump File via Terminal

Importing MySQL Gzipped Dump File via Terminal When dealing with MySQL databases, it’s common to export and import data for various reasons, such as backups or transferring data between environments. In this concise guide, we’ll focus on importing a gzipped MySQL dump file using the terminal on a system running Ubuntu. Step 1: Navigate to […]

Install Server Stack to Armbian for CVCMA

This article is my notes for step by step to install and configure set top box Armbian into kiosk device. List of Bugs browser failed to launch immediately solution : add sleep 60 before launching the browser display need to restart or reattach the hdmi cable if system rebooted. solution: use xrandr to relaunch the […]

Freeradius + Daloapi + mikrotik

Daloapi setting install freeradius (with mysql) and daloradius daloradius need php-pear and php-db sudo apt-get install php-common php-gd php-curl php-mail php-mail-mime php-pear php-db sudo pear install db deploy daloapi from git, setting database as same with freeradius setting, make sure daloapi database migration is set. after git deployment .env.example to .env configure db credential to […]

Install FreeRADIUS & daloRADIUS on Ubuntu 20.04 + MySQL/MariaDB

taken from https://bytexd.com/freeradius-ubuntu/ with a few update to support daloRADIUS with freeradius v3.0. (as is, daloradius only support freeradius v2, and accounting will error) (TBA) add mikrotik radius client (TBA) add tutorial sqlcounter daloradius scheme to freeradius In this tutorial we’ll install FreeRADIUS on a server running Ubuntu 20.04 and configure it to work with […]

RANDOM DATA Table Order

[MYSQL][PROCEDURE] RANDOM DATA Table Order tb_order DELIMITER $$ DROP PROCEDURE IF EXISTS make_order$$ CREATE PROCEDURE make_order () BEGIN DECLARE monthcounts INT DEFAULT 1; DECLARE daycounts INT DEFAULT 1; DECLARE orderbydaycounts INT DEFAULT 1; WHILE monthcounts < 9 DO SET daycounts = 1; WHILE daycounts < 31 DO SET orderbydaycounts = 1; WHILE orderbydaycounts < 5 […]

Generate Random Data Function with Mysql

Function Helper DROP FUNCTION IF EXISTS generate_fname; DELIMITER $$ CREATE FUNCTION generate_fname () RETURNS VARCHAR(255) BEGIN RETURN ELT(FLOOR(1 + (RAND() * (50-1))), "Deni","Desi","Dito","Femi","Hafid","Rizki","Utami","Aulia","Tika","Hadi","Bayu","Annisa","Retno","Fajar","Wulandari","Nurul","Rini","Ilham","Kusuma","Rizki","Dinda","Andre","Ari","Maria","Wahyu","Mila","Lia","Kartika","Indra","Eko","Kurniawan","Sari","Ajie","Sri","Tyas","Dian","Lestari","Maya","Ika","Arya","Yudi","Andy","Anthony","Siti","Rio","Sarah","Reza","Andi","Fitri","Nur","Ade","Agus","Tri","Indah","Dian","Putra","Muhammad","Dwi","Jeffrey","Melissa","Eric","Anna","Stephen","Andrew"); END$$ DELIMITER ; DROP FUNCTION IF EXISTS generate_lname; DELIMITER $$ CREATE FUNCTION generate_lname () RETURNS VARCHAR(255) BEGIN RETURN ELT(FLOOR(1 + (RAND() * (58-1))), "Bagaskoro","Bakti","Dewangga","Dharma","Danastri","Danurdara","Diajeng","Endaru","Endang","Elok","Erina","Estiana","Gadhing","Ganendra","Gardara","Martin","Gentala","Galih","Ganesh","Gibran","Guinandra","Gumelar","Gunawan","Guntur","Guritno","Gusti","Gahyaka","Gantari","Ihsan","Ismoyono","Indira","Intan","Isthika","Jamal","Janu","Jatmika","Jaya","Jenaka","Jenggala","Jumanta","Jumantara","Kamajaya","Karunia","Kawindra","Kresna","Garini","Gayatri","Gemani","Gemintang","Gempita","Ginanita","Hakim","Halim","Hamdan","Hanafi","Handaru","Hapsari","Hardana","Haribawa"); END$$ DELIMITER ; Example query SELECT generate_fname() AS […]