Skip to content

Instantly share code, notes, and snippets.

View vyach-vasiliev's full-sized avatar

ฬะทçะรโลนร vyach-vasiliev

  • Milky Way galaxy, planet Earth
View GitHub Profile
@vyach-vasiliev
vyach-vasiliev / CompactWSL.bat
Created October 19, 2024 14:16 — forked from Csqhi515/CompactWSL.bat
Script to help compact WSL and vhdx.
@echo off
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
wsl sudo fstrim --all; echo "Exit status: $?";
@vyach-vasiliev
vyach-vasiliev / readme.md
Last active October 16, 2024 19:23
Run WSL with VcXsrv (2024)

Reason to Use VcXsrv Instead Pure WSL/WSLG

I ran the application (Intellij IDEA in my case) like this (without VcXsrv) in WSL2.

export LIBGL_ALWAYS_SOFTWARE=1 && export DISPLAY=:0 && nohup idea.sh &

But after some time I observed 1-5-10 second freezes in the GUI interface.

Setup VcXsrv on Windows OS (10 ver in my case)

  1. Install VcXsrv that is an open-source and frequently updated Windows X Server (it will be the provider of graphics resources and keyboard/mouse events), then start it as follow:
  • Use multiple windows
@vyach-vasiliev
vyach-vasiliev / lookups_in_django_admin_url.md
Created May 24, 2024 08:18
Supported Lookups in Django Admin URL

Supported Lookups in Django Admin URL

exact: exact match

icontains: case-insensitive containment test

startswith, istartswith: starts with (case-insensitive)

endswith, iendswith: ends with (case-insensitive)

@vyach-vasiliev
vyach-vasiliev / open_fb_kp.js
Last active May 9, 2024 12:50
Open fb or kinopoisk (bookmarklet)
javascript:(location.href.match("kinopoisk") ? open(location.href.replace(".ru", ".vip")) : null)||(location.href.match("flicksbar") ? location.host = "kinopoisk.ru" : null);
@vyach-vasiliev
vyach-vasiliev / README.md
Last active October 16, 2024 19:29
Modify context menu for Shell app in WindowsOS
@vyach-vasiliev
vyach-vasiliev / Install_Ignore_From_Dropbox_Context_Menu.reg
Last active August 5, 2024 02:02
Ignore from Dropbox by context menu in Windows OS [updated 2024]
Windows Registry Editor Version 5.00
;= Setup ignore file/folder menu.
;= Context menu to folders:
[HKEY_CLASSES_ROOT\Directory\shell\Dropbox F Ignore]
"AppliesTo"="System.ItemPathDisplay:\"Dropbox\""
"Icon"="C:\\Program Files (x86)\\Dropbox\\Client\\Dropbox.exe,12"
@="Ignore from Dropbox"
[HKEY_CLASSES_ROOT\Directory\shell\Dropbox F Ignore\command]
@vyach-vasiliev
vyach-vasiliev / pg_schema_size.sql
Created August 4, 2023 16:29 — forked from AndreyStekov/pg_schema_size.sql
Get schema size (postgres).
SELECT pg_size_pretty(sum(pg_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)))::bigint) FROM pg_tables
WHERE schemaname = 'yourschema'
@vyach-vasiliev
vyach-vasiliev / github_clone_using_token.sh
Last active July 25, 2023 14:15 — forked from magickatt/github_clone_using_token.sh
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=user
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=owner/repo-path
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
# or
git clone ${GITHUB_TOKEN}@github.com/{GITHUB_REPOSITORY}.git
@vyach-vasiliev
vyach-vasiliev / latest_version
Last active June 25, 2023 07:29
MemShow new version
1.0.0
@vyach-vasiliev
vyach-vasiliev / ReadMe.md
Last active April 7, 2023 17:26
X11 Desktop Environment under WSL (connect by RDP)

RUN X11 Desktop Environment under WSL (connect by RDP)

Instruciton for WSL dist: Ubuntu 20.04 LTS

Settings

install packages

sudo apt update && sudo apt -y upgrade
sudo apt-get install -y xfce4 xrdp