16 November 2016

Android phones made in China come with spyware

China made android phones have been found to contain spyware that sends your data to the Chinese government.
The malware is part of pre-installed apps made by Shanghai Adups Technolog, supplying software to ZTE and Huawei. It was found on the low budget phones made by these companies for the USA BLU phone brand.

9 November 2016

Oracle and ANSI SQL

ISO SQL is a rather weak standard.
First you can not get it unless you pay for it, which is not a good thing if you want your standard to be succesful. You can find draft versions of the latest SQL 2011 on the web however.
Second there is no official independent compliance verification.

Appendix B of the Oracle Database SQL language reference gives a detailed overview of Oracle standard compliance.

In oracle you can set the FLAGGER variable, to verify whether your command complies with the standard. It only checks compliance with the ISO SQL/92 standard though:


Finally, here's a neat overview of compatibility of SQL statements for the most popular databases.

22 September 2016

Excel: sort text as a date

You'd think that setting the format of an excel cell to date is sufficient to have excel treat it as such, but alas that's not the case.
The easiest way to do this (better than the microsoft support tips) is on superuser: abuse data>text to columns, to let excel parse and store as a date.

18 August 2016

Cygwin ssh: Could not create directory '/home/myuser/.ssh'.

When first running ssh from cygwin 2.5.2, the .ssh directory to store trusted host keys could not be created.
ssh still works OK, but each time it prompts you to accept the host you are connecting to:

Could not create directory '/home/myuser/.ssh'.
The authenticity of host 'myserver (168.250.1.174)' can't be established.
ECDSA key fingerprint is SHA256:eSpqYAq2c7k843RfqpbpvK9F118XsKCArBdBheRN8c0.
Are you sure you want to continue connecting (yes/no)?
Reason is that ssh does not find your home directory. Easiest solution is to point it to your windows home directory. To do this, add this line to your_cygwin_install_dir\etc\nsswitch.conf file:

db_home: /%H

16 August 2016

Oracle Virtual box extensions install fails with VERR_ACCESS_DENIED due to McAfee

Installing Virtual Box 5.1.2 extensions on windows 10 failed with this error:

VBoxExtPackHelperApp.exe: error: Failed to rename the temporary directory to the final one: VERR_ACCESS_DENIED ('D:\Program Files\Oracle\VirtualBox\ExtensionPacks\Oracle_VM_VirtualBox_Extension_Pack-_-inst-4288' -> 'D:\Program Files\Oracle\VirtualBox\ExtensionPacks\Oracle_VM_VirtualBox_Extension_Pack')
After seeing several people on the net pointing to the antivirus, I disabled the McAfee real time virus scanning that came for 1 year with my Dell PC:
  1. Right click System Tray McAffee LiveSafeIcon
  2. Change Settings > Real Time Scanning
  3. Turn off
    1. Leave In 15 minutes
Then I reran the extensions installer and all went well.

12 August 2016

Oracle SQLDeveloper connection fails / TNS listener not starting

I had a problem today connecting to my Oracle express database from SQL Developer on Windows 10 with the error: The network adapter could not establish the connection.
Connection did work from SQL*PLUS (Run SQL Command line).
The OracleXETNSListener service was stopped in my services and restarting it did not work.
Turns out the problem was that I changed my computer name yesterday and the service does not use localhost, but the computername.
To solve this I changed the hostname in these files:
%ORACLE_HOME%\app\oracle\product\11.2.0\server\network\ADMIN\listener.ora
%ORACLE_HOME%\app\oracle\product\11.2.0\server\network\ADMIN\tnsnames.ora
Stopped/started the database and everything's fine.

Saw these alternate solutions (did not test):
solution 1: Add the old hostname to C:\Windows\System32\drivers\etc\hosts
solution 2:

SQL> alter system set LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))' scope=both;
SQL> alter system register;