15
Mar 16

Google Authenticator code rejected

I had an issue with Google Authenticator earlier, whereby the generated code was rejected by my Synology DiskStation. It was all fully set up and worked fine, so was surprised when it failed. Fortunately, there is the option to fallback to email verification.

Having logged back into the DSM, I tried to reset the 2-step verification setup, but that too failed. I then noticed that the time is off compared to my iPhone, where Google Authenticator is running. My DSM was previously syncing against time.google.com. Switching it to time.nist.gov solved the issue.


05
Mar 16

Mixing powerline adapters

The wireless router had to be moved recently. As a result, I needed to expand the powerline network that was in place. I had the TP-LINK TL-PA4020 Kit, and it worked well. I used one adapter in the lounge for the router and NAS drive, and the other in the bedroom for the laptop. With the router moving, but the NAS drive staying put, I needed an extra powerline adapter. This time I opted for the TP-LINK TL-PA7020P Kit.

The TL-PA7020P adapters are dual ports, like the TL-PA4020. However, the TL-PA7020P have an integrated power socket, which means you don’t lose the use of a wall socket. Additionally, they are AV1000, whereas the TL-PA4020 adapters are only AV500. The AV rating referring to the speed the adapters are capable of. I had doubts whether I will get the full benefits of the AV1000 adapters when I mix them with AV500. So, I decided to run a few simple tests. In short, you do benefit from the faster speed of the AV1000 adapters.

I tested the following three configurations, to determine the file transfer speeds that can be achieved from the NAS drive to the laptop.

  1. With the laptop connected to an AV1000 adapter, the NAS drive connected to an AV500 adapter, and the router disconnected, it managed speeds of up to 49 Mbps.
  2. With the laptop connected to one AV1000 adapter, the NAS drive connected to the second AV1000 adapter, and the router disconnected, it managed speeds of up to 83 Mbps.
  3. With the laptop connected to one AV1000 adapter, the NAS drive connected to the second AV1000 adapter, and the router connected to an AV500 adapter, it managed varying speeds from 51 up to 73 Mbps.

Based on the above, it appears that the AV500 adapter will slow down the powerline network if it is actively transmitting. When it’s not, the AV1000 adapters can communicate at the faster speed that they are capable of.


05
Sep 15

TP-LINK TL-PA4020 Kit review

Until fairly recently, I have not thought much of powerline adapters.

Several weeks ago, I moved my entire photo collection from a portable USB drive onto the Synology DiskStation. That’s when I unwittingly created a problem. Wireless network has a much lower bandwidth compared to USB 3.0 connection. Adobe Photoshop Lightroom became unusable because it’s trying to load thousands of photos over the wireless connection. That’s when I started looking into powerline adapters.

As the name suggests, these adapters make use of the electric wiring to create a network, eliminating the need to route long unsightly network cables around the home. I was a little doubtful initially about how well the adapters would perform. Not wanting to spend too much, I opted for the entry level TP-LINK TL-PA4020 Kit, which retails for less than £30 on Amazon.

Having used the kit for several weeks now, I’m thoroughly impressed with how well it works. I have one adapter in the lounge, and the other in the bedroom. I don’t know how the flat is wired up behind the walls, but would guess there is probably around 30 metres of wiring between the two wall sockets. The connection is fast and reliable. The TL-PA4020 has dual ports on each adapter. As the powerline network functions like an ethernet hub, the bandwidth is shared between both ports. Additional adapters can be added as well if necessary.

The recommendation is that the adapters are plugged directly into the wall socket. According to reports online, it will not function at all in some multi-way power sockets. I have tried using them in 3 different 4-way power sockets and they do work; albeit at reduced speed. If that is a concern, there are other slightly more expensive models that have a power socket on them, which means you do not end up losing a wall socket.


18
Aug 15

Synology DS malware was detected

This morning, I received an email from my Synology DiskStation informing that a malware had been detected during a security scan. It caused a slight panic. Luckily, it was because I had accidentally modified a couple of files when I was investigating the Python pip3 issue yesterday. In a way, it is good to know that there is built in security feature to detect such tampering.

