Error 1918 when Installing MySQL ODBC Connector 5.3.6 on Windows

It is somewhat a frustration that even the official website at the time of writing this doesn’t correctly list out the dependency software.

Anyway in short, make sure you have installed Visual C++ Redistributable Packages for Visual Studio 2013 if you are installing MySQL ODBC Connector 5.3.6.

The official website and many other website I found only mentioned to install Microsoft Visual C++ 2010 Redistributable Package. Some websites even gave an inappropriate installation instruction to user. Although Microsoft Visual C++ 2010 Redistributable Package might be required for older version of ODBC connector, but definitely not version 5.3.6.

Also, it is better if you are installing the latest version of Visual C++ as well. Many website I found (such as this, this, this and this) are still providing link to the old version of Visual C++ even a new version is already available at the time of their writing. You may check the latest version of Visual C++ at Microsoft website here but, even the official website cannot be trusted as I can find a more updated version of Visual C++ 2015 here at the time of writing this article…

In summary, trust yourself.

Advertisements

Building Ncat Portable for Windows

Background

I used to use telnet for testing if the firewall working properly in the office. Telnet is good for simple test, but when comes to testing a large number of destination IP and ports it will be very time consuming. After searching on the Internet I found Netcat, a tool for testing connection. It is build-in in most Linux OS but not on Windows. So I found Ncat here as part of the Nmap for Windows by nmap.org, but too bad that it won’t execute on some Windows as it requires Microsoft Visual C++ Redistributable Package installed.

A Ncat portable is an alternative, but the website only provided a beta version of Ncat 5.59BETA1, and require you to compile your own if you would like a newer version.

They did provide a documentation on how to compile Ncat with static linking library, but if you follow the steps you will encounter a few problems which you have to troubleshoot yourselves.

So here is my steps on compiling Ncat portable after I had gone through all the trouble.If you are someone who can edit the documentation on secwiki.org, please do that for me as I don’t want to get an extra account for just editing the document :)

If you want to avoid the trouble to compile, you can download the Ncat which I compiled here, however use it at your own risk as I might have inject some malware inside :)

Building Ncat Portable for Windows

Environment

The following steps has been tested using the following environment:

Steps

  1. First, follow all steps on the original documentation at https://secwiki.org/w/Nmap/Ncat_Portable till you copied the resulted static libs and include files from “C:\OpenSSL” to the “mswin32\OpenSSL” directory in the Nmap source tree in step 5. Below is a screenshot of the original documentation in case it is edited at the time you read this article.
    Building Ncat Portable
  2. Assuming that everything went fine till now, you’re about 7 steps away from building Ncat portable.
    1. Open Nmap solution in Visual Studio from mswin32\nmap.sln and switch the build configuration to “Ncat Static” like so:
      1. Right click on Solution “nmap” in the Solution Explorer sidebar and choose “Configuration Manager“.
      2. Switch the active solution configuration to “Ncat Static“. Check the “Build” check box for project “liblua“. Make sure that the nsock, nbase and ncat projects have switched to the “Static” configuration also. Then close the “Configuration Manager”.
      3. Right click on the ncat project and select “Set as StartUp Project“.
    2. Right click on the “nsock” project in Visual Studio and click “Properties“. In “Configuration Properties” > “General” > “C/C++” > “General“, in “Additional Include Directories“, add path “..\mswin32\OpenSSL\include
    3. Right click on the “ncat” project in Visual Studio and click “Properties“. In “Configuration Properties” > “General” > “C/C++” > “General“, in “Additional Include Directories“, add path “..\mswin32\OpenSSL\include” and “..\liblua
    4. Right click on the “ncat” project in Visual Studio and click “Properties“. In “Configuration Properties” > “General” > “Linker” > “General“, in “Additional Library Directories“, add path “..\mswin32\OpenSSL\lib
    5. Expand the “ncat” project, double click the file “ncat_ssl.c” and comment out the line “#include <openssl/applink.c>
    6. Right click on the “liblua” project in Visual Studio and click “Properties“. In “Configuration Properties” > “General” > “C/C++” > “Code Generation“, set “Runtime Library” to “Multi-threaded DLL (/MD)
    7. Right click on the “ncat” project in Visual Studio and click “Build“. Alternatively you can press the F7 key to start building.

Cannot Set Default Printer due to No Respone

Because the printer was replaced, I need to reconfigured all PC to remove the old printer and add the new printer. It is strange to find that out of 4 PC, 2 of them doesn’t work.

Problem:

On Windows 7 PC:

  1. Unable to delete the printer
  2. Unable to change the default printer

Finding:

After searching on the Internet and checking the difference between the working PC and not working PC, it looks like the 2 PC which has problem was inflected with malware before. The permission on the printer related registry was incorrectly set.

Solution:

  1. Run registry editor regedit
  2. Go to HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
  3. In the menu, select Edit > Permissions
  4. Click Advanced and make sure all permissions are inherited from CURRENT_USER

Workaround Inability in NAT Loopback on DD-WRT r15760 or above

Recently I found that my router running DD-WRT is not able to handle NAT loopback (Accessing router’s public IP from internal network). After searching through the Internet, I found this post mentioned that it is a problem in DD-WRT since revision r15760. It is stated that the problem will not be fixed. As a user, we can only apply workaround to the issue. Here are the steps:

  1. Make sure your DD-WRT version is r15760 or newer
  2. Navigate to your router administrator page
  3. Go to the Administrator section, Commands section
  4. In the Commands text box, input the following command:
    insmod ipt_mark
    insmod xt_mark
    iptables -t mangle -A PREROUTING -i ! `get_wanface` -d `nvram get wan_ipaddr` -j MARK --set-mark 0xd001
    iptables -t nat -A POSTROUTING -m mark --mark 0xd001 -j MASQUERADE
  5. Press the Save Firewall button. You should see the following screen:
    DDWRT NAT Loopback
  6. Reboot your router, the NAT loopback should be function now

Handle File Ended with dot Character in Windows

Sometimes you download a file from Internet and it become a file ended with dot character which cannot be opened, renamed and deleted. I found this article on the Internet with the solution. To be able to handle this, you have to use the special path format in the command prompt.

\\?\C:\path_to_your_file.

So for example, you want to delete the file, the command you will use is:

del \\?\C:\path_to_your_file.

Enabling MS SQL Remote Access

By default, MS SQL does not enable remote access after a clean install. To enable this:

  1. Launch Sql Server Configuration Manager

    Sql Server Configuration Manager

    Sql Server Configuration Manager

  2. Double click TCP/IP, in the Protocol tab under the General section, set the Enabled to Yes.
  3. In the IP Addresses tab, scroll to the button. In the IPAll section assign the port to TCP Port. To use MS SQL default port, assign it to 1433.

    TCP/IP Properties

  4. Finally, remember to set the firewall to allow the incoming TCP connection.

    Windows Firewall with Advanced Security