Enable RDP for Windows Server

After installing Windows Server (eg at 2012 R2), Remote Desktop (RDP) is often disabled by default. Here’s how to enable it (using PowerShell):

1) Change the network type

By default, it’s set to Public, but it needs to be Private.

Get-NetConnectionProfile

(to check the exact InterfaceIndex, for example 12)

Set-NetConnectionProfile -InterfaceIndex 12 -NetworkCategory Private

Important: use -InterfaceIndex, not -InterfaceAlias. In Windows Server 2012 R2, InterfaceAlias sometimes doesn’t work, while InterfaceIndex is reliable.

Get-NetConnectionProfile

If you see:

NetworkCategory : Private

— you’re good.

2) Check and start the RDP service

Continue reading

Posted in Windows Server (en) | Leave a comment

Preparing a Windows Server Image for Timeweb Cloud

This guide explains how to manually prepare an optimized Windows Server image (using Windows Server 2012 R2 as an example) for uploading to Timeweb Cloud virtual machines. We’ll use NTLite together with VirtIO drivers. The goal is to integrate the necessary drivers (without them, the custom OS will not boot on the cloud), lighten the system, and disable unnecessary services and telemetry.


1. Preparing the Files

  • Copy the contents of the Windows Server 2012 R2 ISO to a folder, for example: C:\utils\WS2012ISO.
  • Download the latest VirtIO drivers (for Windows Server 2012 R2, it’s recommended to use virtio-win-0.1.171.iso).
  • Mount both ISOs in the system.

2. Adding install.wim and boot.wim to NTLite

Continue reading

Posted in Windows Server (en) | Leave a comment

WinSetupFromUSB — safe version without viruses

There’s a lot of shady stuff floating around the Internet, so sometimes it’s hard to find a legit copy of certain software. Ideally, you’d use open-source tools — but sometimes there just aren’t any real alternatives. One example is the beast called WinSetupFromUSB, which doesn’t just copy an ISO image to a flash drive, but actually fixes a structural problem related to installing old versions of Windows (especially Windows XP) on modern hardware.

For instance, I ran into a problem while installing Windows XP Home Edition SP3 OEM-Asus Eee PC on my ancient ASUS Eee PC T91. WinSetupFromUSB is capable of creating a modified grub4dos bootloader and adding driver patches that let XP detect SATA drives…

Anyway… these days you can’t easily download WinSetupFromUSB legitimately — the official .com website is down. There are plenty of mirrors out there, but half of them are infected. So what to do?

Go to the Internet Archive 🙂 Here’s the link:

https://web.archive.org/web/20211128225806/http://www.winsetupfromusb.com/files/download-info/winsetupfromusb-1-10-exe/

There you can find the checksums for WinSetupFromUSB 1.10.exe (28 MB) from November 7, 2021:

CRC-32 2d838f1e
MD5 3029455e6a2e47be8981ff79be09e8ad
SHA-1 2a424bcfccc501940c5d9eb3093e59f673e3ea33

Now download that version (the last one) from here or from any other mirror, upload it to VirusTotal, and check the hashes 🙂 Use it safely — and don’t forget to thank Uncle Tangar 😉

Posted in OS, Windows XP | Leave a comment

Linux Directory Structure (cheatsheet)

When you look at the root of the Linux filesystem, it may feel weird: folders with strange names. In fact, it’s pretty logical once you know the abbreviations and acronyms:

/bin     USER PROGRAMS (binaries for users)  
/sbin    SYSTEM PROGRAMS (binaries for root/admin)  
/etc     CONFIGURATION FILES (configs and settings)  
/dev     DEVICE FILES (device access files)  
/proc    PROCESS INFORMATION (proc & kernel data)  
/var     CHANGING DATA (logs, caches, queues, dbs)  
/tmp     TEMPORARY FILES (temp stuff, wiped on reboot)  
/usr     UNIX SYSTEM RESOURCES (apps, libs, docs)  
/home    HOME DIRECTORIES (user homes, personal files)  
/boot    BOOT FILES (kernel and bootloader)  
/lib     SYSTEM LIBRARIES (libs and kernel modules)  
/opt     ADDITIONAL APPS (third-party software)  
/mnt     TEMPORARY MOUNT (manual mount points)  
/media   REMOVABLE MEDIA (auto-mount usb/cd)  
/srv     SERVICE DATA (web, ftp, db service data)  

