3 Nov 2021

Tenda Nova MW12 MW6 cannot connect to wireless printer on mesh network from wired computer

I have a home network on a TP-Link Archer C7 router, which I was using for WiFi, but also have some computers wired directly on ethernet connections. It's been a fairly reliable router, but the WiFi has never been great. 

I finally replaced the WiFi part of it using a 3-node Tenda Nova MW12 mesh system. To do this, I plugged the primary Tenda node into one of the ports on the router. Then I placed the other Tenda nodes around the house, turned off the old router's wireless function, and we were off! Well, after changing the SSID of the Tenda mesh to be the same as the old router's SSID, with same password, so I wouldn't have to update the wireless connection details on all the devices around the house...

Anyway, all was fine until I wanted to print to my wireless HP M252DW printer, from one of the computers that were still wired to the old router. My windows machine could no longer see the wireless printer on the network. Turns out, the Tenda mesh is on a different IP subnet to the old router. By default the mesh devices were on the 192.168.5.x subnet, whereas the old router subnet was 192.168.0.x. 

After a lot of faffing about, it turns out that Tenda have anticipated my use case, and I just hadn't configured the mesh properly. By default, the Tenda system is set to DHCP mode under Internet Settings > Connection Type. All I had to do was change it to Bridge mode. Then the mesh started using 192.168.0.x IP addresses assigned by the old router instead, and I was now able to print to the mesh-bound wireless printer, from the old wired network.

If anybody is interested in my thoughts of the Tenda Nova MW12 mesh, it's early days but the WiFi is markedly faster than via the old Archer C7, and the coverage around the house is now superb. Haven't had any dropouts yet. The MW12 also has a PPPoE mode, and port forwarding, so really I should be able to bin my old router completely. I will be doing this as soon as I get a cheap ethernet hub, as I need more ports than the Tenda node provides.

17 Mar 2021

Download SFTP file and send to Azure Blob Storage with minimal memory usage

 

In Azure we use the Renci SSH.NET library to download a file from an SFTP server and put it into Blob Storage.

Our first approach was simple: Downloading the file in entirety to memory, and then uploading to blob store.

using (var memStream = new MemoryStream())
{
    sftpClient.DownloadFile("sftpFilePath", memStream);
    memStream.Position = 0;
    var container = cloudBlobClient.GetContainerReference("blobContainerName");
    var blob = container.GetBlockBlobReference("blobName");
    await blob.UploadFromStreamAsync(memStream);
}
However, we soon realized this approach meant we consumed as much memory as the file's size. We fixed this by instead opening a writeable stream to the blob, and connecting that directly to the sftp client's DownloadFile method: 
var container = cloudBlobClient.GetContainerReference("blobContainerName");
var blob = container.GetBlockBlobReference("blobName");
using (var blobStream = blob.OpenWrite())
{
    sftpClient.DownloadFile("sftpFilePath", blobStream);
}

Note however that with this approach you may run into the limit of 100,000 uncommitted blocks that azure blob storage enforces. We have to select the block size, which is the size of each "chunk" of blob that the SDK uploads. You do this by setting the blob's StreamWriteSizeInBytes property, which can be between 16Kb and 100Mb. So for 4Mb blocks, do: 

blob.StreamWriteSizeInBytes = 4 * 1024 * 1024;


However, in version 11.1.0.0 of the azure storage library, we noticed that this setting seemed to be ignored when using OpenWrite, and the actual block size was something like 5Kb! This meant we hit the uncommitted block error for files over 450Mb in size. So, to handle very large file uploads we had to instead revert to using UploadFromStreamAsync (which does honour the StreamWriteSizeInBytes property), and had to do some extra work to surface the reading stream to pass to it.

1 Feb 2021

Find and kill a Windows 10 process on a given port

 

FIND the naughty process PID:

netstat -a -n -o | findstr *PORT_#_HERE*


KILL the naughty process:

taskkill /f /pid *PID_#_HERE*


9 Apr 2018

Windows 10 Start Menu "Best Match" won't open

If you open your Win 10 start menu, search for an app and then click or press enter on the "Best Match" result, and it won't open, it's ANNOYING.

The solution is also annoying. There's a folder in your AppSettings that you're going to need to delete:

C:\Users\YOUR_USERNAME\AppData\Local\Packages\Microsoft.Windows.Cortana_cw5n1h2txyewy

However, you can't delete it while you're logged in. So you're going to need to:


  1. Create a new user, or use an existing other account that isn't currently logged in.
  2. Make it Admin or give it write permissions on your user folder mentioned above.
  3. Log out of your problem account.
  4. Log into the new account.
  5. Find the folder mentioned above and delete it.
  6. Log out of the new account.
  7. Log back into your old account and the problem should be fixed.
  8. Don't forget to remove Admin role from the other user and remove any permissions you gave it.


1 May 2017

Pick up Emails from IMAP

            
using (ImapClient client = new ImapClient("server.name", 993, "account.name", "account.passwd", AuthMethod.Login, true))
            {

                IEnumerable<uint> uids = client.Search(SearchCondition.SentSince(DateTime.Now.AddDays(-7)));
                IEnumerable<mailmessage> messages = client.GetMessages(uids, FetchOptions.HeadersOnly);
            }

22 Sept 2016

IIS 503 Service Unavailable - Classic ASP

Just had the horrible 503 Service Unavailable issue when trying to view a Classic ASP site hosted on Windows 10 IIS. Turns out the Windows 10 Anniversary update broke it... but I digress....

In IIS I saw that the Classic ASP App Pool had stopped. But if restarted, it just stopped again when I hit the website.

Event Viewer said "The Module DLL C:\WINDOWS\system32\inetsrv\rewrite.dll failed to load. The data is the error." This is the IIS Rewrite 2 module.

So I went into Programs and Features, located "IIS URL Rewrite Module 2" and hit "Repair".

Then I restarted the crashed Classic App Pool in IIS, viewed the website, and the problem was fixed.

13 Nov 2015

Use Technicolor modem as slave wireless access point

1) Used "other" easy setup wizard to gain access to turn off DHCP on slave router
2) Set slave IP to be out of the DHCP range of the main router, but within the subnet.
3) Setup wifi SSID, password etc to match the main router, but use different wireless channel.
4) Put slave at opposite end of house, connected over powerline.

Bingo... Seamless wireless transition throughout the house and garden. Can also connect devices to the slave via cable.

11 Sept 2015

Bluetooth Issues with Lenovo ThinkPad T410 - Error 1935

Horrible recurring problems with this machine where the Bluetooth drivers get screwed up.

I tried to fix by downloading the latest ThinkPad Bluetooth with Enhanced Data Rate Software for Windows 7 and reinstalling, but it kept failing with the dreaded Error 1935. An error occurred during the installation of assembly 'Microsoft.VC80.ATL error.

The only thing that fixed this was by running the Microsoft Fix It tool, telling it that I had a problem with Installing the Thinkpad Bluetooth software. It fixed stuff, rebooted my machine (without asking!) and I was then able to install the software.

17 Mar 2015

IIS 7 URL Rewrite - Ensure SSL/HTTPS and Ensure Fully Qualified Domain Name (FQDN) as Hostname

I had the goal of ensuring all traffic on a web site was via SSL, and also using the canonical hostname, i.e. www.mysite.com rather than just mysite.com.

After installing URL Rewrite 2.0 on IIS, this was achieved by adding the following to the site's root web.config file.


    
        
            
                
                    
                    
                        
                    
                    
                
                
                    
                    
                        
                    
                    
                
            
           
    
If I helped you out today, you can buy me a beer below. Cheers!