Change process’s priority in Windows

The simplest means to do this is by simply opening Task Manager in Windows and navigating to the Details pane. Right-click on a process in the list, then select Set priority from the menu.

Alternatively, similar to the Linux renice command, the priority can also be set via command-line in Windows using

wmic process where name="devenv.exe" CALL setpriority "high priority"

The aforementioned methods will not persist upon system restart. Permanently setting the default priority of a process can be achieved using a registry script. This file can contain as many entries as desired. In this example below, I set the default process priority of devenv.exe and sqlservr.exe to High 00000003:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe\PerfOptions] 
"CpuPriorityClass"=dword:00000003

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sqlservr.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sqlservr.exe\PerfOptions] 
"CpuPriorityClass"=dword:00000003

Compressing PNG images with pngout, optipng, and advpng

Screenshot tools for Linux and macOS generally produce image files in the .png file format. PNG is a lossless compression format, meaning that it can be compressed without losing quality, which is unlike another commonly used image format, JPG. There are 3 command-line tools which can be used to compress PNG files, pngout, optipng, and advpng.

➜  pngout terminator-terminal-window.png 
 In:   11405 bytes               terminator-terminal-window.png /c6 /f5
Out:    8790 bytes               terminator-terminal-window.png /c2 /f5
Chg:   -2615 bytes ( 77% of original)
➜  optipng -o7 terminator-terminal-window.png 
** Processing: terminator-terminal-window.png
800x266 pixels, 3x8 bits/pixel, RGB+transparency
Input IDAT size = 8715 bytes
Input file size = 8790 bytes

Trying:
  zc = 9  zm = 9  zs = 0  f = 0		IDAT size = 8140
  zc = 9  zm = 8  zs = 0  f = 0		IDAT size = 8140
                               
Selecting parameters:
  zc = 9  zm = 8  zs = 0  f = 0		IDAT size = 8140

Output IDAT size = 8140 bytes (575 bytes decrease)
Output file size = 8215 bytes (575 bytes = 6.54% decrease)

➜  advpng -z4 terminator-terminal-window.png 
        8215        7232  88% terminator-terminal-window.png
        8215        7232  88%

vim and spaces/tabs

vim is my favorite cli text editor. It doesn’t require much configuration, but if you edit code and use spaces in place of tabs, you probably want to add a line to your ~/.vimrc:

set tabstop=2 softtabstop=2 expandtab shiftwidth=2 smarttab

Of course, choose the number of spaces that suits your needs. 🙂