Ernest Iliiasov

Windows 10 with MacOS-like key bindings

As someone who’s been using Mac for a while, I find it pretty annoying to switch between my work Mac and my home Windows PC. There’s a lot of tiny differences in keyboard shortcuts and micro-interactions that just make using Windows so awkward.

Here’s the list of what this article will help you to set up:

  • Use Cmd instead of Ctrl
  • Use Caps Lock to switch keyboard layout
  • Use Option+Left/Right to jump a word (unlike Ctrl+Left/Right on Windows)
  • Use Option+Backspace to delete a word (unlike Ctrl+Backspace on Windows)
  • Quit programs on Cmd+Q instead of Alt+F4
  • Use F10, F11, F12 for Volume control
  • Invert scroll wheel direction
  • Have something like Spotlight

Apps

PowerToys: https://github.com/microsoft/PowerToys
SharpKeys: https://github.com/randyrants/sharpkeys

Keyboard Mappings

Swap Cmd (Win) and Ctrl with SharpKeys
Left Ctrl → Left Windows
Left Windows → Left Ctrl

Set Key Mappings with PowerToys Keyboard Manager

Caps Lock → Win + Space (Change keyboard layout with Caps Lock)
F3 → Win + Tab
F12 → Volume Up
F11 → Volume Down
F12 → Volume Mute

Set Shortcuts in PowerToys Keyboard Manager

Alt + Backspace → Ctrl Backspace
Alt + Left → Ctrl Left
Alt + Right → Ctrl Right
Ctrl Q → Alt F4
Ctrl Shift 4 → Win Shift S (screenshot)

Add “Spotlight” to Windows: PowerToys Run

Windows Start Menu search panel does the job most of the time, but I still miss the convenience of Spotlight’s position in the center of the screen. Fortunately, PowerToys includes a feature named Run - and it looks and works (almost) exactly like Spotlight on a Mac.

Choose PowerToys Run in the sidebar, and use these settings:

  • Enable: true
  • Shortcut: Ctrl + Space
  • Clear the previous query on launch: true
  • Disable drive detection warning: true

Reverse scroll wheel direction

These settings will bring “natural” scrolling direction to your Windows mouse. If you’re lucky and never had to get used to the Mac-style scrolling, skip it.

  • Source and detailed instructions: https://appuals.com/how-to-reverse-the-scrolling-direction-in-windows-10/
  • Open Device Manager, find your mouse, find its Device Instant Path
  • Open Registry Editor, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID. Find the folder that matches the Device Instant Path of the mouse
  • Under Device Parameters set FlipFlopWheel to 1
    Restart
 No comments    6   15 d  

Docker, one VPS and many domains

Like many software developers, I work on personal projects from time to time. To host them I use a VPS, and setting it up manually can be tricky. At first, I used the Vesta Control Panel for hosting my PHP and MySQL sites. Several years ago I switched from PHP/MySQL to Node JS/MongoDB, and now I had to configure my VPS manually. Although it’s pretty straightforward, it does take time and it’s not fun to troubleshoot when something goes wrong.

At some point, I realized that maintaining my server became too tedious: I had to take care of software updates, deployments, backups, and writing nginx configurations every time I had to host a new site.

Using Docker to host multiple projects on one VPS

Now let’s try to start from scratch and use Docker to host multiple projects on a single VPS. Why Docker? These factors mattered most for me:

  1. Every docker application contains its own environment and runs isolated.
  2. You can spin up your VPS from a single docker-compose.yml (and backed up data volumes).
  3. It separates code from data by using volumes.
  4. nginx-proxy makes it super easy to host multiple projects.

Here’s the list of services, software and Docker images that I used:

  • GitLab for hosting docker-compose.yaml.
  • Backblaze B2 for backups – it’s free for up to 10GB.
  • LogDNA for log monitoring.
  • Ubuntu – host OS.
  • Docker and Docker Compose.
  • jwilder/nginx-proxy – automatic nginx reverse proxy.
  • jrcs/letsencrypt-nginx-proxy-companion – takes care of HTTPS. No configuration needed.
  • php-apache and mariadb for PHP projects (like this blog).
  • node-alpine and mongo for Node JS projects.
  • nginx:alpine for static sites.

Setting up Docker host

Install the operating system of your choice, and do some primary setup. Configure firewall, set a custom SSH port, create a sudo user, and install Docker.

Writing docker-compose.yml

This is a docker-compose file that will get you started with nginx-proxy and letsencrypt.

 No comments    860   11 mon