/root    ROOT USER HOME (root's home dir)  
/sys     KERNEL INTERFACE (kernel & hardware info)  
/run     RUNTIME DATA (runtime files, /var/run repl.)  
/lost+found RECOVERED FILES (fsck-recovered files)  

This is the basic Linux skeleton. In almost every distribution, it looks the same.

The base of this cheatsheet has been circulating online, but it often had mistakes and lacked proper functional explanations. For example, it’s important to know that /usr does not contain your personal files (that’s what /home is for), but rather system resources: programs, libraries, and documentation available to all users. I also added root, sys, and run. Anyway, sharing it here 🙂

Posted in Linux (en), OS | Leave a comment

Google Chrome clutters the disk: CacheStorage and Service Worker

In the folder…
C:\Users\<user>\AppData\Local\Google\Chrome\User Data\Default\Service Worker\CacheStorage
…Chrome keeps piling up 20+ GB every few months like clockwork. Other browsers don’t pull this kind of crap. I have to clean it out manually every time.

And yeah, this isn’t the regular image cache, it’s service workers. What happens: when you visit a site, the browser can register a background process — a Service Worker. It runs independently of tabs and lives in the background to provide offline access (which I absolutely don’t need), faster page loads (I turn that off lol), push notifications (ALWAYS DISABLED, hello?? stop clogging up my computer!), and other cursed PWA stuff (Progressive Web App = “progressive” my ass web app). Basically, Continue reading

Posted in Browsers, Google Chrome | Leave a comment

How to Create a Black Outline Around an Image in Photoshop

Let’s say you have this cave image on a transparent background:

You need to make a black outline around it — this can be used, for example, for a parallax effect in a game. Let’s get started…

1. Create a mask: Layer → Layer Mask → From Transparency

2. Alt + click on the mask (so that a border appears around it). Continue reading

Posted in Game Development, Photoshop (en) | Leave a comment

Changing monitor brightness with a hotkey using AutoHotKey

Sometimes you need to quickly decrease or increase screen brightness without extra clicks. On my laptop this used to be handled by the built-in ASUS utility, but it always messed with the fan control, so I had to remove it. In the end, you can just use this script.

  1. Download AutoHotKey
  2. Create a .ahk file and put this inside:
F1::
Run, cmd /c wmic /namespace:\\root\wmi PATH WmiMonitorBrightnessMethods WHERE "Active=1" CALL WmiSetBrightness Brightness=10 Timeout=1
return

F2::
Run, cmd /c wmic /namespace:\\root\wmi PATH WmiMonitorBrightnessMethods WHERE "Active=1" CALL WmiSetBrightness Brightness=100 Timeout=1
return

It didn’t work through PowerShell, so I used the internal Windows way.

What the script does: Continue reading

Posted in Windows 11 (en) | Leave a comment

Brain vs Supercomputer: Comparison of Power and Energy Efficiency

🧠 The Brain – the most powerful computer on the planet?

Imagine you have the most powerful supercomputer right in your head. It performs 1 quintillion operations per second, works 17 times faster than the entire Internet, and consumes only 20 W — like a regular light bulb! In this article, we will explore how the brain compares to the best supercomputers, how much data it processes daily, and why no computer has yet been able to replicate its unique abilities.

Continue reading

Posted in Supercomputers | Leave a comment

Terminating processes when exiting SSH

When working with git and a server via SSH, there’s a common headache: ssh-agent (or other processes) keep running in the background, even after you exit the console with exit. This leads to dozens of ssh-agent processes piling up… and most hosting providers have strict limits on the number of active processes. Not to mention, they just waste resources for no reason. And we’re all for efficiency, right?

So, here’s a quick recipe on how to automatically terminate ssh-agent on exit to avoid errors like:

error: cannot create thread: Resource temporarily unavailable
fatal: send-pack: unable to fork off sideband demultiplexer
-bash: fork: retry: Resource temporarily unavailable
-bash: fork: Resource temporarily unavailable

Continue reading

Posted in Git (en), Linux (en) | Leave a comment

Delete ‘Home’ and ‘Gallery’ in Windows 11

Old rascal Billy keeps adding a bunch of idiotic interf*c* elements like Home and Gallery, which any sane person would want to burn away with holy water. Let’s get started.

Remove Home

  1. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}
  2. Rename {f874310e-b6b7-47dc-bc84-b9e6b38f5903} to DISABLE_HOME_BUTTON={f874310e-b6b7-47dc-bc84-b9e6b38f5903} (you can revert it later if needed by renaming it back)
  3. Restart Explorer.

Remove Gallery

  1. Go to HKEY_CURRENT_USER\Software\Classes\CLSID\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}
  2. If {e88865ea-0e1c-4e20-9aa6-edcd0212c87c} doesn’t exist, create it (right-click → New → Key)
  3. Inside it, create a DWORD (32-bit) parameter named System.IsPinnedToNameSpaceTree
  4. Done! The default value of the newly created DWORD is 0, which is exactly what we need
  5. Restart Explorer.

And so… another mischief by old Billy has been defeated. Goodness triumphs, and Billy slithers away to brew up some new nastiness for the next version of Windows.

Posted in Windows 11 (en) | Leave a comment

Progger of 21th centure: editor

