sleepbot-to-sleep_as_android is Released!

I was a user of Sleepbot since 2013. However it was abandoned by the developer later on and no more new release for a few years. I tried to check their blog but no reason found behind this.

Anyway I was still using Sleepbot until my Nexus 5X was dead, due to the infamous bootloop (but what the news said, LG did repaired my phone) and I lost a month of data even I have do regular backup. Coincidentally I saw Sleep as Android on the editor choice of Google Play a few days ago before the phone dead, so I decided to switch to something else.

After comparing with Sleep as Android and Sleep Better with Runtastic, I decided to got for Sleep as Android because what I need is just sleep tracking, I don’t need alarm and it seems Sleep Better with Runtastic has no way use sleep tracking without an alarm.

So now I am using Sleep as Android, and then I did a quick search to see if there is any methods to import the data from Sleepbot. In the documentation, it did mention someone made a Ruby script for import data, which convert the exported file from mysleepbot.com. However I didn’t use cloud save so it just doesn’t work for me. So based on that script, I wrote my own version which convert the exported file from the app itself instead to a file that can be imported in Sleep as Android. So that is the why the script is here. The reason why I used Python is just because I have very little knowledge with Ruby.

Enough for the background information. Anyway you can find the script and more technical details at the project page.

 

PS: I just found that there is no annual report from WordPress in year 2016!

Visual Studio Code Zip / Portable Version for Windows

Recently I was given an exercise to work on Node.js. A few years ago I was using Aptana Studio on Node.js. So after these few years I guess there should have some IDE or editor available for Node.js. So I ended up found Visual Studio Code and Atom.

I tried both Visual Studio Code and Atom, and I choose Visual Studio Code at this moment because the autocomplete suggest is much more better than Atom.

For software that I use, I usually prefer portable version. I found someone has made one, but I don’t like unofficial release. I looked again and lucky found a post here which mentioned that there is a portable version of Visual Studio Code.

After further checking, it is actually a zip version and officially the download link is located deep inside the FAQ section of Visual Studio Code.

Anyway for those who like no installer version, below is the link to download it directly.

http://code.visualstudio.com/docs?dv=winzip

Edit 2016-08-13: Finally the they have provided the Zip archive download link in their download page.

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.

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.

Open Video File using omxplayer on Raspberry Pi without Terminal

I was trying to make Raspberry Pi running Raspbian OS to turn it as a media player with can play video without using a keyboard so that it is portable for a trip.

The only software that allow video playback on Raspbian is omxplayer. It is a command line tool and therefore need a keyboard to start playing video. Searched on the Internet and found that it is possible create an application, allowing you to play the video via right clicking the video file and choosing the application to open. However most of scripts included in the Internet are not working on my Raspbian. After a long research I finally figured out a working one.

Later on, I actually found that there other OS such as Raspbmc, OpenELEC which is actually designed turn Raspberry Pi to be a media center and I have another Raspberry Pi for that now. Anyway below are the steps to create applications for video playback on the LXDE desktop environment on Raspbian OS:

  1. Create a file with the following content at /usr/share/applications/omxplayer-hdmi.desktop. This will allow you to hear the sound output to HDMI.
    [Desktop Entry]
    Name=OMXPlayer (HDMI)
    Type=Application
    Categories=AudioVideo;Player;
    Exec=lxterminal --command "sudo omxplayer -r -o hdmi %f"
    Terminal=false
    Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png
  2. Create a file with the following content at /usr/share/applications/omxplayer-local.desktop. This will allow you to hear the sound output to the 3.5mm audio jack.
    [Desktop Entry]
    Name=OMXPlayer (3.5mm)
    Type=Application
    Categories=AudioVideo;Player;
    Exec=lxterminal --command "sudo omxplayer -r -o local %f"
    Terminal=false
    Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png

Enabling “Clean Solution” Option in Visual Basic 2010 Express

  1. Under the Tools menu, go to the submenu Settings and switch to Expert Settings. The Build menu should be available by now, but Clean Solution menu item is still missing.
    Switch to "Expert Settings"

    Expert Settings

    Build Menu

    Build Menu

  2. Under the Debug menu, click Options and Settings.

    "Options and Settings" Menu Item

    "Options and Settings" Menu Item

  3. Under Project and Solutions item, inside the General item, check the check box for Always show solution. Press OKto exit.

    "Always show solution" Option

    "Always show solution" Option

  4. In the Build menu again, the Clean Solutionmenu item should be there finally.

    "Clean Solution" Menu Item

    "Clean Solution" Menu Item

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