The only problem then is how do I go about restoring the tampered files; as I do not have backup copies of the files. I am not sure if it detected the change in timestamp, size or content of the files, further complicating the restoration process. Luckily, I found an official Synology site which has all the releases of DSM 5.2-5592. From there, I was able to locate the correct package for my DiskStation, and extract the files that I had accidentally modified. I restored the original files, and a quick security scan showed that all is well again.


17
Aug 15

Where is pip3?

I have recently been trying to set up Python 3 on my Synology DiskStation. The Python installation is very straightforward, using the Package Center in Synology DSM. However, I ran into issues when trying to install Python pip, which is needed for installing the MySQL Connector module.

The first step to installing pip is to download the get-pip.py script. Once downloaded, I copied the script to the DiskStation and executed it in a command prompt, as root. The command to install pip is:

> python3 get-pip.py

The installation completed successfully, including all the required dependencies. At this point, I expected pip3 to be installed. However, the only version of pip I can find on the system is pip2.

> pip --version

After some searching online, I discovered that instead of calling pip or pip3 directly from the command prompt, it is possible to access the pip functionality as follow. This enabled me to install the MySQL Connector module for Python 3.

> python3 -m pip install --allow-external mysql-connector-python mysql-connector-python

25
Jun 14

Set DCOM transaction timeout programmatically

The DCOM transaction timeout setting is one of several Windows settings that I commonly have to tweak for the applications that I work with. The following is a VBScript for setting the transaction timeout value programmatically. To use, simply save the code snippet in a .vbs file.

Set oCatalog = CreateObject("COMAdmin.COMAdminCatalog")
Set oRootColl = oCatalog.Connect("localhost")
 
Set oLocalComputerColl = oRootColl.GetCollection("LocalComputer", oRootColl.Name)
oLocalComputerColl.Populate
 
Set oLocalComputer = oLocalComputerColl.Item(0)
oLocalComputer.Value("TransactionTimeout") = 120
 
oLocalComputerColl.SaveChanges

For other COM settings that can be set programmatically, please try the vApps COM+ Explorer utility.


27
Nov 13

MacBook price comparison by country

Ever wondered where is the cheapest place to buy a MacBook? Well, I have a few trips coming up and thought I should compare the prices between the different countries. The following comparison is based on the 13-inch 2.6 GHz with Retina display model.

  Price without VAT  
Country CCY RRP Local VAT Local CCY USD FX Rate
Canada CAD 1,849 * 1,849 1,753.72 0.94847
Hong Kong HKD 13,888 N/A 13,888 1,791.41 0.12899
United States USD 1,799 * 1,799 1,799.00 1.00000
Australia AUD 2,199 200 1,999 1,824.65 0.91278
Malaysia MYR 5,899 N/A 5,899 1,831.70 0.31051
Singapore SGD 2,488 163 2,325 1,858.02 0.79915
United Arab Emirates AED 7,199 N/A 7,199 1,959.93 0.27225
New Zealand NZD 2,799 366 2,433 1,994.14 0.81962
United Kingdom GBP 1,499 250 1,249 2,024.77 1.62111

NOTES

  • The regular retail prices (RRP) are inclusive of the local VAT amount, where known.
  • Canada and United States have VAT that varies by location, and is thus marked unknown.
  • The USD prices without VAT are based on the XE.com exchange rates on 26 Nov 2013.
  • Most countries operate a tourist VAT refund scheme. Therefore, if you purchase the item while on holiday, you can save on the VAT. However, upon returning to your country of residence, you may have to pay custom duties and/or local VAT.

22
Oct 13

Casio Edifice Wave Ceptor

Casio Edifice Wave Ceptor

This is currently my everyday watch. Actually, it’s my only watch. I find the world time feature really handy for travelling, as it makes it really easy to adjust the time when crossing timezones.

The radio-controlled time synchronization feature ensures the time is always accurate. The signal in London is really good. The watch has had no issues synchronizing every night. When travelling around Europe, I find the watch wasn’t able to synchronize as reliably. It could well be because I was staying in densely populated concrete jungles.

The watch also sports a stopwatch, timer, and alarm; though I almost never use them. I would happily trade them for a compass function though. I was actually considering the Tissot T-Touch series because of that, but ended up settling for the Casio Edifice because of the aesthetics. Some people are concerned about the black coating getting scratched; but I’ve had mine for nearly four months now and there are no visible scratches.


