Posts

Parse b3dm file content

We can use python with py3dtiles to parse the information in a b3dm file, for example: from pathlib import Path from py3dtiles.tileset.content import B3dm, read_binary_tile_content filename = Path ('./test.b3dm') b3dm = read_binary_tile_content (filename) b3dm_header = b3dm.header print (f"\nb3dm_header.magic_value:\n{b3dm_header.magic_value}") print (f"\nb3dm_header.version:\n{b3dm_header.version}") print (f"\nImages in b3dm:") for image in b3dm.body.gltf.images:      print (image)

Access windows localhost from wsl

To access window's localhost from wsl, you can set networkingMode=mirrored in .wslconfig Reference:  https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-settings-for-wslconfig

Start new tab with the current directory in windows WSL

Use the following alias: alias nt='wt.exe -w 0 wsl' It means starting a new  terminal (tab) in the same window ( -w 0 ) , and run a command wsl  with it.

Node.js certificate issues

When you encountered certificate issues when using node.js, there are some workaround that can be tried: 1) Add custom CA certs      $ export NODE_EXTRA_CA_CERTS=[your CA certificate file path] 2) Disable certificate checking      NODE_TLS_REJECT_UNAUTHORIZED

Keep current log file when using logrotate

When using logrotate in Linux, you might encounter a situation where your log file gone when the log rotated. One of the flag that you may need to notice is the  copytruncate  flag. It did not remove the current log file, instead it copy the log file and then truncate it: File name: /etc/logrotate.d/your-application  /var/log/your-application/output.log {      copytruncate     rotate 5     daily      compress     delaycompress     notifempty     missingok }

Quasar failed to proxy pass via https

When failed to proxy pass with https in Quasar framework, it is very likely that the target-host HTTPS are configured incorrectly.  As a workaround, you can modify the quasar.conf.js with secure:false as following:         "/context/path1/": {           target: "https://target-host/path1/",           secure: false,           changeOrigin: true,           pathRewrite: {             "^/context/path1/": "",           },         },

Limit CPU and Memory usage in Linux Slack

The Linux Slack consumes a lot of CPU and memory in Linux environment. To limit its resource usages, you can apply a quote via the snap command: sudo snap set-quota slacklimit --memory=2GB --cpu=20% slack