Add a Gmail filter when there are constraints

I’m trying to find a way to receive my daily email when Google sites are not accessible, so I’m forwarding my inbox email to my hotmail account. I can remote in another computer (rmm) for this setup.

  1. Log in my Gmail in rmm, in “Search in mail” box, type “in:inbox” then click the “Show search options” button to the left.
  2. Create the filter that popped out. You’ll be reminded that “in:inbox” and some others “are not recommended as they will never match incoming mail”. Don’t worry, just go ahead.
  3. Since it’s my first time to log in my Gmail account on this machine, it will ask you to confirm it’s really you that want to create the filter. There are 3 options:
    • Use passkey to login gmail on an iPhone with iOS 16 and up
    • Type a code on another email account
    • Key in the security code generated on another phone (even offline)
  4. The first 2 need me to access Gmail account in a different device which is not applicable. Then the 3rd one is the only option.
  5. Turns out it works since Google provides this nice feature. Make sure another phone’s time is correct (in my case it was hours diff since it’s not opened for a while).

AWS VPN

Use:

https://s3.amazonaws.com/webdigi/VPN/Unified-Cloud-Formation.json

Can connect to Seoul server with Surface 3 and Android 8 but not on iPhone and MacOS.

Not use:

https://s3.amazonaws.com/webdigi/VPN/Unified-Cloud-Formation.yaml

Reference:
https://blog.wenxuecity.com/myblog/13923/202301/32950.html

Android storage clean

Storage locations:

These paths are (pointing to) the same location:
/storage/emulated/0
/mnt/user/0/primary
/storage/self/primary
/sdcard

bbd100:/ $ ls -l / 2>/dev/null | grep sdcard
lrwxrwxrwx   1 root   root        21 1969-12-31 16:00 sdcard -> /storage/self/primary
bbd100:/ $ ls -l /storage/self/
total 0
lrwxrwxrwx 1 root root 19 1970-01-16 05:03 primary -> /mnt/user/0/primary
bbd100:/ $ ls -l /mnt/user/0/
ls: /mnt/user/0/: Permission denied
1|bbd100:/ $ ls -l /mnt/user/0/primary
lrwxrwxrwx 1 root root 19 2020-12-24 17:33 /mnt/user/0/primary -> /storage/emulated/0
bbd100:/ $ ls -l /storage/emulated/
ls: /storage/emulated/: Permission denied
1|bbd100:/ $ ls -l /storage/emulated/0/
ls: /storage/emulated/0//Locker: Permission denied
total 180
...

