Notes

  • If connecting a WSL2 Rails app to Postgresql on Windows is resulting in errors, the following may help.

    You will need to first figure out what your WSL and Windows IP address is by using ipconfig.exe in PowerShell or ipconfig.exe | grep IPv4 | cut -d: -f2 in WSL2.

    Next update your application's database config to use your Windows IP address as the hostname. You will also need to allow requests from port 5432 through your firewall.

    In addition to the above, you will need to change some Postgresql settings. These can usually be found in the <x>:\Program Files\PostgreSQL\<version>\data directory.

    Inside postgresql.conf, change the listen_addresses value under "CONNECTIONS AND AUTHENTICATION" to include your WSL IP address. If the value is already *, that means it will listen to any IP addresses and nothing needs to be changed.

    e.g.

    #------------------------------------------------------------------------------
    # CONNECTIONS AND AUTHENTICATION
    #------------------------------------------------------------------------------
    
    # - Connection Settings -
    
    listen_addresses = 'localhost,192.168.1.25'     # what IP address(es) to listen on;
                        # comma-separated list of addresses;
                        # defaults to 'localhost'; use '*' for all
                        # (change requires restart)
    
    ...
    

    Finally, change pg_hba.conf to allow users from your WSL IP address to login and make requests on the database.

    e.g.

    host    all             all             10.0.0.99/32         md5
    host    all             all             ::/0                 md5
    
  • Installing OMZ asdf plugin with zinit requires loading bashcompinit before the plugin is loaded to avoid command not found: complete error.

    e.g.

    autoload -Uz bashcompinit && bashcompinit
    zinit snippet OMZ::plugins/asdf/asdf.plugin.zsh
    
  • Recently upgraded motherboard to MSI x570 MAG Tomahawk Wifi, but WiFi was not detected in Ubuntu 20.14.

    Fixed by turning off Fast boot in Windows.

    Note: I have a multiboot system with multiple Linux installations and Windows on separate SSDs.

  • Inspired by Muan's blog, I've created a space here for notes. I'll probably end up embedding a lot of Gists here, since I use them to keep track of code snippets a lot.