Category Archives: Uncategorized

Oracle Cloud – Resize a boot volume on Ubuntu

Via OCI Console, to edit a block volume (Boot volume), you will need to navigate:

 Block Storage –> Boot Volumes –> Boot Volume Details (edit)

Once you finish this part, a popup will show the commands to be performed on the Linux machine console

sudo dd iflag=direct if=/dev/oracleoci/oraclevda of=/dev/null count=1
echo "1" | sudo tee /sys/class/block/`readlink /dev/oracleoci/oraclevda | cut -d'/' -f 2`/device/rescan

As we are using ubuntu, we are not able to use Oracle tools oci-growfs. But it’s easy, just two command:
# growpart /dev/sda 1;
# resize2fs /dev/sda1

Done. now run df -h you should be able to see the new size.

Nginx: Use same port for http and https traffic

This is finally possible to do properly since 1.15.2. See the information here.

your nginx.conf add a block like this (outside the http block):

stream {
    upstream http {
        server localhost:8000;
    }

    upstream https {
        server localhost:8001;
    }

    map $ssl_preread_protocol $upstream {
        default https;
        "" http;
    }

    server {
        listen 8080;
        listen [::]:8080;
        proxy_pass $upstream;
        ssl_preread on;
    }
}

Then you can create your normal server block, but listening on these different ports:

server {
    listen 8000;
    listen [::]:8000;
    listen 8001 ssl;
    listen [::]:8001 ssl;
...

Fix “the app required specific feature not available on the device” and install fitness on iPad

First of all, Not all devices support Fitness app, please check apple doc for more information.

And I’m using Ipad Air 2 which in on the support list, but when try to install Fitness app, I still got error “the app required specific feature not available on the device”.

After investigation, I found out that to install Fitness App on iPad, you need to meet below requirements:

  1.  You have an apple watch paired with an iPhone.
  2.  Home app is installed on both iPhone and iPad. If you removed them like me, install them back. And then open the Home app.
  3. If different apple IDs are used on your iPhone and iPad, (for example, the iPad is for my daughter so it’s using my daughter’s apple ID). go to Home App and add both IDs into the same home. Then reboot both iPhone and iPad

Then you should be able to install Fitness App on iPad now.

 

NBN Unifi USG 3P PPPOE settings

I just switched my NBN from Telstra to Spintel.

Telstra is using DHCP while Spintel is using PPPOE. But when I configure the usrename and password for my WAN, USG can’t connect to internet.

Spent lots of time to troubleshot this issue, and then I notice that there is a log on USG

Oct 29 14:49:25 USG pppd[8094]: pppd 2.4.4 started by root, uid 0
Oct 29 14:49:25 USG pppd[8094]: Failed to create PPPoE socket: Protocol not supported
Oct 29 14:49:37 USG xl2tpd[8208]: setsockopt recvref[30]: Protocol not available

Then I realize it’s a driver issue. Looks like USG won’t load PPPOE driver without a restart. So if you are using DHCP in the past, after you change to PPPOE, you need to restart your USG.

After restart USG, all good.

Windows shown as “No internet” when it can access internet

Windows is running DNS and HTTP test against www.msftconnecttest.com  to check if it has internet connection or not. So if your internet can’t access this website, for example, in China, sometimes this domain is hijacking by GFW, then windows will show as no internet connect.

A quick fix is to disable Active Probe via modify registry.

Change below value from 1 to 0 to disable Active Probe

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet 的 EnableActiveProbing 

Do we still need to tuning storage/SMB for PVS 7.* servers?

Recently I spent lots of time to check how to improve PVS 7.* server performance to reduce the vDisk loading time.
And it seems on the internet there are lots of articles talking about tuning storage (both storage server and PVS server) to enable ‘oplock’.
But I found that almost all these articles are based on PVS 5.* and windows 2003/2008.
So do we still need to tuning storage/SMB for PVS servers?

Citrix has a good article to answer this quetion:

PVS Internals #4: vDisk Stores and SMB3

Just check the summary part:

Using file share storage for vDisks is still a valid and recommended approach, if sufficient capacity and high availability is in place. Especially in environments without redundant resp. highly available file services, I’d rather recommend local replicated vDisk stores instead of using just a single file server that definitely constitutes a single point of failure. And no one needs to invest in expensive file clustering solutions if its only purpose would be to provide file shares for vDisk storage.
Caching will help to significantly reduce the load on file servers or filers. Unlike earlier versions, there are no tuning requirements, neither for the PVS servers, nor for file servers. The defaults are perfectly fine. Sizing guidelines for PVS server memory (RAM) from past articles still apply.
Consider the caching behavior of the SMB redirector. There is a chance that shutting down all target devices connected to a particular vDisk will also remove the vDisk’s cache entries and the cache will need to be warmed up again on the next boot.
Leverage the latest SMB protocol if possible, at the time or writing this article it’s SMB 3.1.1. Not only Windows file servers support SMB3, but also modern filers such as NetApp, and even my home lab Synology is able to support SMB3.
Leasing is key for caching, so don’t use SMB 1.x or 2.0 (in fact you shouldn’t even enable the optional SMB 1.x feature on your PVS servers), and forget about any ‘oplock tuning’. Anything from SMB 2.1 onwards is fine with its defaults, but SMB 3.x brings added features that might be beneficial for you, such as ODX when taking copies of a vDisk file.

So it seems the only thing we need to do is to disable SMB 1.0 on PVS server. How to do it? Here is the link:

https://support.microsoft.com/en-us/help/2696547/detect-enable-disable-smbv1-smbv2-smbv3-in-windows-and-windows-server