WeChat pictures from Windows Explorer:

  • Computer\BlackBerry BBD100-2\Internal shared storage\Pictures\WeChat
    • mmexport* and wx_camera_*
  • Computer\BlackBerry BBD100-2\Internal shared storage\tencent\MicroMsg\WeChat
    • mmexport* and wx_camera_*
  • Computer\BlackBerry BBD100-2\Internal shared storage\DCIM\Camera

    WeChat clean up from Windows Explorer:

    Computer\BlackBerry BBD100-2\Internal shared storage\tencent\MicroMsg\xlog
    Computer\BlackBerry BBD100-2\Internal shared storage\Android\data\com.tencent.mm\MicroMsg\xlog
    Computer\BlackBerry BBD100-2\Internal shared storage\Android\data\com.tencent.mm\MicroMsg\videocache
    Computer\BlackBerry BBD100-2\Internal shared storage\Android\data\com.tencent.mm\MicroMsg\134630398237222096e1f7af76a8d8c0
    video
    image
    record
    Computer\BlackBerry BBD100-2\Internal shared storage\Telegram
    Computer\BlackBerry BBD100-2\Internal shared storage\Android\data\org.telegram.messenger\cache

    Huge thumbnail file(s): 4G+

    Computer\BlackBerry BBD100-2\Internal shared storage\DCIM\.thumbnails\.thumbdata4-1763508120

    Windows cmds

    Get board info:

    C:\Windows\system32>wmic baseboard get product, manufacturer, serialnumber
    Manufacturer     Product  SerialNumber
    Hewlett-Packard  1425     PX140011ZZM...
    

    When search product support on hp website, actually using “IdentifyingNumber” instead of “SerialNumber”. Otherwise you’ll get “Sorry, no results match your search for …”.

    C:\Windows\system32>wmic csproduct list full
    
    
    Description=Computer System Product
    IdentifyingNumber=CNF0433...
    Name=HP G62 Notebook PC
    SKUNumber=
    UUID=30464E43-3334-5133-5A54-64315061E...
    Vendor=Hewlett-Packard
    Version=0598120000202710010020...
    

    Reference link:

    Retrieving System Information from command line.

    MacOS: to install in VirtualBox with MacOS host

    Both MacOS are Catalina 10.15.7.

    After created .iso, just follow those references to create vm and modify it for MacOS installation.

    VBoxManage modifyvm "Catalina" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
    VBoxManage setextradata "Catalina" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
    VBoxManage setextradata "Catalina" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
    VBoxManage setextradata "Catalina" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-06F11FD93F0323C5"
    VBoxManage setextradata "Catalina" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
    VBoxManage setextradata "Catalina" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
    
    VBoxManage setextradata "Catalina" VBoxInternal2/EfiGraphicsResolution 1440x900
    

    You can use command to get more info from your Mac host.

    $ ioreg -l
    

    Mount MacOS Guest Additions CD

    Supposed to be easier but be reminded to:
    1. Release-n-Remove the VBoxGuestAdditions.iso from all other VMs.
    2. May need to eject the installation 10.15.iso CD out first.

    Install MacOS Guest Additions

    This is kind of hack. Tried by normal means but failed (step “Validating Packages) –

    "The installation failed. The installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance."
    

    Neither it works by cmd line install:

    sudo installer -allowUntrusted -pkg /Volumes/VBox_GAs_6.1.16/VBoxDarwinAdditions.pkg -target /Users/yan/Workspace/
    

    Then tried to all these steps (add VB5E2TV963, Disable SIP, Make Extensions dir writable) then got it installed. A complete procedure:

    # Normal mode
    sudo nvram "recovery-boot-mode=unused"
    sudo reboot
    # Recovery mode
    csrutil disable
    spctl kext-consent add VB5E2TV963
    nvram -d recovery-boot-mode
    reboot
    # Normal mode
    sudo mount -uw /
    sudo chown :admin /System/Library/Extensions/
    sudo chmod 775 /System/Library/Extensions/
    ### Do the installation now, then apply restrictions back
    sudo chown :wheel /System/Library/Extensions/
    sudo chmod 755 /System/Library/Extensions/
    sudo nvram "recovery-boot-mode=unused"
    sudo reboot
    # Recovery mode
    csrutil enable
    nvram -d recovery-boot-mode
    reboot
    

    Never disabled Gatekeeper (with “sudo spctl –master-disable”) though.

    Shared Folders

    However, in my installation, it seems the clipboard is shared between host and guest but the share folder seems couldn’t be mounted, neither from UI nor from cmd. The missing vboxsf.fs folder hints it’s not a successful installation of Guest Additions.

    yan@yans-MacBook-Pro ~ % sudo mount -t vboxsf -o rw workspace /Users/yan/Workspace/workspace_host/
    Password:
    mount: exec /Library/Filesystems/vboxsf.fs/Contents/Resources/mount_vboxsf for /Users/yan/Workspace/workspace_host: No such file or directory
    mount: /Users/yan/Workspace/workspace_host failed with 72
    

    Eventually I’m using smb to get shared folder(s) from host by one of these means:

    1. Finder > Go > Connect to server… cmdK
      • as /Volumes/workspace
    2. Terminal: mount -t smbfs //username:password@server/share .../mountpoint

    References:

    Build cppzmq in Centos

    libzmq

    is a dependent of cppzmq. In Centos, you need to install some modules as a pre-requisite:

    ### for libzmq
    sudo yum install gnutls-devel
    sudo yum install libsodium-devel
    ### for could be a bogus one
    sudo yum install catch-devel
    

    cppzmq

    The easy way to build is to skip test part.

    $ cmake -DCPPZMQ_BUILD_TESTS=OFF ..
    $ make
    

    Otherwise you need to:
    1. fix the cmake catch_discover_tests error. The installation of catch could be bogus cause it seems not fixing the error and you still need to apply a patch to workaround it,

    ### could be a bogus one since it
    sudo yum install catch-devel
    

    2. use a cmake build which supports SSL to download catch.hpp file
    Unfortunately we couldn’t suppress the SSL use in command ExternalProject_Add by adding “VerifySSL Off”. Since the error happens in late make stage, it’s a good idea to add some cmake capability check in early stage.

    if (NOT CMAKE_HAS_SSL_SUPPORT)
      message(FATAL_ERROR "...")
    endif()
    ## Or,
    cmake_minimum_required(VERSION 3.18 FEATURES SSL)
    

    3. (don’t know yet cause I stopped here.)

    Centos specific

    Centos Package

    # list package
    rpm -qa --last
    yum list installed | grep package_name
    # package -> files
    rpm -ql package_name
    rpm -qlp package_file_name
    repoquery --list package_name # from yum-utils
    # file -> package
    rpm -qf file_name
    yum whatprovides file_name
    dnf provides file_name
    # install package
    yum install -y gettext-devel # for autopoint
    

    Centos/RH 7 install multiple gcc versions: devtoolset-8 and switch at will

    # 1.a. Centos:
    $ sudo yum install centos-release-scl
    # 1.b. RHEL:
    $ sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
    # 2. Install the collection:
    $ sudo yum install devtoolset-8
    # 3. Start using software collections:
    $ scl enable devtoolset-8 bash
    # 4. To view the individual components in this collection
    $ sudo yum list devtoolset-8*
    

    Centos update CMake

    wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz
    gunzip cmake-3.6.2.tar.gz 
    tar xvf cmake-3.6.2.tar 
    cd cmake-3.6.2/
    sudo yum install bootstrap
    ./bootstrap --prefix=/usr/local
    make -j$(nproc)
    sudo make install
    cmake --version
    

    “Can’t download the additional components needed to install Mac OS X.”

    When clean up the 13″ 2013 MBP for returning, after workaround the “Couldn’t Unmount Disk” error in Disk Utility by making a USB disk, it gave me the error when I tried to “Reinstall Mac OS X” by the (built-in) Base System in disk1.

    “Starting an Internet Recovery” was showing up regardless which combination I had in macOS Recovery after erased the disk. But they gave different result:
    – ⌘-R: Installing the built-in 10.7 (Lion). Although it told me “2,147,418,648 hours xx minutes” left which seems it connected some where through internet, it reported failure soon after that.
    – Option-⌘-R: Installing High Sierra. “About 20 minutes remaining”

    If boot with the USB disk it should be able to install macOS as well but I didn’t go this path.

    Centos, NFS setup, access from MacOS

    Server side (7 (Core)), within Virtualbox 6.0.22:

    $ sudo yum install nfs-utils nfs4-acl-tools portmap
    ## Leave the default nfs.cfg file untouched (actually all commented out)
    $ sudo vi /etc/exports
    ## with this line:
    /workspace_guest/02.code 172.20.0.1(rw,sync,insecure,all_squash,anonuid=1000,anongid=1000)
    ## vs: (rw,sync,no_root_squash,insecure)
    ## Then update:
    $ sudo exportfs -r
    $ sudo exportfs -s
    /workspace_guest/02.code  172.20.0.1(sync,wdelay,hide,no_subtree_check,anonuid=1000,anongid=1000,sec=sys,rw,insecure,root_squash,all_squash)
    ## May need to check if nfs.services is up
    $ systemctl status nfs
    $ sudo firewall-cmd --permanent --add-service mountd
    $ sudo firewall-cmd --permanent --add-service nfs
    $ sudo firewall-cmd --permanent --add-service rpc-bind
    $ sudo firewall-cmd --reload
    ## be noted there is rpcbind.service but no rpc-bind.service
    

    Client side (macOS Catalina Version 10.15.6), which is the Host of the VM:

    Follow this post to use auto_nfs/auto_master pair and use trick to get mounted under /Volumes:

    /System/Volumes/Data/../Data/Volumes/C76/02.code -fstype=nfs,noowners,nosuid,nolockd,noatime,resvport,soft,retrans=30,bg,rw,tcp,nfc,rsize=8192,wsize=8192 nfs://172.20.0.100:/workspace_guest/02.code
    
    /-                      auto_nfs
    

    Then refresh:

    $ sudo automount -cv
    

    Be noted the auto_master file sometimes could be flushed on macOS then this “auto_nfs” line will be gone!

    More options for configuration:

    This example and NFS options.

    Trouble-shootings:

    Check supported nfs versions:

    ## server:
    $ sudo cat /proc/fs/nfsd/versions
    -2 +3 +4 +4.1 +4.2
    ## client:
    $ rpcinfo -p 172.20.0.100 | grep -e proto -e nfs
       program vers proto   port
        100003    3   tcp   2049  nfs
        100003    4   tcp   2049  nfs
        100227    3   tcp   2049  nfs_acl
        100003    3   udp   2049  nfs
        100003    4   udp   2049  nfs
        100227    3   udp   2049  nfs_acl
    

    Quick check the advertised on both (server and client) sides:

    ## server:
    $ showmount -e
    ## client:
    $ showmount -e 172.20.0.100
    

    Quickly verifying mount from MacOS:

    $ sudo mount -t nfs -o resvport,rw,noowners 172.20.0.100:/workspace_guest/02.code /Volumes/C76/02.code
    $ df -H
    mount -t nfs -o rsize=65536,wsize=65536,intr,hard,tcp,locallocks,rdirplus,readahead=128 your.qumulo.ip:/share /path/to/mountpoint
    

    Firewall?

    ## Server:
    $ sudo systemctl stop firewalld
    

    More issues:

    Q: $ showmount -e 172.20.0.100
    showmount: Cannot retrieve info from host: 172.20.0.100: RPC failed:: RPC: Unable to send; errno = Bad file descriptor
    A: Firewall issue. Try to temporarily stop server firewalld. (Assume you can ping that server firstly. At least the Cisco AnyConnect is very disruptive in this.)

    Q: $ sudo ls -lart /System/Volumes/Data/nfs
    nfs server 172.20.0.100:/workspace_guest/nfs_share: not responding
    ls: /System/Volumes/Data/nfs: Device not configured
    Or: ls: : No such file or directory
    A: Use option “resvport” instead of “noresvport”

    Q: $ sudo automount -cv
    automount: /System/Volumes/Data/home updated (/home -> /System/Volumes/Data/home)
    automount: /System/Volumes/Data/../Data/Volumes/workspace_guest: can’t set hidden
    automount: mount /System/Volumes/Data/Volumes/workspace_guest: Operation not permitted
    automount: /Volumes/workspace_guest unmounted
    Or: ls: : Permission denied
    A: Cannot mount workspace_guest directly which is mounted in guest.

    Q: On client side only root could make changes
    $ rm /Volumes/C76/02.code/d
    override rw-r–r–  ywu/staff for /Volumes/C76/02.code/d? y
    rm: /Volumes/C76/02.code/d: Permission denied
    A: Use anonuid/anongid pair in /etc/exports on server then the noowner in client. “noowner” takes effects regardless of the anonuid/anongid settings. In this post it’s explained on the server side as “all_squash will map all UIDs and GIDs to the anonymous user, and anonuid and anongid set the UID and GID of the anonymous user.”. I’d think on the client side “noowner” is to apply the current user/group as the “anonymous”.

    /workspace_guest/02.code 172.20.0.1(rw,sync,insecure,all_squash,anonuid=1000,anongid=1000)
    $ sudo mount -t nfs -o resvport,rw,noowners 172.20.0.100:/workspace_guest/02.code /Volumes/C76/02.code
    

    Q: Always be prompted when deleting a file (not when creating)
    $ rm /Volumes/C76/02.code/d
    override rw-r–r–  ywu/staff for /Volumes/C76/02.code/d? y
    A: remove the “noacl” option in mount cmd line.

    Q: Catalina change?

    Known issues in MacOS NFS

    Be careful of v4 in MacOS

    Using other clients

    AFP could be the next one to try.