As a full-stack developer in LAMP, I often play-around with Linux servers.
Unfortunately, there are always some reason that I can’t switch to Linux development machine.
E.g. Windows only printer drivers, Adobe Software, exe…
However, Windows cmd/PowerShell always disgust me for their special syntax.
And I missed Unix-like CLI tools such as (
ssh…) so much.
Plus you can’t use
id_rsa format in Windows directly (You will need putty, a GUI tool for CLI… and you need to convert all your keys)
So today we will get those lovely tools back, on Windows!
(Does NOT require Windows 10 Ubuntu Bash, should work on any supported version of Windows)
Continue reading “[Windows Bash] Using bash in Windows”
In a recent project, I am finding way to display current git branch on the backend dashboard.
Without a application dependent library, executing CLI
git seems to be the fastest way.
i.e. The exactly same syntax as we use in bash/cmd/powershell.
$currentBranch = exec('git rev-parse --abbrev-ref HEAD');
However, it worked in production/staging Linux machine, but not in local Windows machine.
It does work if I specify the absolute path
C:\Program Files\Git\bin\git.exe, but it’s not optimal because it will be machine dependent.
After a while, I figure out the environment
PATH variable is missing in Windows that cause
git not being picked up.
The trick is, add this line before
exec call to:
putenv('PATH=' . $_SERVER['PATH']);
Galera Cluster have some limitations, for example all tables MUST have primary key.
In recent version,
pxc_strict_mode is introduced to avoid unsupported features that can risk your data and server stability
One common trap is that SQL file exported with phpMyAdmin create index AFTER creating the table and inserting data.
During import, there is a transit state that table have no primary key and data need to insert to table, thus trigger the
#1105 - Percona-XtraDB-Cluster prohibits use of DML command on a table (database.table) without an explicit primary key with pxc_strict_mode = ENFORCING or MASTER
Continue reading “MySQL Percona Galera Cluster with phpMyAdmin export”