IDE1006 Naming rule violation

Thank you visual studio with your strange default settings, causing the error/warning all throughout my code: “IDE1006 Naming rule violation: These words must begin with upper case characters”.

Go Google, find this, and solve it actually like so:

  • By going to Tools > Options… > Text Editor > Basic > Code Style > Naming
  • Click ‘Manage Naming Styles’, add new style ‘camelCase’ (or whatever else you require), and save.
  • Set the Required Styles to camelCase and save by clicking OK
  • Thank You Microsoft!

Have a nice day!

Icepay cURL 60 SSL problem

To be precise, the error is: “Unable to reach the ICEPAY payment server (60):SSL certificate problem: unable to get local issuer certificate

The solution could be:

curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);

or, which also works in my case:

curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false);

Of course bypassing SSL security is never the correct option, but for a development server we all make exceptions sometimes.
Have a nice day!

Mac time synch

Using vmware I always suspend my mac-os machine, so the time at revival is never correct… so how to force a time-synch:

source: here

10.14 Mojave

Mojave still uses timed, but ntpdate and the helpers ntpq are removed. To check and update your system time, you can call sntp directly.

$ sudo sntp -sS pool.ntp.org
Password:
sntp 4.2.8p10@1.3728-o Tue Mar 21 14:36:42 UTC 2017 (136.200.1~2533)
2018-09-29 19:42:41.448103 (-0200) +1087.742403 +/- 725.183462 pool.ntp.org 188.68.36.203 s2 no-leap

Out of the box, a tracking file is missing. So if you get the error below when checking time:

kod_init_kod_db(): Cannot open KoD db file /var/db/ntp-kod: No such file or directory

create the file and change ownership to root. Some people reported this was actually breaking the ntp synchronization.

sudo touch /var/db/ntp-kod
sudo chown root:wheel /var/db/ntp-kod

Then run again to check if the error message is gone.

sudo sntp -sS pool.ntp.org

In case you have the same issue, i used to use the following commands before, but they hasn’t worked since whatever previous os version/update:

sudo ntpd -sS time.apple.com
sudo ntpdate -u time.apple.com

Have a nice day!

Data size troubles 1406

When the scripts start compaining, “[Native code: 1406] [Native message: Data too long for column …]”, check how much data you are actually trying to squeeze into a single field.
source: maximum length of data I can put in a BLOB column in MySQL?

BLOB ≈ 64KB,
MEDIUMBLOB ≈ 16MB and
LONGBLOB ≈ 4GB

Also: “The maximum size of a BLOB or TEXT object is determined by its type, but the largest value you actually can transmit between the client and server is determined by the amount of available memory and the size of the communications buffers.”
https://dev.mysql.com/doc/refman/8.0/en/storage-requirements.html

Row size too large (> 8126)

Error Code: 1118
Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

See the possible solutions here:
https://mariadb.com/kb/en/troubleshooting-row-size-too-large-errors-with-innodb/

Get your ‘create table’ sql code and add:

SET GLOBAL innodb_default_row_format='dynamic';
SET SESSION innodb_strict_mode=OFF;
Continue reading Row size too large (> 8126)