Skip to content

Instantly share code, notes, and snippets.

View netfantom-spb's full-sized avatar

Viktor Egorov netfantom-spb

  • Israel
View GitHub Profile
@netfantom-spb
netfantom-spb / git_and_github.md
Last active March 29, 2024 06:31
GIT and GitHub

Reset all local changes and reload remote branch ("main" in this example)

$ git checkout main
$ git fetch --all
$ git reset --hard origin/main

Change remote reposictory URL

$ git remote -v
origin  [email protected]:netfantom-spb/oldrepository.git (fetch)
@netfantom-spb
netfantom-spb / docker.md
Created June 23, 2023 15:49
Docker / Docker Desktop

Shrink disk (*.vhdx) file size

1.Discover Docker Desctop vhdx file path \HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss 2.Pause and quit from Docker Desktop 3.Shutdown WSL

wsl --shutdown

4.Shtink finle size

@netfantom-spb
netfantom-spb / WSL.md
Last active September 18, 2025 11:04
WSL

WSL list

Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss" -Recurse

Move WSL to another drive/PC

wsl --export Ubuntu .\Ubuntu\ext4.vhdx --vhd
wsl --unregister Ubuntu
wsl --import-in-place Ubuntu .\Ubuntu\ext4.vhdx
-- CREATE EXTENSION IF NOT EXISTS pgstattuple;

WITH all_tables AS (
   SELECT 
        n.nspname AS schemaname,
        c.relname AS tablename
    FROM pg_class c
    JOIN pg_namespace n ON c.relnamespace = n.oid
    WHERE c.relkind = 'r'  -- обычные таблицы
@netfantom-spb
netfantom-spb / VSCode + WSL + NodeJS.md
Last active July 13, 2023 09:16
VSCode + WSL + NodeJS tips & tricks

VSCode + WSL + NodeJS tips & tricks

Installation

  1. Install NPM & n nodejs package manager
sudo apt update && sudo apt upgrade
sudo apt install npm
npm i -g n
  1. Insall node