2022

Solved Datatables CSV import using join table

The Problem : Dot nation Problem 1 Problem 2 Solution function ref(obj, str) { return str.split(“.”).reduce(function(o, x) { return o[x] }, obj); } var mapped = ref(data, field.name()); Using this way to read { tablename: { field1, field2 } } It will turn to read tablename.field1 and tablename.field2 Modified Code from Official CVS Import CVS Import selectEditor.on(‘submitComplete’, function (e, json, data, action) { // Use the host Editor instance to show a multi-row create form allowing the us[…]

Solved Datatables CSV import using join table Read More »

Use of undefined constant STDOUT – assumed ‘STDOUT’ (this will throw an Error in a future version of PHP)

Error from loading CLI script in Web Use of undefined constant STDOUT – assumed ‘STDOUT’ (this will throw an Error in a future version of PHP) Solution if(!defined(‘STDIN’)) define(‘STDIN’, fopen(‘php://stdin’, ‘rb’)); if(!defined(‘STDOUT’)) define(‘STDOUT’, fopen(‘php://stdout’, ‘wb’)); if(!defined(‘STDERR’)) define(‘STDERR’, fopen(‘php://stderr’, ‘wb’));

Use of undefined constant STDOUT – assumed ‘STDOUT’ (this will throw an Error in a future version of PHP) Read More »

How to export mysql or mariadb data from docker

List running dockers that running with mysql or mariadb juzhax@Justins-MacBook-Air ~ % docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7e49a319857c mariadb “docker-entrypoint.s…” 24 hours ago Up 21 minutes 0.0.0.0:54482->3306/tcp wp-env-mysql-1 Access CLI to mariadb container docker exec -it 7e49a319857c /bin/bash Dump data using mysqldump mysqldump -uroot -p wordpress > /tmp/wordpress.sql Then exit the CLI. Copy the data from docker out docker cp 7e49a319857c:/tmp/wordpr[…]

How to export mysql or mariadb data from docker Read More »

Usage of wp_add_inline_style and wp_add_inline_script in WordPress

3 regular usages of wp_add_inline_style and wp_add_inline_script Add CSS Style without dependency wp_register_style( ‘wp-juzhax-css’, false ); wp_enqueue_style( ‘wp-juzhax-css’ ); wp_add_inline_style( ‘wp-juzhax-css’, “body *{ box-sizing: inherit; }”); Add JavaScript Code without dependency wp_register_script( ‘wp-juzhax-js-header’, ”,); wp_enqueue_script( ‘wp-juzhax-js-header’ ); wp_add_inline_script( wp-juzhax-js-header’, “console.log(‘loaded in header’);”); Add JavaScript Code with jQuery de[…]

Usage of wp_add_inline_style and wp_add_inline_script in WordPress Read More »

/user.slice/user-1000.slice/session-2145.scope is not a snap cgroup

Chromium Browser in Ubuntu Recently, I need to use headless Chromium Browser to running bot for some purpose, but it is not smooth as the documentation says. Error while using headless Chrome $ /usr/bin/chromium-browser –help /user.slice/user-1000.slice/session-2145.scope is not a snap cgroup Installing dbus-user-session # sudo apt-get install dbus-user-session Reading package lists… Done Building dependency tree… Done Reading state information… Done dbus-user-session is already the newes[…]

/user.slice/user-1000.slice/session-2145.scope is not a snap cgroup Read More »

How to modify docker php.ini without installing editor

Editor Not found Recently I would like edit the php.ini in Bitnami WordPress Docker using CLI, but inside the docker doesn’t contain any editor and apt-get is not allowed me to install any editor. $ vim /bin/sh: 1: vim: not found $ vi /bin/sh: 2: vi: not found $ nano /bin/sh: 3: nano: not found $ Modify the upload limit for PHP I want to upload a file more than 800M, I’ve to apply these to php.ini upload_max_filesize 1000M post_max_size 1000M memory_limit 1000M max_execution_time 0 max_input_tim[…]

How to modify docker php.ini without installing editor Read More »

Installing Bitnami WordPress Nginx into Apple m1

Preparing Folders Prepare the a project folders that put your mariadb data and Wordpress files data. # cd ~ # mkdir wp # cd wp # mkdir mariadb # mkdir wordpress The folders we need /Users/juzhax/wp /Users/juzhax/wp/mariadb /Users/juzhax/wp/wordpress Preparing the Docker Compose file touch /Users/juzhax/wp/docker-compose.yml Insert the data using your favorite editor. I like to use vim vim /Users/juzhax/wp/docker-compose.yml version: ‘2’ services: mariadb: image: docker.io/bitnami/mariadb:10.6 vo[…]

Installing Bitnami WordPress Nginx into Apple m1 Read More »

Operation not supported: AH00023: Couldn’t create the mpm-accept mutex

Starting up Recently I install the Bitnami WordPress on Apple MacBook Air M1, after WordPress setup finished, the error appeared after the Starting Apache The Errors (95)Operation not supported: AH00023: Couldn’t create the mpm-accept mutex (95)Operation not supported: could not create accept mutex The fixes Using a Dockerfile with the contents: FROM bitnami/moodle # Some credit goes to: https://www.linode.com/community/questions/16977/server-fails-after-installing-certbot-mpm-run-failed-exiting[…]

Operation not supported: AH00023: Couldn’t create the mpm-accept mutex Read More »