ChatGPT and the like have made coders into editors. Writing code is no longer necessary. It needs to be edited. Now (for now), the task is to turn crappy code into the code. Later, even that won’t need to be done. It will be enough to set tasks (formulating them effectively).

Well, that’s fine. I don’t see the point in breaking hands and throwing tantrums, as some tend to do. Adapt, gentlemen.

Posted in Uncategorized | Leave a comment

Git: How to Prevent a Repository Branch from Being Published

Sometimes, you need to keep a branch private, and to protect yourself from accidentally clicking ‘Publish Branch,’ it’s a good idea to prevent its publication. On Windows, you can do it like this…

In the folder .git/hooks, create a file named pre-push (without an extension) and place the following content inside:

#!/bin/sh

# List of branches to protect
PROTECTED_BRANCHES="local-branch-name"

# Get the name of the branch being pushed
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/,,')

# Check if the current branch is in the list of protected branches
if echo "$PROTECTED_BRANCHES" | grep -w "$current_branch" > /dev/null; then
    echo "Pushing to branch '$current_branch' is not allowed."
    exit 1
fi
Posted in Git (en) | Leave a comment

[Solution] VLC Off Screen (window not visible)

The article was updated in 2024 to fix this issue once and for all

ARRRGGH! For several years, the same issue persists—VLC player keeps disappearing off the screen. I always forget how to retrieve it and end up Googling. Here’s a quick guide on how to do it:

  1. Open VLC and make it “active” (click on it from the taskbar) so it becomes the currently selected application (even if you can’t see it).
  2. Put aside your mouse, you won’t need it 🙂 Press the Alt + Space keys.
  3. A small popup menu should appear on the side of the screen. Look for the “Move” option (if it’s not there, use “restore”). Select it.
  4. Now use the arrow keys to “pull” the player back from the edge of the screen. My VLC always slips to the left, so I use the left arrow. When you’re done, press Enter.

If this doesn’t help, you might just need to reinstall the program.

Next… Here’s how to prevent this from happening again (this occurs to me with low DPI and 4K video):

Continue reading

Posted in Problems and solutions | 1 Comment

“Select which icons appear on the taskbar” setting is missing

For a dozen years, Windows has had a setting – “what to display in the tray”. It’s called: “Select which icons appear on the taskbar“. And now in Windows 11, it’s gone. WHAT TO DO?

No need to panic. Billy has “improved” our life once again. I already went into

HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify

to pull out the hexadecimal values of the apocalypse… by the way, here’s a script… note that you need to have the app you want already opened in the tray to extract its ID:

# Export the TrayNotify key
$regPath = "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify"
$exportPath = "C:\path\to\output\TrayNotifyBackup.reg"
Reg export $regPath $exportPath
Write-Output "TrayNotify key exported to $exportPath"

And then you need to insert this ID:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify]
"YourAppIdentifier"=dword:00000002

But… it TURNED OUT, that Billy kind of made a convenient thing. You can DRAG icons from hidden to the active tray WITH A MOUSE. @#$%in mouse. And why couldn’t they write about this in the place where this setting was removed?

I apologize for the tone, but when you’re dealing with Billy – it’s hard to write any other way.

Posted in Windows 11 (en) | Leave a comment

Windows server via RDP: problem with resolution and DPI

When you connect via RDP to a server on Windows, Windows automatically selects the resolution and DPI based on what is set on the client.

That is, RDP “mirrors” the client. And if you connect from a machine with high DPI, then RDP will set a high DPI on the server too. Which can interfere with installing some apps (for example).

Moreover, if you simply change the DPI on the client – it will not help immediately. You need to reboot the client, and then reboot the server. Then everything will be mirrored correctly. Well.. that’s essentially what this article is about. You need to change both and.. reboot here and there. Billy the Pervert surprises as usual.

There is also another option:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\IgnoreClientDesktopScaleFactor
DWORD32
Value: 1

Posted in Windows Server (en) | Leave a comment

Disable Go language telemetry

It turns out, Go (specifically gopls aka the local language server) collects telemetry, the scoundrel. Gathering some kind of anonymous data on how we code. How to disable it:

  1. C:\Users<user>\AppData\Roaming\go\telemetry
  2. create a file there named mode (without an extension!)
  3. inside the file, write just one word: off

Although, in terms of Windows telemetry, I gave up a long time ago – got tired of cleaning it up. But if there is some sort of tele-perversion that can simply be turned off once and for all – it must be done. Just so PC won’t slow down in vein.

Posted in Go (en) | Leave a comment

Architecture in programming

In programming, as in construction (and everywhere else – from shearing sheeps to hammering nails), the foundation of everything is architecture. It determines the stability and functionality of the final product. Let’s consider this process through an analogy with building a house, reflecting different levels of developers’ experience: from a shack to a stone house. Continue reading

Posted in Programming (en) | Leave a comment