PowerShell Dev Setup

Modules to install PSReadLine use Get-PSReadLineKeyHandler to see existing keybindings. Git Delta Delta plugin is a tool that enhances the output of git commands such as git diff, git show, and git log by adding syntax highlighting, color themes, and side-by-side views. It can also integrate with other tools like bat and grep to provide…

File name search in Visual Studio

Being relatively new to Visual Studio and used to the convenient file search inside neovim/fzf etc, it took quite a while to get used to the behavior inside VS. The default recommended way is to ctrl-t which is ‘go to all’. It searches not only file name but all symbols in the syntax tree. As…

ADB in WSL2

To connect to ADB via WSL, we can first make sure the device is visible on Windows when executing the adb devices in cmd/powershell. 1. Set ADB Server In Windows side(cmd/powershell), do adb tcpip 5555 to set the ADB server to listen on port 5555 for a connection from a device over TCP/IP. 2. Get…

Install latest dotnet sdk on WSL

I was trying out the latest dotnet on WSL. using brew The first way is to just use brew to install the dotnet like: The issue is this only installs the dotnet 6.0.110 which is not the latest one(6.0.40x as of Oct 2022) that is required by our project. And unfortunately brew –cash is MacOS…

OnePlus 10T unlock/root/magisk

Fi Issue I have been using Samsung and pixel device for the past 5 years and did not get a chance to root phones for a while. I used to do that for all my devices(Nexus 4/5/6) for custom ROMs and kernals etc. Recently my pixel 5 does not work properly with the google Fi…

Multiple Python version in WSL2 ubuntu

I was developing some python Azure Function app and the func cli requires python 3.9 however I installed the python 3.10.x which is the latest as of now during my WSL setup. pyenv During the search online looks like the pyenv is the go-to tool for maintaining different versions of Python like nvm/volta in nodejs…

MySQL on WSL2

Have to do some datafix and export for some mysql data, trying it on Windows this time. document some issues encountered. Installation sudo apt install mysql-server confirm: mysql –version more config can be set at: /etc/mysql/my.cnf. start server sudo /etc/init.d/mysql start OR sudo service mysql start Config open prompt: sudo mysql SHOW VARIABLES LIKE ‘validate_password%’;…

windows shortcuts

Open Settings: Win + i Screen snip tool: Win + shift + s Task view: Win + tab alt+tab ignore edge tabs: System -> Multitasking -> Alt + Tab -> Open windows only Cycle thru taskBar items: win+t, (can be handy for auto hide taskbar on) Move window to other display: win+shift+left/right Map CapsLock to…

Typescript decorator with inheritance

Background I developed a custom decorator for fixed width file processing a while ago so that the domain class and spec can stay together. No separate schema creation is needed so that it is more readable, maintainable and extensible. Recently there is a new requirement that we have some common fields and need some sub/child…

inconsistent static field in typescript with bundler

Background I had a post a while ago explaining we used esbuild to greatly reduce our bundle size of serverless/lambda artifact. It works well for a long time until recently one of my teammates reported an issue that some static fields was not consistent meaning works in some classes but not other(undefined). We set our…

ChromeOS dev setup

Crosh Crosh is the native shell(use ctrl-alt-t to launch) in ChromeOS which comes with many basic commands likes top, battery_firmware, meminfo etc. To do actual development we need a real Linux OS which we will talk below. Crostini The linux in ChromeOS is called Crostini, a quick powerful enhancement for developers working on ChromeOS. Open…

Typescript error type with Target ES5

I was working with a github issue on one of my open source project which uses Typescript and the transpile target is es5, One issue I have is when I defined a custom Error time which extends the built-in Error and it will not return true for instanceof check on that custom error. Turns out…