04
Aug 13

Blackbox diagnostics

Earlier this year, I made the switch from development to consulting. This brought on a whole new set of challenges; one of which is diagnostics. As a developer, if there is an issue, you set a few breakpoints, reproduce the issue, step through the source code, and figure out what the problem is. As a consultant, you typically don’t have the luxury of source code. Debuggers can be hard to come by. You just have to make do with what you’ve got. Luckily, there are a few trustworthy tools that can typically be loaded onto an environment to help with the troubleshooting.

Process Explorer

Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded. Process Explorer is useful for tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Process Monitor

Process Monitor is an advanced monitoring tool for Windows that shows real-time file system, registry, process and thread activity. It combines the features of two legacy Sysinternals utilities, Filemon and Regmon, and adds an extensive list of enhancements including rich and non-destructive filtering, comprehensive event properties such session IDs and user names, reliable process information, full thread stacks with integrated symbol support for each operation, simultaneous logging to a file, and much more.

It is useful for narrowing down the point of failure. Missing files and registry keys, as well as permission issues can be easily identified with this tool.

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

DebugView

DebugView is an application that lets you monitor debug output on your local system, or any computer on the network that you can reach via TCP/IP. It is capable of displaying both kernel-mode and Win32 debug output, so you don’t need a debugger to catch the debug output your applications or device drivers generate, nor do you need to modify your applications or drivers to use non-standard debug output APIs.

http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

SQL Profiler

If you suspect issues at the database level, such as blocking and deadlocks, the SQL Profiler is the best bet. The SQL Profiler is part of the SQL Server Management Studio.

Wireshark

Wireshark is a network protocol analyzer. It is useful for capturing and analysing network traffic.

http://www.wireshark.org/

.NET Framework Tools

The .NET Framework tools are part of the .NET SDK and are invaluable for analyzing .NET related issues.

  • Fusion Log Viewer (fuslogvw) is great for identifying .NET binding issues, such as missing DLLs.
  • Corflags Conversion Tool (corflags) can be used to force an application to run in 32-bit mode.

Download .NET Framework 4.0 Tools

Debug Diagnostic Tool

The Debug Diagnostic Tool (DebugDiag) can capture and analyse process dumps for application crashes, application hangs, and memory leaks. It can also be configured to log stack traces on first and second chance exceptions; really useful for situations where the application swallows the exceptions.

http://www.microsoft.com/en-us/download/details.aspx?id=26798

Beyond Compare

This is not free, but it is a really good file and folder comparison tool. It is great for when you have a reference point (eg: a known good implementation). It can be used to identify missing or outdated files, as well as incorrect configurations.

http://www.scootersoftware.com/

.NET Reflector

Most .NET assemblies can be decompiled to produce the source code. While not the original, the decompiled source code is easily readable. This ability does come at a price. The later versions of the tool even enable users to step through the code; though I’ve never tried it myself.

http://www.red-gate.com/products/dotnet-development/reflector/


23
Aug 12

NCover vs dotCover

Code coverage is a very important metric in a continuous deployment process, to ensure there is sufficient test coverage in place. NCover and JetBrains dotCover are two popular .NET code coverage tools.

NCover has been around longer than dotCover. This is evident in the amount of features that NCover has. NCover has better support for scripting. Data collection, manipulation, analysis, and reporting can all be driven through a command line interface. It records trends, is capable of profiling Windows services, and can produce various reports in HTML format, which are some of our primary requirements.

dotCover’s strong point is its Visual Studio integration. It is easier to setup compared to NCover. It can show the lines of code covered directly in the Visual Studio IDE; whereas NCover presents this information in its own GUI.

We currently employ both these tools in our continuous deployment environment. The automated Jenkins build uses NCover to produce a HTML code coverage report of our entire test suite, which we then publish onto a web server, where it is accessible to all developers. Running NCover on the build machine significantly cuts down the licensing costs. As there is currently a huge project underway that sees a lot of new tests being developed, developers can benefit greatly from the rapid feedback that dotCover provides. Several developers who are actively developing tests have dotCover on their machines. For the long term, we envisage NCover alone should be sufficient.