├── .gitattributes ├── .gitignore ├── development.md ├── readme.md ├── res ├── explorer.png ├── keymap.txt ├── keymap.zip ├── start-2019-11-13.png ├── start-2020-05-26.png ├── start-2020-11-28.png ├── start-2020-12-08.png ├── vs.png └── zenmap.ico ├── setup ├── .gitignore ├── IconData │ ├── code.xcf │ ├── database.xcf │ └── git.xcf ├── IconExtract │ ├── iconsext.cfg │ ├── iconsext.chm │ ├── iconsext.exe │ ├── readme.md │ └── readme.txt ├── Icons │ ├── asm.ico │ ├── c.ico │ ├── code.ico │ ├── cpp.ico │ ├── cs.ico │ ├── database.ico │ ├── git.ico │ ├── h.ico │ ├── hpp.ico │ ├── rc.ico │ ├── vb.ico │ └── xml.ico ├── SetUserFTA │ ├── EULA.txt │ ├── SHA256.txt │ ├── SetUserFTA.exe │ ├── readme.md │ └── version.txt ├── Test │ ├── .clang-format │ ├── .clang-tidy │ ├── .gitattributes │ ├── .gitconfig │ ├── .gitignore │ ├── .gitmodules │ ├── code │ │ ├── asm.asm │ │ ├── asm.s │ │ ├── c.c │ │ ├── cmake.cmake │ │ ├── cmake.h.in │ │ ├── cpp.c++ │ │ ├── cpp.cc │ │ ├── cpp.cpp │ │ ├── cpp.cxx │ │ ├── cs.cs │ │ ├── css.css │ │ ├── h.h │ │ ├── hpp.h++ │ │ ├── hpp.hh │ │ ├── hpp.hpp │ │ ├── hpp.hxx │ │ ├── hpp.i++ │ │ ├── hpp.ipp │ │ ├── hpp.ixx │ │ ├── java.java │ │ ├── javascript.js │ │ ├── manifest.manifest │ │ ├── perl.pl │ │ ├── python.py │ │ ├── resource.rc │ │ ├── shell.sh │ │ ├── vb.vb │ │ └── xmlfile.xml │ ├── configuration.cfg │ ├── configuration.conf │ ├── configuration.ini │ ├── data.json │ ├── database.db │ ├── log.log │ ├── log.tlog │ ├── markdown.markdown │ ├── markdown.md │ ├── patch.diff │ ├── patch.patch │ ├── script.vim │ └── text.txt ├── files.ps1 ├── system.ps1 ├── system.psm1 └── utility.psm1 ├── vlan ├── 000.png ├── 001.png ├── 002.png └── readme.md └── wsl ├── alpine.md ├── ash.sh ├── bash.sh ├── gentoo.md ├── tmux.conf ├── ubuntu.md └── wsl.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | *.cmd text eol=crlf 2 | makefile text eol=lf 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /res/keymap/* 2 | !/res/keymap/RU-U.jpg 3 | !/res/keymap/RU-UAltGr.jpg 4 | !/res/keymap/RU-UShft.jpg 5 | !/res/keymap/RU-UShftAltGr.jpg 6 | !/res/keymap/US-U.jpg 7 | !/res/keymap/US-UAltGr.jpg 8 | !/res/keymap/US-UShft.jpg 9 | !/res/keymap/US-UShftAltGr.jpg 10 | 0 11 | -------------------------------------------------------------------------------- /development.md: -------------------------------------------------------------------------------- 1 | # Development 2 | Installation and configuration of a Windows 10 development workstation. 3 | 4 | ## Symbolic Link Policy 5 | Allow local user to create symbolic links. 6 | 7 | ``` 8 | secpol.msc 9 | + Security Settings > Local Policies > User Rights Assignment 10 | Create symbolic links 11 | + Add User or Group... 12 | 1. Enter own user name. 13 | 2. Click on "Check Names". 14 | 3. Click on "OK". 15 | ``` 16 | 17 | Update group policy. 18 | 19 | ```cmd 20 | gpupdate /force 21 | ``` 22 | 23 | Reboot the system. 24 | 25 | ## Git 26 | Install [Git](https://git-scm.com/downloads). 27 | 28 | ``` 29 | Select Components 30 | ☐ Windows Explorer integration 31 | ☐ Associate .git* configuration files with the default text editor 32 | ☐ Associate .sh files to be run with Bash 33 | 34 | Choosing the default editor used by Git 35 | Use Visual Studio Code as Git's default editor 36 | 37 | Adjusting the name of the initial branch in new repositories 38 | ◉ Override the default branch name for new repositories 39 | Specify the name "git init" should use for the initial branch: master 40 | 41 | Configuring the line ending conversions 42 | ◉ Checkout as-is, commit as-is 43 | 44 | Configuring the terminal emulator to use Git Bash 45 | ◉ Use Windows' default console window 46 | 47 | Choose the default behavior of `git pull` 48 | ◉ Rebase 49 | 50 | Choose a credential helper 51 | ◉ None 52 | ``` 53 | 54 | ## Visual Studio 55 | Install [Visual Studio](https://visualstudio.microsoft.com/downloads/). 56 | 57 | ``` 58 | Workloads 59 | ☑ Desktop development with C++ 60 | ☑ Node.js development 61 | 62 | Individual components 63 | + Cloud, database, and server 64 | ☐ Web Deploy 65 | + Code tools 66 | ☐ NuGet package manager 67 | + Debugging and testing 68 | ☐ C++ AddressSanitizer (Experimental) 69 | ☐ Test Adapter for Boost.Test 70 | ☐ Test Adapter for Google Test 71 | + Development activities 72 | ☐ Live Share 73 | ``` 74 | 75 | Add the following directories to the system environment variable `Path`. 76 | 77 | ``` 78 | C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja 79 | C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin 80 | C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Msbuild\Microsoft\VisualStudio\NodeJs 81 | ``` 82 | 83 | Set the system environment variable `VSCMD_SKIP_SENDTELEMETRY` to `1`. 84 | 85 |
86 | Configuration 87 | 88 | Install extensions. 89 | 90 | * [Hide Suggestion And Outlining Margins][hi] 91 | * [Trailing Whitespace Visualizer][ws] 92 | 93 | [hi]: https://marketplace.visualstudio.com/items?itemName=MussiKara.HideSuggestionAndOutliningMargins 94 | [ws]: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer 95 | 96 | Configure with `Tools > Options...`. 97 | 98 | ``` 99 | Environment 100 | + General 101 | Color theme: Dark 102 | + Documents 103 | ☑ Save documents as Unicode when data cannot be saved in codepage 104 | + Fonts and Colors 105 | Text Editor: DejaVu LGC Sans Mono 9 106 | [All Text Tool Windows]: DejaVu LGC Sans Mono 9 107 | + Keyboard 108 | Build.BuildSolution: F7 (Global) 109 | + Startup 110 | On startup, open: Empty environment 111 | 112 | Projects and Solutions 113 | + General 114 | ☐ Always show Error List if build finishes with errors 115 | ☐ Warn user when the project location is not trusted 116 | + Build and Run 117 | On Run, when projects are out of date: Always build 118 | On Run, when build or deployment error occur: Do not launch 119 | 120 | Source Control 121 | + Plug-in Selection 122 | Current source control plug-in: Git 123 | 124 | Text Editor 125 | + General 126 | ☐ Drag and drop text editing 127 | ☑ Enable mouse click to perform Go to Definition 128 | Use modifier key: Ctrl+Alt 129 | ☐ Enable mouse click to perform Go to Definition 130 | ☐ Highlight current line 131 | ☐ Show structure guide lines 132 | + All Languages 133 | + General 134 | ☑ Line numbers 135 | ☐ Navigation bar 136 | ☑ Automatic brace completion 137 | ☐ Apply Cut or Copy to blank lines when there is no selection 138 | + Scroll Bars 139 | ◉ Use map mode for vertical scroll bar 140 | ☐ Show Preview Tooltip 141 | Source overview: Wide 142 | + Tabs 143 | Indenting: Smart 144 | Tab size: 2 145 | Indent size: 2 146 | ◉ Indent spaces 147 | + CodeLens 148 | ☐ Enable CodeLens 149 | + C/C++ 150 | + Advanced 151 | + Browsing/Navigation 152 | Disable External Dependencies Folders: True 153 | + IntelliSense 154 | Enable Template IntelliSense: False 155 | + Code Style 156 | + General 157 | Generated documentation comments style: Doxygen (///) 158 | + Formatting 159 | + General 160 | ◉ Run ClangFormat only for manually invoked formatting commands 161 | ☑ Use custom clang-format.exe file: C:\Program Files\LLVM\bin\clang-format.exe 162 | + Indentation 163 | ☐ Indent braces of lambdas used as parameters 164 | ☐ Indent namespace contents 165 | + New Lines 166 | Position of open braces for namespaces: Keep on the same line, but add a space before 167 | Position of open braces for types: Keep on the same line, but add a space before 168 | Position of open braces for functions: Move to a new line 169 | Position of open braces for control blocks: Keep on the same line, but add a space before 170 | Position of open braces for lambdas: Keep on the same line, but add a space before 171 | ☑ Place braces on separate lines 172 | ☑ For empty types, move closing braces to the same line as opening braces 173 | ☑ For empty function bodies, move closing braces to the same line as opening braces 174 | ☑ Place 'catch' and similar keywords on a new line 175 | ☐ Place 'else' on a new line 176 | ☐ Place 'while' in a do-while loop on a new line 177 | + Wrapping 178 | ◉ Always apply New Lines settings for blocks 179 | + IntelliSense 180 | + Inline Hints 181 | ☐ Display inline hints 182 | + View 183 | + Code Squiggles 184 | Macros in Skipped Browsing Regions: None 185 | Macros Convertible to constexpr: None 186 | + Outlining 187 | Enable Outlining: False 188 | + CSS 189 | + Advanced 190 | Color picker format: #000 191 | Automatic formatting: Off 192 | Brace positions: Compact 193 | + JavaScript/TypeScript 194 | + Formatting 195 | + General 196 | Automatic Formatting 197 | ☐ Format completed line on Enter 198 | ☐ Format completed statement on ; 199 | ☐ Format opened block on { 200 | ☐ Format completed block on } 201 | ☑ Format on paste 202 | Module Quote Preference 203 | ◉ Double (") 204 | Semicolon Preference 205 | ◉ Insert semicolons at statement ends 206 | + Spacing 207 | ☐ Insert space after function keyword for anonymous functions 208 | + JSON 209 | + Advanced 210 | Automatic formatting: Off 211 | 212 | CMake 213 | + General 214 | ☑ Show CMake cache notifications 215 | When cache is out of date: 216 | ◉ Run configure step automatically only if CMakeSettings.json exists 217 | ☑ Enable verbose CMake output 218 | ``` 219 | 220 | Disable telemetry. 221 | 222 | ``` 223 | Help > Send Feedback > Settings... 224 | + Would you like to participate in the Visual Studio Experience Improvement Program? 225 | ◉ No, I would not like to participate 226 | ``` 227 | 228 | Change [toolbars](res/vs.png) to fit the desired workflow. 229 | 230 |
231 | 232 | ## CLion 233 | Install [CLion](https://www.jetbrains.com/clion/download/). 234 | 235 |
236 | Configuration 237 | 238 | ``` 239 | Appearanace & Behavior 240 | + System Settings 241 | ☐ Confirm before exiting the IDE 242 | Project 243 | ☐ Reopen projects on startup 244 | Default project directory: C:\Workspace 245 | + Data Sharing 246 | ☐ Send usage statistics 247 | + Date Formats 248 | ☑ Override system date and time format 249 | Date format: yyyy-MM-dd 250 | 251 | Keymap 252 | Keymap: Visual Studio 253 | Main Menu > Run > Debug: F5 (Remove) 254 | Main Menu > Run > Debugging Actions > Resume Program: F9 (Remove) 255 | Main Menu > Run > Toggle Breakpoint > Toggle Line Breakpoint: F8 256 | 257 | Editor 258 | + General 259 | Rich-Text Copy 260 | ☐ Copy (Ctrl+C) as rich text 261 | + Code Folding 262 | ☐ Show code folding outline 263 | + Code Style 264 | ClangFormat 265 | ☑ Enable ClangFormat (only for C/C++/Objective-C) 266 | + C/C++ 267 | Scheme: Default 268 | + Tabs and Indents 269 | Tab size: 2 270 | Indent: 2 271 | Continuation indent: 2 272 | Indent in lambdas: 2 273 | Indent members of plain structures: 2 274 | Indent members of classes: 2 275 | Indent members of namespace: 0 276 | + Spaces 277 | + Within 278 | ☑ Initializer lists braces 279 | + Other 280 | ☑ Prevent >> concatenation in template 281 | ☐ Before '*' in declarations 282 | ☑ After '*' in declarations 283 | ☐ Before '&' in declarations 284 | ☑ After '&' in declarations 285 | ☑ Keep spaces between the same-type brackets 286 | + In Template Declaration 287 | ☑ Before '<' 288 | + Wrapping and Braces 289 | + Function declaration parameters 290 | ☐ Align when multiline 291 | + Function call arguments 292 | ☐ Align when multiline 293 | + 'switch' statement 294 | ☐ Indent 'case' branches 295 | + 'try' statement 296 | ☑ 'catch' on new line 297 | + Binary expressions 298 | ☐ Align when multiline 299 | ☑ New line after '(' 300 | + Assignment statement 301 | ☐ Align when multiline 302 | + Ternary operation 303 | ☐ Align when multiline 304 | ☐ '?' and ':' signs on next line 305 | + Initializer lists 306 | ☐ Align when multiline 307 | + New File Extensions 308 | + C++ 309 | Source Extensions: cpp 310 | Header Extensions: hpp 311 | File Naming Convention: snake_case 312 | + C 313 | File Naming Convention: snake_case 314 | + CUDA 315 | File Naming Convention: snake_case 316 | + CMake 317 | Scheme: Default 318 | + Tabs and Indents 319 | Tab size: 2 320 | Indent: 2 321 | Continuation indent: 2 322 | + Spaces 323 | ☐ 'if' parentheses 324 | ☐ 'for' parentheses 325 | ☐ 'while' parentheses 326 | 327 | + Inlay Hints 328 | ☐ Show hints for: 329 | 330 | Plugins 331 | String Manipulation 332 | 333 | Build, Execution, Deployment 334 | + Toolchains 335 | + Visual Studio 336 | Architecture: amd64 337 | + CMake 338 | + Debug 339 | CMake options: 340 | -GNinja 341 | -DCMAKE_TOOLCHAIN_FILE="C:/Workspace/vcpkg/triplets/toolchains/windows.cmake" 342 | -DVCPKG_TARGET_TRIPLET="x64-windows-xnet" 343 | Build directory: build\windows\debug 344 | + Add: Release 345 | CMake options: 346 | -GNinja 347 | -DCMAKE_TOOLCHAIN_FILE="C:/Workspace/vcpkg/triplets/toolchains/windows.cmake" 348 | -DVCPKG_TARGET_TRIPLET="x64-windows-xnet" 349 | Build directory: build\windows\release 350 | 351 | Language & Frameworks 352 | + SQL Dialects 353 | Global SQL Dialect: SQLite 354 | 355 | Tools 356 | + Terminal 357 | Copy to clipboard on selection 358 | + SSH Terminal 359 | Default encoding: UTF-8 360 | ``` 361 | 362 |
363 | 364 | ## Visual Studio Code 365 | Install [Visual Studio Code](https://code.visualstudio.com/download). 366 | 367 | ``` 368 | ☑ Add "Open with Code" action to Windows Explorer file context menu 369 | ☑ Add "Open with Code" action to Windows Explorer directory context menu 370 | ``` 371 | 372 |
373 | Configuration 374 | 375 | Install extensions with `CTRL+P`. 376 | 377 | ``` 378 | ext install twxs.cmake 379 | ext install ms-vscode.cpptools 380 | ext install ms-vscode-remote.remote-ssh 381 | ext install ms-vscode-remote.remote-wsl 382 | ext install donjayamanne.githistory 383 | ext install marvhen.reflow-markdown 384 | ext install alefragnani.rtf 385 | > Developer: Reload Window 386 | ``` 387 | 388 | Configure editor with `> Preferences: Open Settings (JSON)`. 389 | 390 | ```json 391 | { 392 | "editor.detectIndentation": false, 393 | "editor.dragAndDrop": false, 394 | "editor.folding": false, 395 | "editor.fontFamily": "'DejaVu LGC Sans Mono', Consolas, monospace", 396 | "editor.fontSize": 12, 397 | "editor.largeFileOptimizations": false, 398 | "editor.links": false, 399 | "editor.minimap.scale": 2, 400 | "editor.multiCursorModifier": "ctrlCmd", 401 | "editor.renderFinalNewline": false, 402 | "editor.renderLineHighlight": "gutter", 403 | "editor.renderWhitespace": "selection", 404 | "editor.rulers": [ 128 ], 405 | "editor.smoothScrolling": true, 406 | "editor.tabSize": 2, 407 | "editor.wordWrap": "on", 408 | "editor.wordWrapColumn": 128, 409 | "explorer.confirmDelete": false, 410 | "explorer.confirmDragAndDrop": false, 411 | "extensions.ignoreRecommendations": true, 412 | "files.eol": "\n", 413 | "files.hotExit": "off", 414 | "files.insertFinalNewline": true, 415 | "files.trimTrailingWhitespace": true, 416 | "files.defaultLanguage": "markdown", 417 | "git.autofetch": false, 418 | "git.autoRepositoryDetection": false, 419 | "git.confirmSync": false, 420 | "git.enableSmartCommit": true, 421 | "git.postCommitCommand": "push", 422 | "git.showPushSuccessNotification": true, 423 | "telemetry.enableCrashReporter": false, 424 | "telemetry.enableTelemetry": false, 425 | "workbench.startupEditor": "none", 426 | "window.newWindowDimensions": "inherit", 427 | "window.openFoldersInNewWindow": "on", 428 | "window.openFilesInNewWindow": "off", 429 | "window.restoreWindows": "none", 430 | "window.closeWhenEmpty": false, 431 | "terminal.integrated.rendererType": "experimentalWebgl", 432 | "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe", 433 | "C_Cpp.clang_format_path": "C:\\Program Files\\LLVM\\bin\\clang-format.exe", 434 | "C_Cpp.default.cStandard": "c11", 435 | "C_Cpp.default.cppStandard": "c++20", 436 | "C_Cpp.enhancedColorization": "Enabled", 437 | "C_Cpp.experimentalFeatures": "Enabled", 438 | "C_Cpp.configurationWarnings": "Disabled", 439 | "C_Cpp.intelliSenseEngineFallback": "Disabled", 440 | "C_Cpp.intelliSenseEngine": "Disabled", 441 | "C_Cpp.vcpkg.enabled": false, 442 | "cmake.configureOnOpen": false, 443 | "html.format.extraLiners": "", 444 | "html.format.indentInnerHtml": false, 445 | "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, 446 | "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": true, 447 | "typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, 448 | "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": true, 449 | "remote.SSH.defaultExtensions": [ 450 | "twxs.cmake", 451 | "ms-vscode.cpptools", 452 | "ms-vscode.cmake-tools" 453 | ] 454 | } 455 | ``` 456 | 457 | Configure keyboard shortcuts with `> Preferences: Open Keyboard Shortcuts (JSON)`. 458 | 459 | ```json 460 | [ 461 | { "key": "f5", "command": "cmake.debugTarget", "when": "!inDebugMode" }, 462 | { "key": "f5", "command": "workbench.action.debug.pause", "when": "inDebugMode && debugState == 'running'" }, 463 | { "key": "f5", "command": "workbench.action.debug.continue", "when": "inDebugMode && debugState != 'running'" }, 464 | { "key": "ctrl+b", "command": "cmake.selectLaunchTarget" }, 465 | { "key": "ctrl+f5", "command": "cmake.launchTarget" } 466 | ] 467 | ``` 468 | 469 | Open a directory in WSL and install remote extensions. 470 | 471 | ``` 472 | CMake (from local) 473 | C/C++ (from local) 474 | ms-vscode.cmake-tools 475 | ``` 476 | 477 | Configure remote editor with `> Preferences: Open Remote Settings (WSL: Ubuntu)` while editing a directory in WSL. 478 | 479 | ```json 480 | { 481 | "C_Cpp.vcpkg.enabled": false, 482 | "C_Cpp.default.cStandard": "c11", 483 | "C_Cpp.default.cppStandard": "c++20", 484 | "C_Cpp.default.configurationProvider": "vector-of-bool.cmake-tools", 485 | "C_Cpp.default.intelliSenseMode": "clang-x64", 486 | "C_Cpp.intelliSenseEngine": "Default", 487 | "C_Cpp.clang_format_path": "/opt/llvm/bin/clang-format", 488 | "cmake.buildDirectory": "${workspaceFolder}/build/vscode", 489 | "cmake.cmakePath": "/opt/cmake/bin/cmake", 490 | "cmake.generator": "Ninja Multi-Config", 491 | "cmake.installPrefix": "${workspaceFolder}", 492 | "cmake.configureSettings": { "VSCODE": "ON" }, 493 | "cmake.configureOnOpen": true, 494 | "cmake.debugConfig": { 495 | "version": "0.2.0", 496 | "configurations": [ 497 | { 498 | "name": "Debug", 499 | "type": "cppdbg", 500 | "request": "launch", 501 | "cwd": "${workspaceFolder}", 502 | "program": "${command:cmake.launchTargetPath}", 503 | "MIMode": "gdb", 504 | "stopAtEntry": false, 505 | "externalConsole": false, 506 | "internalConsoleOptions": "neverOpen", 507 | "setupCommands": [ 508 | { 509 | "description": "Enable pretty printing.", 510 | "text": "-enable-pretty-printing", 511 | "ignoreFailures": true, 512 | } 513 | ] 514 | } 515 | ] 516 | } 517 | } 518 | ``` 519 | 520 | Configure remote toolkits with `CMake: Edit User-Local CMake Kits` while editing a directory in WSL. 521 | 522 | ```json 523 | [ 524 | { 525 | "keep": true, 526 | "name": "Ace", 527 | "toolchainFile": "/opt/ace/toolchain.cmake" 528 | }, 529 | { 530 | "keep": true, 531 | "name": "Xnet", 532 | "toolchainFile": "/opt/vcpkg/triplets/toolchains/linux.cmake", 533 | "cmakeSettings": { "VCPKG_TARGET_TRIPLET": "x64-linux-xnet" } 534 | } 535 | ] 536 | ``` 537 | 538 |
539 | 540 | ## LLVM 541 | Install [LLVM](https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/LLVM-11.0.0-win64.exe). 542 | 543 | ``` 544 | Install Options 545 | ◉ Add LLVM to the system PATN for all users 546 | ``` 547 | 548 | ## NASM 549 | Install [NASM](https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/win64/nasm-2.15.05-installer-x64.exe) 550 | 551 | ``` 552 | ☐ RDOFF 553 | ☐ Manual 554 | ☐ VS8 integration 555 | ``` 556 | 557 | Add the following directories to the system environment variable `Path`. 558 | 559 | ``` 560 | C:\Program Files\NASM 561 | ``` 562 | 563 | ## Vulkan 564 | Install [Vulkan](https://vulkan.lunarg.com/sdk/home#windows). 565 | 566 | ``` 567 | Choose Install Location 568 | C:\Vulkan 569 | ``` 570 | 571 | ## Ubuntu 572 | Install basic development packages after installing [Ubuntu](wsl/ubuntu.md) in WSL. 573 | 574 | ```sh 575 | sudo apt install -y binutils-dev gcc g++ gdb make nasm ninja-build manpages-dev pkg-config 576 | ``` 577 | 578 | Take ownership of the `/opt` directory. 579 | 580 | ```sh 581 | sudo chown $(id -un):$(id -gn) /opt 582 | ``` 583 | 584 | Install [CMake](https://cmake.org/). 585 | 586 | ```sh 587 | rm -rf /opt/cmake; mkdir -p /opt/cmake 588 | wget https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4-Linux-x86_64.tar.gz 589 | tar xf cmake-3.18.4-Linux-x86_64.tar.gz -C /opt/cmake --strip-components=1 590 | rm -f cmake-3.18.4-Linux-x86_64.tar.gz 591 | 592 | sudo tee /etc/profile.d/cmake.sh >/dev/null <<'EOF' 593 | export PATH="/opt/cmake/bin:${PATH}" 594 | EOF 595 | 596 | sudo chmod 0755 /etc/profile.d/cmake.sh 597 | . /etc/profile.d/cmake.sh 598 | ``` 599 | 600 | Install [Node](https://nodejs.org/). 601 | 602 | ```sh 603 | rm -rf /opt/node; mkdir -p /opt/node 604 | wget https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.xz 605 | tar xf node-v12.16.3-linux-x64.tar.xz -C /opt/node --strip-components=1 606 | rm -f node-v12.16.3-linux-x64.tar.xz 607 | 608 | sudo tee /etc/profile.d/node.sh >/dev/null <<'EOF' 609 | export PATH="/opt/node/bin:${PATH}" 610 | EOF 611 | 612 | sudo chmod 0755 /etc/profile.d/node.sh 613 | . /etc/profile.d/node.sh 614 | ``` 615 | 616 | Install [LLVM](https://llvm.org/). 617 | 618 | ```sh 619 | rm -rf /opt/llvm; mkdir -p /opt/llvm 620 | wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz 621 | tar xf clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz -C /opt/llvm --strip-components=1 622 | rm -f clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz 623 | 624 | sudo tee /etc/profile.d/llvm.sh >/dev/null <<'EOF' 625 | export PATH="/opt/llvm/bin:${PATH}" 626 | EOF 627 | 628 | sudo chmod 0755 /etc/profile.d/llvm.sh 629 | . /etc/profile.d/llvm.sh 630 | 631 | sudo tee /etc/ld.so.conf.d/llvm.conf >/dev/null <<'EOF' 632 | /opt/llvm/lib 633 | EOF 634 | 635 | sudo ldconfig 636 | ``` 637 | 638 | Set system LLVM C and C++ compiler. 639 | 640 | ```sh 641 | for i in clang clang++; do sudo update-alternatives --remove-all $i; done 642 | sudo update-alternatives --install /usr/bin/clang clang /opt/llvm/bin/clang 100 643 | sudo update-alternatives --install /usr/bin/clang++ clang++ /opt/llvm/bin/clang++ 100 644 | ``` 645 | 646 | Set system C and C++ compiler. 647 | 648 | ```sh 649 | for i in c++ cc; do sudo update-alternatives --remove-all $i; done 650 | sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 651 | sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100 652 | ``` 653 | 654 | Set system `clang-format` tool. 655 | 656 | ```sh 657 | sudo update-alternatives --remove-all clang-format 658 | sudo update-alternatives --install /usr/bin/clang-format clang-format /opt/llvm/bin/clang-format 100 659 | ``` 660 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Windows 2 | Installation and configuration instructions for Windows 10 20H2. 3 | 4 | 16 | 17 | ## Preparations 18 | Download the latest [Windows 10](https://www.microsoft.com/en-us/software-download/windows10) image 19 | and create the installation media using the Media Creation Tool or [Rufus](https://rufus.ie/). 20 | 21 | Create the file `\sources\ei.cfg` on the installation media. 22 | 23 | ```ini 24 | [EditionID] 25 | Professional 26 | [Channel] 27 | OEM 28 | [VL] 29 | 0 30 | ``` 31 | 32 | Create the file `\sources\pid.txt` on the installation media if `Channel` is `Retail`. 33 | 34 | ```ini 35 | [PID] 36 | Value={windows key} 37 | ``` 38 | 39 | Copy this repo and the latest graphics drivers installer to the installation media. 40 | 41 | Set the BIOS date and time to the current local time. 42 | 43 | **Keep the system disconnected from the network.** 44 | 45 | ## Installation 46 | Boot the installation media. 47 | 48 | ``` 49 | Language to install: English (United States) 50 | Time and currency format: {Current Time Zone Country} 51 | Keyboard or input method: {Current Hardware Keyboard} 52 | ``` 53 | 54 | Choose a single word username starting with a capital letter to keep the `%UserProfile%` path 55 | consistent and free from spaces. 56 | 57 | Verify Windows flavor and version with `Start > "winver"`. 58 | 59 | ## Setup 60 | Modify and execute [setup/system.ps1](setup/system.ps1) using the "Run with PowerShell" context menu 61 | repeatedly until it stops rebooting the system. 62 | 63 | 70 | 71 | ## Drivers & Updates 72 | Disable automatic driver application installation. 73 | 74 | ``` 75 | Start > "Change device installation settings" 76 | ◉ No (your device might not work as expected) 77 | ``` 78 | 79 | 1. Reboot the system. 80 | 2. Connect to the Internet. 81 | 3. Install Windows updates. 82 | 4. Repeat the "Setup" step. 83 | 84 | Reboot the system. 85 | 86 | 90 | 91 | ## Settings 92 | Settings that have yet to be incorporated into the [setup/system.ps1](setup/system.ps1) script. 93 | 94 | ### Keyboard Layout (Optional) 95 | 1. Install keyboard layouts from [res/keymap.zip](res/keymap.zip). 96 | 2. Configure Windows language preferences in Settings. 97 | 3. Disable keyboard layout preload. 98 | 99 | ``` 100 | reg delete "HKEY_USERS\.DEFAULT\Keyboard Layout\Preload" /f 101 | ``` 102 | 103 | Reboot the system. 104 | 105 | 109 | 110 | ### Devices 111 | ``` 112 | Typing 113 | + Spelling 114 | ☐ Autocorrect misspelled words 115 | + Typing 116 | ☐ Add a period after I double-tap the Spacebar 117 | 118 | AutoPlay 119 | + Choose AutoPlay defaults 120 | Removable drive: Open folder to view files (File Explorer) 121 | Memory card: Open folder to view files (File Explorer) 122 | ``` 123 | 124 | ### Network & Internet 125 | ``` 126 | Proxy 127 | + Automatic proxy setup 128 | ☐ Automatically detect settings 129 | ``` 130 | 131 | ### Personalization 132 | ``` 133 | Background 134 | + Background 135 | Browse: (select picture) 136 | 137 | Colors 138 | + Choose your color 139 | Windows colors: Navy blue 140 | 141 | Lock screen 142 | + Preview 143 | Browse: (select picture) 144 | 145 | Start 146 | + Start 147 | ☐ Show app list in Start menu 148 | ``` 149 | 150 | ### Time & Language 151 | ``` 152 | Region 153 | + Region 154 | Country or region: United States 155 | Regional format: English (United States) 156 | + Additional date, time, & regional settings > Change date, time, or number formats 157 | Formats > Additional settings... 158 | + Numbers 159 | Digit grouping symbol: ␣ 160 | Measurement system: Metric 161 | + Currency 162 | Currency symbol: € 163 | Positive currency format: 1.1 € 164 | Negative currency format: -1.1 € 165 | Digit grouping symbol: ␣ 166 | + Time 167 | Short time: HH:mm 168 | Long time: HH:mm:ss 169 | + Date 170 | Short date: yyyy-MM-dd 171 | Long date: ddd, d MMMM yyyy 172 | First day of week: Monday 173 | Administrative 174 | + Copy settings... 175 | ☑ Welcome screen and system accounts 176 | ☑ New user accounts 177 | ``` 178 | 179 | Reboot the system. 180 | 181 | ### Privacy 182 | ``` 183 | General 184 | + Change privacy options 185 | ☐ Let Windows track app launches to improve Start and search results 186 | ``` 187 | 188 | ### Shortcuts 189 | Create Network Connections shortcut in `powershell.exe`. 190 | 191 | ```ps 192 | $sm = "${env:UserProfile}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs" 193 | $sp = "${sm}\Network Connections.lnk" 194 | $ws = New-Object -ComObject WScript.Shell 195 | $sc = $ws.CreateShortcut($sp) 196 | $sc.IconLocation = 'C:\Windows\System32\netshell.dll,0' 197 | $sc.TargetPath = 'C:\Windows\System32\control.exe' 198 | $sc.Arguments = 'ncpa.cpl' 199 | $sc.Save() 200 | Invoke-Item $sm 201 | ``` 202 | 203 | ## Windows Libraries 204 | Move unwanted Windows libraries. 205 | 206 | 1. Right click on `%UserProfile%\Pictures\Camera Roll` and select "Properties".
207 | Select the "Location" tab and change the path to `%AppData%\Pictures\Camera Roll`. 208 | 2. Right click on `%UserProfile%\Pictures\Saved Pictures` and select "Properties".
209 | Select the "Location" tab and change the path to `%AppData%\Pictures\Saved Pictures`. 210 | 3. Right click on `%UserProfile%\Videos\Captures` and select "Properties".
211 | Select the "Location" tab and change the path to `%AppData%\Videos\Captures`. 212 | 213 | 221 | 222 | ## Indexing Options 223 | Configure Indexing Options to only track the "Start Menu" and rebuild the index. 224 | 225 | ## Firewall 226 | Disable all rules in Windows Firewall except the following entries. 227 | 228 | ``` 229 | wf.msc 230 | + Inbound Rules 231 | Core Networking - … 232 | Delivery Optimization (…) 233 | Hyper-V … 234 | Network Discovery (…) 235 | + Outbound Rules 236 | Core Networking - … 237 | Hyper-V … 238 | Network Discovery (…) 239 | ``` 240 | 241 | Enable inbound rules for `Core Networking Diagnostics - ICMP Echo Request (ICMPv…-In)`.
242 | Modify `Private,Public` rules for `ICMPv4` and `ICMPv6` inbound rules and select `Any IP address` 243 | under `Remote IP address` in the `Scope` tab. 244 | 245 | ## Microsoft Software 246 | * Install [Microsoft Edge](https://www.microsoft.com/en-us/edge) and configure 247 | [settings](https://gist.github.com/qis/8d5c6fb9d622540d88bfcc6934a20e3e). 248 | * Install [Microsoft Office](https://account.microsoft.com/services/) and configure 249 | [settings](https://gist.github.com/qis/2a0d23ed27b21cd15331b4ff3a1cf430). 250 | * Install [Windows Terminal](https://aka.ms/terminal) and configure 251 | [settings](https://github.com/qis/terminal). 252 | 253 | Configure autostart options. 254 | 255 | ``` 256 | Start > "Task Manager" > Startup 257 | Send to OneNote Tool: Disabled 258 | Windows Terminal: Enabled 259 | ``` 260 | 261 | ## Applications 262 | Install tools. 263 | 264 | * [7-Zip](http://www.7-zip.org) 265 | * [Audacity](https://www.audacityteam.org/) 266 | * [FontForge](https://fontforge.github.io/en-US/downloads/windows-dl/) 267 | * [Gimp](https://www.gimp.org/) 268 | * [ImageGlass](https://imageglass.org/) 269 | 270 | Install "Creation" software. 271 | 272 | * [Affinity Photo](https://affinity.serif.com/photo) 273 | * [Affinity Designer](https://affinity.serif.com/designer) 274 | * [Affinity Publisher](https://affinity.serif.com/publisher) 275 | * [Blender](https://www.blender.org/) 276 | * [MagicaVoxel](https://ephtracy.github.io/) 277 | * [LMMS](https://lmms.io/) 278 | 279 | Install "Administration" software. 280 | 281 | * [Wireshark](https://www.wireshark.org/) 282 | * [OpenVPN](https://openvpn.net/community-downloads-2/) 283 | 284 | Install "Development" software. 285 | 286 | * [Explorer Suite](http://www.ntcore.com/exsuite.php) 287 | * [OBS Studio](https://obsproject.com/download) 288 | 289 | Install or restore portable 64-bit third party software. 290 | 291 | * [MPV](https://mpv.srsfckn.biz/) 292 | * [HxD](https://mh-nexus.de/en/downloads.php?product=HxD20) 293 | * [Dependencies](https://github.com/lucasg/Dependencies) 294 | * [SQLite Browser](https://sqlitebrowser.org/) 295 | * [Sumatra](https://www.sumatrapdfreader.org/free-pdf-reader.html) 296 | 297 | Install or restore portable 32-bit third party software. 298 | 299 | * [KeePass](https://keepass.info/) 300 | * [SFXR](http://www.drpetter.se/project_sfxr.html) 301 | * [Resource Hacker](http://www.angusj.com/resourcehacker/) 302 | * [Sysinternals Suite](https://technet.microsoft.com/en-us/sysinternals/bb842062.aspx) 303 | * [Vim](https://www.vim.org/download.php) 304 | 305 | 308 | 309 | Disable Affinity update checks. 310 | 311 | ```cmd 312 | reg add "HKLM\SOFTWARE\Serif\Affinity\Photo\1" /v "No Update Check" /t REG_DWORD /d 1 /f 313 | reg add "HKLM\SOFTWARE\Serif\Affinity\Designer\1" /v "No Update Check" /t REG_DWORD /d 1 /f 314 | reg add "HKLM\SOFTWARE\Serif\Affinity\Publisher\1" /v "No Update Check" /t REG_DWORD /d 1 /f 315 | ``` 316 | 317 | Install [dictionaries](https://github.com/LibreOffice/dictionaries) in Affinity using the following schema. 318 | 319 | ``` 320 | en/en_US.aff -> C:\ProgramData\Affinity\Common\1.0\Dictionaries\en-US\en_US.aff 321 | en/en_US.dic -> C:\ProgramData\Affinity\Common\1.0\Dictionaries\en-US\en_US.dic 322 | en/hyph_en_US.dic -> C:\ProgramData\Affinity\Common\1.0\Dictionaries\en-US\hyph_en_US.dic 323 | ``` 324 | 325 | Configure LMMS paths on first startup. 326 | 327 | - Replace `%UserProfile%\Documents` with `%UserProfile%\Music`. 328 | - Use `PortAudio` with `WASAPI` backend. 329 | 330 | 334 | 335 | ## Windows Subsystem for Linux 336 | See [wsl/ubuntu.md](wsl/ubuntu.md) for WSL setup instructions. 337 | 338 | ## Development 339 | See [development.md](development.md) for development setup instructions. 340 | 341 | ## Start Menu 342 | ![Start Menu](res/start-2020-12-08.png) 343 | 344 | 356 | -------------------------------------------------------------------------------- /res/explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/res/explorer.png -------------------------------------------------------------------------------- /res/keymap.txt: -------------------------------------------------------------------------------- 1 | C | 1 | 2 2 | ---|----|---- 3 | ` | ° | 4 | 1 | ¹ | ₁ 5 | 2 | ² | ₂ 6 | 3 | ³ | ₃ 7 | 4 | ⁴ | ₄ 8 | 5 | ⁵ | ₅ 9 | 6 | ⁶ | ₆ 10 | 7 | ⁷ | ₇ 11 | 8 | ⁸ | ₈ 12 | 9 | ⁹ | ₉ 13 | 0 | ⁰ | ₀ 14 | - | ⁻ | ₋ 15 | = | ≈ | ≠ 16 | q | @ | 17 | e | € | 18 | r | ₽ | ® 19 | t | ™ | 20 | u | ü | Ü 21 | i | ᵢ | 22 | o | ö | Ö 23 | p | π | 24 | [ | « | „ 25 | ] | » | “ 26 | a | ä | Ä 27 | s | ß | ß 28 | d | $ | 29 | j | ⱼ | 30 | k | ₖ | 31 | ' | ` | ´ 32 | z | ❌ | 33 | x | × | 34 | c | ÷ | 35 | v | ✅ | 36 | b | • | 37 | n | № | 38 | m | µ | 39 | , | § | ≤ 40 | . | … | ≥ 41 | -------------------------------------------------------------------------------- /res/keymap.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/res/keymap.zip -------------------------------------------------------------------------------- /res/start-2019-11-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/res/start-2019-11-13.png -------------------------------------------------------------------------------- /res/start-2020-05-26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/res/start-2020-05-26.png -------------------------------------------------------------------------------- /res/start-2020-11-28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/res/start-2020-11-28.png -------------------------------------------------------------------------------- /res/start-2020-12-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/res/start-2020-12-08.png -------------------------------------------------------------------------------- /res/vs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/res/vs.png -------------------------------------------------------------------------------- /res/zenmap.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/res/zenmap.ico -------------------------------------------------------------------------------- /setup/.gitignore: -------------------------------------------------------------------------------- 1 | /files-*.ps1 2 | /system-*.ps1 3 | -------------------------------------------------------------------------------- /setup/IconData/code.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/IconData/code.xcf -------------------------------------------------------------------------------- /setup/IconData/database.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/IconData/database.xcf -------------------------------------------------------------------------------- /setup/IconData/git.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/IconData/git.xcf -------------------------------------------------------------------------------- /setup/IconExtract/iconsext.cfg: -------------------------------------------------------------------------------- 1 | [General] 2 | WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF BB 03 00 00 6E 00 00 00 0A 07 00 00 7A 02 00 00 3 | Columns=96 00 00 00 46 00 01 00 78 00 02 00 3C 00 03 00 64 00 04 00 D1 02 05 00 4 | LVMode=0 5 | Sort1=0 6 | Save.Folder=C:\Workspace\windows\setup\IconData 7 | Save.CursorsAsico=0 8 | Search.Wildcard=C:\Program Files\MPV\*.* 9 | Search.FindColors=0 10 | Search.FindWidthHeight=0 11 | Search.SearchCursors=0 12 | Search.SearchIcons=1 13 | Search.SubDir=1 14 | Search.FindColorsValue=8 15 | Search.FindHeightValue=32 16 | Search.FindWidthValue=32 17 | Search.ScanMode=1 18 | -------------------------------------------------------------------------------- /setup/IconExtract/iconsext.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/IconExtract/iconsext.chm -------------------------------------------------------------------------------- /setup/IconExtract/iconsext.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/IconExtract/iconsext.exe -------------------------------------------------------------------------------- /setup/IconExtract/readme.md: -------------------------------------------------------------------------------- 1 | # IconExtract 2 | 3 | -------------------------------------------------------------------------------- /setup/IconExtract/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IconsExtract v1.47 5 | Copyright (c) 2003 - 2010 Nir Sofer 6 | Web Site: http://www.nirsoft.net 7 | 8 | 9 | Description 10 | =========== 11 | 12 | The IconsExtract utility scans the files and folders on your computer, 13 | and extract the icons and cursors stored in EXE, DLL, OCX, CPL, and in 14 | other file types. You can save the extracted icons to ICO files (or CUR 15 | files for cursors), or copy the image of a single icon into the clipboard. 16 | 17 | 18 | 19 | System Requirements 20 | =================== 21 | 22 | Windows operating system: Windows 95/98/ME, Windows NT, Windows 2000, 23 | Windows XP, Windows 2003 Server, or Windows Vista. 24 | IconsExtract can only extract icons from 32-bit executable files. It 25 | cannot extract icons from 16-bit files. 26 | 27 | 28 | 29 | Versions History 30 | ================ 31 | 32 | 33 | 34 | 35 | 26/09/2010 36 | 1.47 37 | 38 | * Added -scanpath command-line option, which allows you to start 39 | IconsExtract with another base folder or wildcard. (For exmaple: 40 | iconsext.exe -scanpath "c:\windows") 41 | 42 | 43 | 13/04/2009 44 | 1.46 45 | 46 | * The size of PNG based icons is now displayed properly. (In prevoius 47 | versions, the size was displayed as 0x0). 48 | 49 | 50 | 03/05/2008 51 | 1.45 52 | 53 | * Fixed bug in scan mode selection. 54 | 55 | 56 | 07/03/2008 57 | 1.44 58 | 59 | * Fixed the tab order in all dialog-boxes. 60 | * Fixed the Esc key and 'x' close buttons of search and properties 61 | dialog-boxes. 62 | 63 | 64 | 22/02/2008 65 | 1.43 66 | 67 | * Fixed the filename length limitation in the 'Search For Icons' 68 | dialog-box. 69 | * Added support for typing filenames with environment strings (For 70 | example: %SystemRoot%\System32\shell32.dll) 71 | 72 | 73 | 21/12/2007 74 | 1.42 75 | 76 | * The configuration is now saved into a cfg file, instead of the 77 | Registry 78 | 79 | 80 | 08/04/2006 81 | 1.41 82 | 83 | * Fixed bug with large icons (256X256 or graeter) on properties window. 84 | 85 | 86 | 12/06/2005 87 | 1.40 88 | 89 | * New option: Loaded all icons in the selected process. 90 | * New option: File Properties. 91 | * New column: Total size of the icon. 92 | 93 | 94 | 21/05/2005 95 | 1.32 96 | 97 | * Added support for Windows XP visual styles. 98 | 99 | 100 | 01/12/2004 101 | 1.31 102 | 103 | * Added support for translating to other languages. 104 | * All dialog-boxes are now centered. 105 | 106 | 107 | 04/09/2003 108 | 1.30 109 | Added command-line support. 110 | 111 | 06/06/2003 112 | 1.21 113 | Automatically saves your last settings (windows size, your last search 114 | options, and more) and loads them in the next time that you use this 115 | utility. 116 | 117 | 30/04/2003 118 | 1.20 119 | Added search filter (Icon size and number of colors). 120 | 121 | 16/04/2003 122 | 1.10 123 | 124 | * Added support for cursors. 125 | * Fixed bug: Error message when closing the main window during icons 126 | search. 127 | * Fixed bug: Icons without numeric ID were not shown. 128 | * The images of the icons are shown in properties window 129 | 130 | 131 | 02/04/2003 132 | 1.00 133 | First release. 134 | 135 | 136 | 137 | License 138 | ======= 139 | 140 | This utility is released as freeware. You can freely use and distribute 141 | it. If you distribute this utility, you must include all files in the 142 | distribution package including the readme.txt, without any modification ! 143 | 144 | 145 | 146 | Disclaimer 147 | ========== 148 | 149 | The software is provided "AS IS" without any warranty, either expressed 150 | or implied, including, but not limited to, the implied warranties of 151 | merchantability and fitness for a particular purpose. The author will not 152 | be liable for any special, incidental, consequential or indirect damages 153 | due to loss of data or any other reason. 154 | 155 | 156 | 157 | Using the IconsExtract utility 158 | ============================== 159 | 160 | This utility is a standalone executable, and it doesn't require any 161 | installation process or additional DLLs. Just run the executable 162 | (iconsext.exe) and start using it. 163 | 164 | Immediately after you run this utility, the "Search For Icons" dialog box 165 | will be appeared. In this window, you should select the files or folders 166 | that you want to scan, and the resource types you want to find (icons, 167 | cursors, or both). You can also filter unneeded icons and get only icons 168 | that contains images with specific size and number of colors. 169 | 170 | You have 2 main search options: 171 | 172 | 1. Select only single file. For example: C:\WINNT\System32\shell32.dll 173 | You can manually type the filename in the text-box, or select it from 174 | a dialog box by clicking the "Browse Files" button. 175 | 2. Select multiple filenames by using wildcard characters (? and *). 176 | You can select the folder that you want to scan by clicking the 177 | "Browse Folders" button. If you check the "Search Subfolders" 178 | check-box, all the subfolders of the main folder will be scanned also. 179 | For example: if you type "c:\*.*" in the filename text-box, and check 180 | the "Search Subfolders" option, the IconsExtract utility will search 181 | for icons in all folders and files of your "C:" drive. 182 | 183 | Notice: Searching for icons in an entire drive might take a few minutes, 184 | and consume a fair amount of system resources. However, you can always 185 | stop the search by pressing the "Esc" key or by clicking the "Stop" menu 186 | item in the top-left corner of the window. 187 | 188 | In order to start the icons searching, press the "Search For Icons" 189 | button. IconsExtract will search for icons according to your selection in 190 | the "Search For Icons" window. After the search is finished, the 191 | extracted icons will be appeared in the main window of IconsExtract 192 | utility. 193 | 194 | 195 | 196 | Saving icons into ICO files 197 | =========================== 198 | 199 | In order to save the extracted icons into ICO files: 200 | 201 | 1. Select the icons that you want to save. You can press Ctrl+A in 202 | order to select all extracted icons. 203 | 2. Choose the "Save Selected Icons" in the 'File' menu, or press 204 | Ctrl+S. 205 | 3. In the "Save Selected Icons" window, type the folder for saving the 206 | icons files (You can also select it by using the Browse button) 207 | 4. Press the "Save Icons" button. All the selected icons will be saved 208 | into the folder you have selected. 209 | 210 | 211 | 212 | Copy a signle icon to the clipboard 213 | =================================== 214 | 215 | You can also copy a single image of icon, and paste it to another 216 | application. There are 2 options to do it: 217 | 218 | 1. Copy icon in standard dimensions (16 X 16 or 32 X 32): Select a 219 | single icon in the main window, and press Ctrl+C. 220 | 2. Copy an image of icons in other sizes: double click on a single 221 | icon, and the properties window, select specific image, and press the 222 | "Copy Selected Image" button. 223 | 224 | 225 | 226 | Searching more icons 227 | ==================== 228 | 229 | You can always make another search by using the "Search For Icons" option 230 | in the File menu. You can also extract the icons of specific file simply 231 | by dragging it from explorer window into the main window of IconsExtract 232 | utility. 233 | 234 | 235 | 236 | Command-Line Support 237 | ==================== 238 | 239 | Starting from version 1.30, you can extract icons from files by running 240 | IconsExtract with /save option. 241 | iconsext.exe /save "source file" "save folder" [-icons] [-cursors] 242 | [-asico] 243 | 244 | 245 | source file 246 | The file containing the icons you want to extract 247 | 248 | save folder 249 | The destination folder the save the extracted icons/cursors 250 | 251 | -icons 252 | Specify this option if you want to extract the icons from the file. 253 | 254 | -cursors 255 | Specify this option if you want to extract the cursors from the file. 256 | 257 | -asico 258 | Specify this option if you want to save cursors as .ico files. 259 | 260 | Example: 261 | iconsext.exe /save "c:\winnt\system32\shell32.dll" "c:\icons" -icons 262 | -cursors 263 | 264 | You can also use -scanpath parameter to start IconsExtract user interface 265 | with the specified path or wildcard, for example: 266 | iconsext.exe -scanpath "c:\windows\system32\*.dll" 267 | 268 | 269 | 270 | Translating IconsExtract to other languages 271 | =========================================== 272 | 273 | In order to translate IconsExtract to other language, follow the 274 | instructions below: 275 | 1. Run IconsExtract with /savelangfile parameter: 276 | iconsext.exe /savelangfile 277 | A file named iconsext_lng.ini will be created in the folder of 278 | IconsExtract utility. 279 | 2. Open the created language file in Notepad or in any other text 280 | editor. 281 | 3. Translate all string entries to the desired language. Optionally, 282 | you can also add your name and/or a link to your Web site. 283 | (TranslatorName and TranslatorURL values) If you add this information, 284 | it'll be used in the 'About' window. 285 | 4. After you finish the translation, Run IconsExtract, and all 286 | translated strings will be loaded from the language file. 287 | If you want to run IconsExtract without the translation, simply rename 288 | the language file, or move it to another folder. 289 | 290 | 291 | 292 | Feedback 293 | ======== 294 | 295 | If you have any problem, suggestion, comment, or you found a bug in my 296 | utility, you can send a message to nirsofer@yahoo.com 297 | -------------------------------------------------------------------------------- /setup/Icons/asm.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/asm.ico -------------------------------------------------------------------------------- /setup/Icons/c.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/c.ico -------------------------------------------------------------------------------- /setup/Icons/code.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/code.ico -------------------------------------------------------------------------------- /setup/Icons/cpp.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/cpp.ico -------------------------------------------------------------------------------- /setup/Icons/cs.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/cs.ico -------------------------------------------------------------------------------- /setup/Icons/database.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/database.ico -------------------------------------------------------------------------------- /setup/Icons/git.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/git.ico -------------------------------------------------------------------------------- /setup/Icons/h.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/h.ico -------------------------------------------------------------------------------- /setup/Icons/hpp.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/hpp.ico -------------------------------------------------------------------------------- /setup/Icons/rc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/rc.ico -------------------------------------------------------------------------------- /setup/Icons/vb.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/vb.ico -------------------------------------------------------------------------------- /setup/Icons/xml.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Icons/xml.ico -------------------------------------------------------------------------------- /setup/SetUserFTA/EULA.txt: -------------------------------------------------------------------------------- 1 | END USER LICENSE AGREEMENT (EULA) 2 | 3 | SetUserFTA by Christoph Kolbicz - https://kolbi.cz, 2018 4 | 5 | This End-User License Agreement (EULA) is a legal agreement between you and the mentioned author of this Software for the software product identified above, which includes computer software and may include associated media, printed materials, and "online" or electronic documentation ("Software Product"). 6 | 7 | By installing, copying, or otherwise using the Software Product, you agree to be bounded by the terms of this EULA. If you do not agree to the terms of this EULA, do not install or use the Software Product. 8 | 9 | SOFTWARE PRODUCT LICENSE 10 | 11 | a) SetUserFTA is being distributed as Freeware for personal, commercial use, non-profit organization and educational purpose. It may be included with CD-ROM/DVD-ROM distributions. You are NOT allowed to make a charge for distributing this Software (either for profit or merely to recover your media and distribution costs) whether as a stand-alone product, or as part of a compilation or anthology, nor to use it for supporting your business or customers. It may be distributed freely on any website or through any other distribution mechanism, as long as no part of it is changed in any way and appropriate credits are given. 12 | 13 | 1. Grant of License. This EULA grants you the following rights: 14 | 15 | Installation and Use. 16 | 17 | You may install and use an unlimited number of copies of the Software Product. 18 | 19 | Reproduction and Distribution. 20 | 21 | You may reproduce and distribute an unlimited number of copies of the Software Product; provided that each copy shall be a true, unmodified and complete copy, including all copyright and trademark notices, and shall be accompanied by a copy of this EULA. 22 | 23 | Copies of the Software Product may be distributed as a standalone product or included with your own product as long as The Software Product is not sold or included in a product or package that intends to receive benefits through the inclusion of the Software Product. 24 | 25 | The Software Product may be included in any free or non-profit packages or products. 26 | 27 | 2. Description of Rights and Limitations. 28 | 29 | Software Transfer. 30 | 31 | You may permanently transfer all of your rights under this EULA, provided the recipient agrees to the terms of this EULA. 32 | 33 | Termination. 34 | 35 | Without prejudice to any other rights, the Author of this Software may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the Software Product and all of its component parts. 36 | 37 | 3. Copyright. 38 | 39 | All title and copyrights in and to the Software Product (including but not limited to any images, photographs, clipart, libraries, and examples incorporated into the Software Product), the accompanying printed materials, and any copies of the Software Product are owned by the Author of this Software. The Software Product is protected by copyright laws and international treaty provisions. Therefore, you must treat the Software Product like any other copyrighted material. The licensed users or licensed company can use all functions, example, templates, clipart, libraries and symbols in the Software Product to create new diagrams and distribute the diagrams. 40 | 41 | LIMITED WARRANTY 42 | 43 | No Warranties. 44 | 45 | The Author of this Software expressly disclaims any warranty for the Software Product. The Software Product and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or noninfringement. The entire risk arising out of use or performance of the Software Product remains with you. 46 | 47 | No Liability for Damages. 48 | 49 | In no event shall the author of this Software be liable for any special, consequential, incidental or indirect damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if the Author of this Software is aware of the possibility of such damages and known defects. 50 | -------------------------------------------------------------------------------- /setup/SetUserFTA/SHA256.txt: -------------------------------------------------------------------------------- 1 | SetUserFTA.exe:791dc39f7bd059226364bb05cf5f8e1dd7ccfdaa33a1574f9dc821b2620991c2 2 | -------------------------------------------------------------------------------- /setup/SetUserFTA/SetUserFTA.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/SetUserFTA/SetUserFTA.exe -------------------------------------------------------------------------------- /setup/SetUserFTA/readme.md: -------------------------------------------------------------------------------- 1 | # SetUsetFTA 2 | 3 | -------------------------------------------------------------------------------- /setup/SetUserFTA/version.txt: -------------------------------------------------------------------------------- 1 | this is version 1.7.1 2 | 3 | Release Notes: 4 | ============== 5 | 6 | Version 1.7.1 - update to avoid false positive antivirus detection 7 | Version 1.7 - implemented get and del commands, comments with # in configfile now possible, EULA added 8 | Version 1.6 - allows to change protocols (mailto, etc.) on Windows builds 1607 and lower 9 | Version 1.5 - support for Windows 8.x and Server 2012/R2 10 | Version 1.4 - support for protocols on Windows 1703 and higher 11 | Version 1.3 - new funtionality: multiple file type associations with a configuration file 12 | Version 1.2 - completely rewritten in C, because v1.1.1 still was causing "false positive" detections. 13 | Version 1.1.1 - includes small changes, due antivirus false positive detections. 14 | Version 1.1 - added group checking option. only sets FTA when the user is member of the supplied group. 15 | Version 1.0 - first public version 16 | 17 | HOW TO: 18 | ======= 19 | 20 | run SetUserFTA.exe in the user context with following command line parameters: 21 | 22 | SetUserFTA.exe extension progid optional:groupname 23 | 24 | or 25 | 26 | SetUserFTA.exe configfile 27 | 28 | "SetUserFTA.exe del .txt" will remove the UserChoice key from the .txt handler 29 | "SetUserFTA.exe get" will list all User FTA's (just like GetUserFTA) 30 | 31 | EXAMPLE: 32 | ======== 33 | 34 | SetUserFTA.exe .txt txtfile 35 | 36 | or to use group checking: 37 | 38 | SetUserFTA.exe .txt txtfile "Notepad Users" 39 | 40 | Note: you can supply the group including the domain like "Domain\group" or even in UPN format. 41 | if the group contains a space, you must use quotes (not when using a config file). 42 | 43 | SetUserFTA.exe path_to_config_file 44 | 45 | a config file contains multiple associations - one per line, values separated by comma. 46 | 47 | Example: .vsdx, VisioViewer.Viewer, Visio Users 48 | 49 | the group is optional and must not contain quotes. 50 | 51 | check my blog for more detailed information: http://kolbi.cz/blog/?p=346 -------------------------------------------------------------------------------- /setup/Test/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: LLVM 3 | ... 4 | -------------------------------------------------------------------------------- /setup/Test/.clang-tidy: -------------------------------------------------------------------------------- 1 | --- 2 | Checks: '*' 3 | ... 4 | -------------------------------------------------------------------------------- /setup/Test/.gitattributes: -------------------------------------------------------------------------------- 1 | *.cmd text eol=crlf 2 | makefile text eol=lf 3 | -------------------------------------------------------------------------------- /setup/Test/.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Git 3 | email = git@github.de 4 | -------------------------------------------------------------------------------- /setup/Test/.gitignore: -------------------------------------------------------------------------------- 1 | dummy 2 | -------------------------------------------------------------------------------- /setup/Test/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "script"] 2 | -------------------------------------------------------------------------------- /setup/Test/code/asm.asm: -------------------------------------------------------------------------------- 1 | global _start 2 | 3 | section .text 4 | _start: 5 | xor rdi, rdi ; exit code 0 6 | syscall ; invoke operating system to exit 7 | -------------------------------------------------------------------------------- /setup/Test/code/asm.s: -------------------------------------------------------------------------------- 1 | global _start 2 | 3 | section .text 4 | _start: 5 | xor rdi, rdi ; exit code 0 6 | syscall ; invoke operating system to exit 7 | -------------------------------------------------------------------------------- /setup/Test/code/c.c: -------------------------------------------------------------------------------- 1 | int main() { 2 | return 0; 3 | } 4 | -------------------------------------------------------------------------------- /setup/Test/code/cmake.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | -------------------------------------------------------------------------------- /setup/Test/code/cmake.h.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Test/code/cmake.h.in -------------------------------------------------------------------------------- /setup/Test/code/cpp.c++: -------------------------------------------------------------------------------- 1 | int main() { 2 | return 0; 3 | } 4 | -------------------------------------------------------------------------------- /setup/Test/code/cpp.cc: -------------------------------------------------------------------------------- 1 | int main() { 2 | return 0; 3 | } 4 | -------------------------------------------------------------------------------- /setup/Test/code/cpp.cpp: -------------------------------------------------------------------------------- 1 | int main() { 2 | return 0; 3 | } 4 | -------------------------------------------------------------------------------- /setup/Test/code/cpp.cxx: -------------------------------------------------------------------------------- 1 | int main() { 2 | return 0; 3 | } 4 | -------------------------------------------------------------------------------- /setup/Test/code/cs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | class CSharp { 4 | static void Main() 5 | { 6 | Console.WriteLine("cs"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /setup/Test/code/css.css: -------------------------------------------------------------------------------- 1 | body { width: 100% } 2 | -------------------------------------------------------------------------------- /setup/Test/code/h.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /setup/Test/code/hpp.h++: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /setup/Test/code/hpp.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /setup/Test/code/hpp.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /setup/Test/code/hpp.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | -------------------------------------------------------------------------------- /setup/Test/code/hpp.i++: -------------------------------------------------------------------------------- 1 | #ifndef IPP_IMPL 2 | #define IPP_IMPL 3 | #include 4 | 5 | #endif 6 | -------------------------------------------------------------------------------- /setup/Test/code/hpp.ipp: -------------------------------------------------------------------------------- 1 | #ifndef IPP_IMPL 2 | #define IPP_IMPL 3 | #include 4 | 5 | #endif 6 | -------------------------------------------------------------------------------- /setup/Test/code/hpp.ixx: -------------------------------------------------------------------------------- 1 | #ifndef IPP_IMPL 2 | #define IPP_IMPL 3 | #include 4 | 5 | #endif 6 | -------------------------------------------------------------------------------- /setup/Test/code/java.java: -------------------------------------------------------------------------------- 1 | import java.lang.System; 2 | 3 | public class Java { 4 | public static void main(String[] args) 5 | { 6 | System.out.println("java"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /setup/Test/code/javascript.js: -------------------------------------------------------------------------------- 1 | console.log("js"); 2 | -------------------------------------------------------------------------------- /setup/Test/code/manifest.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | PerMonitorV2 20 | 21 | true 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /setup/Test/code/perl.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | print "perl"; 4 | -------------------------------------------------------------------------------- /setup/Test/code/python.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | print("python") 4 | -------------------------------------------------------------------------------- /setup/Test/code/resource.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | VS_VERSION_INFO VERSIONINFO 4 | PRODUCTVERSION 1, 0 5 | FILEVERSION 1, 0, 0, 0 6 | FILEOS VOS_NT_WINDOWS32 7 | FILETYPE VFT_APP 8 | FILESUBTYPE VFT2_UNKNOWN 9 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0 14 | #endif 15 | BEGIN 16 | BLOCK "StringFileInfo" 17 | BEGIN 18 | BLOCK "000004B0" 19 | BEGIN 20 | VALUE "ProductName", "resource" 21 | VALUE "FileDescription", "Resource" 22 | VALUE "LegalCopyright", "Unknown" 23 | VALUE "ProductVersion", "1.0.0" 24 | END 25 | END 26 | BLOCK "VarFileInfo" 27 | BEGIN 28 | VALUE "Translation", 0x0, 0x04B0 29 | END 30 | END 31 | -------------------------------------------------------------------------------- /setup/Test/code/shell.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "shell" 3 | -------------------------------------------------------------------------------- /setup/Test/code/vb.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | 3 | Module CSharp 4 | Sub Main(args as String()) 5 | System.Console.WriteLine("vb") 6 | End Sub 7 | End Module 8 | -------------------------------------------------------------------------------- /setup/Test/code/xmlfile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | value 4 | 5 | -------------------------------------------------------------------------------- /setup/Test/configuration.cfg: -------------------------------------------------------------------------------- 1 | [section] 2 | name=value 3 | -------------------------------------------------------------------------------- /setup/Test/configuration.conf: -------------------------------------------------------------------------------- 1 | [section] 2 | name=value 3 | -------------------------------------------------------------------------------- /setup/Test/configuration.ini: -------------------------------------------------------------------------------- 1 | [section] 2 | name=value 3 | -------------------------------------------------------------------------------- /setup/Test/data.json: -------------------------------------------------------------------------------- 1 | { "name": "value" } 2 | -------------------------------------------------------------------------------- /setup/Test/database.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/setup/Test/database.db -------------------------------------------------------------------------------- /setup/Test/log.log: -------------------------------------------------------------------------------- 1 | 2020-01-01 [system] test 2 | -------------------------------------------------------------------------------- /setup/Test/log.tlog: -------------------------------------------------------------------------------- 1 | 2020-01-01 [system] test 2 | -------------------------------------------------------------------------------- /setup/Test/markdown.markdown: -------------------------------------------------------------------------------- 1 | # Markdown 2 | Text. 3 | -------------------------------------------------------------------------------- /setup/Test/markdown.md: -------------------------------------------------------------------------------- 1 | # Markdown 2 | Text. 3 | -------------------------------------------------------------------------------- /setup/Test/patch.diff: -------------------------------------------------------------------------------- 1 | diff --git i/setup/filetype.cmd w/setup/filetype.cmd 2 | deleted file mode 100644 3 | index 8db3328..0000000 4 | --- i/setup/filetype.cmd 5 | +++ /dev/null 6 | @@ -1,3 +0,0 @@ 7 | -@echo off 8 | - 9 | -pause 10 | -------------------------------------------------------------------------------- /setup/Test/patch.patch: -------------------------------------------------------------------------------- 1 | diff --git i/setup/filetype.cmd w/setup/filetype.cmd 2 | deleted file mode 100644 3 | index 8db3328..0000000 4 | --- i/setup/filetype.cmd 5 | +++ /dev/null 6 | @@ -1,3 +0,0 @@ 7 | -@echo off 8 | - 9 | -pause 10 | -------------------------------------------------------------------------------- /setup/Test/script.vim: -------------------------------------------------------------------------------- 1 | " Compatibility 2 | scriptencoding utf-8 3 | set nocompatible 4 | -------------------------------------------------------------------------------- /setup/Test/text.txt: -------------------------------------------------------------------------------- 1 | text 2 | -------------------------------------------------------------------------------- /setup/files.ps1: -------------------------------------------------------------------------------- 1 | # Import utility functions. 2 | Import-Module -Name "$PSScriptRoot\utility" 3 | 4 | # Restart script as administrator. 5 | If ((IsAdmin) -eq $False) { 6 | If ($args[0] -eq "-elevated") { 7 | Error "Could not execute script as administrator." 8 | } 9 | Write-Output "Executing script as Administrator..." 10 | Start-Process powershell.exe -Verb RunAs -ArgumentList ('-NoProfile -ExecutionPolicy Bypass -File "{0}" -elevated' -f ($MyInvocation.MyCommand.Definition)) 11 | Exit 12 | } 13 | 14 | # Make the "HKCR:" drive available. 15 | If (!(Test-Path "HKCR:")) { 16 | New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 17 | } 18 | 19 | # Install custom icons. 20 | & cmake -E copy_directory "$PSScriptRoot\Icons" "$env:AppData\Icons" 21 | 22 | # Creates a file association. 23 | function Associate { 24 | $name = $args[0] 25 | $text = $args[1] 26 | $exec = $args[2] 27 | $icon = $args[3] 28 | $type = $args[4] 29 | If ($icon.IndexOf("\") -eq -1) { 30 | $icon = "%AppData%\Icons\" + $icon 31 | } 32 | & cmd /c "ftype ${name}=${exec}" 33 | Set-ItemProperty -Path "HKCR:\${name}" -Name "(Default)" -Type String -Value "${text}" 34 | If (!(Test-Path "HKCR:\${name}\DefaultIcon")) { 35 | New-Item -Path "HKCR:\${name}\DefaultIcon" -Force | Out-Null 36 | } 37 | Set-ItemProperty -Path "HKCR:\${name}\DefaultIcon" -Name "(Default)" -Type String -Value "${icon}" 38 | Remove-Item -Path "HKCR:\${name}_auto_file" -Recurse -ErrorAction SilentlyContinue -Force | Out-Null 39 | $type | ForEach { 40 | & cmd /c "assoc .${_}=${name}" 41 | Set-ItemProperty -Path "HKCR:\.${_}" -Name "(Default)" -Type String -Value "${name}" 42 | Remove-Item -Path "HKCR:\.${_}_auto_file" -Recurse -ErrorAction SilentlyContinue -Force | Out-Null 43 | } 44 | } 45 | 46 | # Icons 47 | $text = "%SystemRoot%\System32\imageres.dll,97" 48 | $audio = "%ProgramFiles%\MPV\mpv.exe,0" 49 | $video = "%ProgramFiles%\MPV\mpv.exe,0" 50 | 51 | # Applications 52 | $7zipfm = '"%ProgramFiles%\7-Zip\7zFM.exe" "%1"' 53 | $editor = '"%ProgramFiles%\Vim\bin\nvim-qt.exe" "%1"' 54 | $sqlite = '"%ProgramFiles%\SQLite Browser\SQLite Browser.exe" "%1"' 55 | $player = '"%ProgramFiles%\MPV\mpv.exe" "%1"' 56 | 57 | # Archives 58 | Associate "7zip" "Archive" $7zipfm "%ProgramFiles%\7-Zip\7zFM.exe,0" ( 59 | "7z", "arj", "bz2", "cab", "deb", "gz", "lz", 60 | "lzh", "rar", "rpm", "tar", "wim", "xz", "z", "zip" 61 | ) 62 | 63 | # Editor 64 | Associate "android" "Android" $editor $text ("gradle", "iml", "lock", "metadata", "properties") 65 | Associate "config" "Configuration" $editor $text ("cfg", "cnf", "clang-format", "clang-tidy", "conf", "editorconfig", "ini") 66 | Associate "git" "Git" $editor "git.ico" ("gitattributes", "gitconfig", "gitignore", "gitmodules", "npmrc") 67 | Associate "json" "JSON" $editor $text ("json", "json5", "jsonc") 68 | Associate "log" "Log" $editor $text ("log", "tlog") 69 | Associate "markdown" "Markdown" $editor $text ("markdown", "md") 70 | Associate "patch" "Patch" $editor $text ("diff", "patch") 71 | Associate "text" "Text" $editor $text ("txt") 72 | Associate "vimscript" "Vim Script" $editor $text ("vim") 73 | Associate "yaml" "YAML" $editor $text ("yaml", "yml") 74 | Associate "proto" "Protocol Buffers" $editor $text ("proto") 75 | Associate "fbs" "FlatBuffers" $editor $text ("fbs") 76 | Associate "jam" "JAM" $editor $text ("jam") 77 | Associate "xmlfile" "XML" $editor "xml.ico" ("xml", "xaml") 78 | Associate "sourcemap" "Source Map" $editor $text ("map") 79 | 80 | # Database 81 | If (Test-Path "C:\Program Files\SQLite Browser\SQLite Browser.exe" -PathType leaf) { 82 | Associate "database" "Database" $sqlite "database.ico" ("db") 83 | } 84 | 85 | # Code 86 | Associate "asm" "Assembler" $editor "asm.ico" ("asm", "s") 87 | Associate "c" "C Source" $editor "c.ico" ("c") 88 | Associate "cmake" "CMake" $editor "code.ico" ("cmake", "in") 89 | Associate "cpp" "C++ Source" $editor "cpp.ico" ("c++", "cc", "cpp", "cxx") 90 | Associate "cs" "C Sharp" $editor "cs.ico" ("cs") 91 | Associate "css" "CSS" $editor "code.ico" ("css") 92 | Associate "def" "Exports" $editor "code.ico" ("def") 93 | Associate "h" "C Header" $editor "h.ico" ("h") 94 | Associate "hpp" "C++ Header" $editor "hpp.ico" ("h++", "hh", "hpp", "hxx", "i++", "ipp", "ixx") 95 | Associate "java" "Java" $editor "code.ico" ("java") 96 | Associate "javascript" "JavaScript" $editor "code.ico" ("js") 97 | Associate "kotlin" "Kotlin" $editor "code.ico" ("kt") 98 | Associate "lua" "Lua" $editor "code.ico" ("lua") 99 | Associate "manifest" "Manifest" $editor "xml.ico" ("manifest") 100 | Associate "makefile" "Makefile" $editor "code.ico" ("mk") 101 | Associate "perl" "Perl" $editor "code.ico" ("perl", "pl", "pm") 102 | Associate "python" "Python" $editor "code.ico" ("py") 103 | Associate "resource" "Resource" $editor "rc.ico" ("rc") 104 | Associate "shell" "Shell" $editor "code.ico" ("sh") 105 | Associate "sql" "SQL Script" $editor "code.ico" ("sql") 106 | Associate "typescript" "TypeScript" $editor "code.ico" ("ts") 107 | Associate "vb" "Visual Basic" $editor "vb.ico" ("vb") 108 | 109 | # Audio 110 | Associate "audio" "Audio" $player $audio ("mp3", "aac", "flac", "mka", "wav") 111 | 112 | # Video 113 | Associate "video" "Video" $player $video ("mp4", "avi", "flv", "mkv", "mov", "webm", "wmv") 114 | 115 | & ie4uinit.exe -ClearIconCache 116 | -------------------------------------------------------------------------------- /setup/system.ps1: -------------------------------------------------------------------------------- 1 | # Import utility functions. 2 | Import-Module -Name "$PSScriptRoot\utility" 3 | 4 | # Restart script as administrator. 5 | if ((IsAdmin) -eq $False) { 6 | if ($args[0] -eq "-elevated") { 7 | Error "Could not execute script as administrator." 8 | } 9 | Write-Output "Executing script as Administrator..." 10 | Start-Process powershell.exe -Verb RunAs -ArgumentList ('-NoProfile -ExecutionPolicy Bypass -File "{0}" -elevated' -f ($MyInvocation.MyCommand.Definition)) 11 | Exit 12 | } 13 | 14 | # Initialize helper objects. 15 | $Kernel32 = Add-Type -MemberDefinition @' 16 | [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] 17 | public static extern bool SetComputerName(String name); 18 | 19 | [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] 20 | public static extern bool GetComputerName(System.Text.StringBuilder buffer, ref uint size); 21 | '@ -Name 'Kernel32' -Namespace 'Win32' -PassThru 22 | 23 | # Schedule reboot. 24 | $rebootRequired = $False 25 | 26 | # Set computer information. 27 | $hostname = $env:ComputerName 28 | $hostname = Read-Host -Prompt "Set host name [$hostname]" 29 | if ($hostname -ne "") { 30 | Write-Output "Setting host name..." 31 | Rename-Computer -NewName "tmp-$hostname" -Force 32 | Rename-Computer -NewName "$hostname" -Force 33 | $rebootRequired = $True 34 | } 35 | 36 | function Get-NetbiosName { 37 | $data = New-Object System.Text.StringBuilder 64 38 | $size = $data.Capacity 39 | if (!$Kernel32::GetComputerName($data, [ref] $size)) { 40 | Error "Could not get bios name." 41 | } 42 | return $data.ToString(); 43 | } 44 | 45 | $biosname = Get-NetbiosName 46 | $biosname = Read-Host -Prompt "Set bios name [$biosname]" 47 | if ($biosname -ne "") { 48 | Write-Output "Setting bios name..." 49 | $Kernel32::SetComputerName("$biosname"); 50 | $rebootRequired = $True 51 | } 52 | 53 | $username = $env:UserName 54 | $username = Read-Host -Prompt "Set user name [$username]" 55 | if ($username -ne "") { 56 | Write-Output "Setting user name..." 57 | Rename-LocalUser -Name "$env:UserName" -NewName "$username" 58 | $rebootRequired = $True 59 | } else { 60 | $username = $env:UserName 61 | } 62 | 63 | $fullname = ([adsi]"WinNT://$env:UserDomain/$username,user").fullname 64 | $fullname = Read-Host -Prompt "Set full name [$fullname]" 65 | if ($fullname -ne "") { 66 | Write-Output "Setting full name..." 67 | Set-LocalUser -Name "$username" -FullName "$fullname" 68 | $rebootRequired = $True 69 | } 70 | 71 | # Disable virtual memory. 72 | $ComputerSystem = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges 73 | $PhysicalMemory = [math]::Ceiling($ComputerSystem.TotalPhysicalMemory / 1024 / 1024 / 1024) 74 | if ($PhysicalMemory -ge 16) { 75 | if ($ComputerSystem.AutomaticManagedPagefile) { 76 | Write-Output "Switching to manual Pagefile management..." 77 | $ComputerSystem.AutomaticManagedPagefile = $False 78 | $ComputerSystem.Put() 79 | $rebootRequired = $True 80 | } 81 | 82 | $PageFileSetting = Get-WmiObject -Query "SELECT * FROM Win32_PageFileSetting WHERE Name LIKE '%pagefile.sys'" 83 | if ($PageFileSetting) { 84 | Write-Output "Setting Pagefile sizes..." 85 | $PageFileSetting.InitialSize = 0 86 | $PageFileSetting.MaximumSize = 0 87 | $PageFileSetting.Put() 88 | $rebootRequired = $True 89 | } 90 | 91 | $PageFile = Get-WmiObject -Query "SELECT * FROM Win32_PageFile WHERE Name LIKE '%pagefile.sys'" 92 | if ($PageFile) { 93 | Write-Output "Deleting Pagefile..." 94 | $PageFile.Delete() 95 | wmic pagefileset delete 96 | $rebootRequired = $True 97 | } 98 | } 99 | 100 | # Set system volume label. 101 | function Get-VolumeLabel { 102 | $LogicalDisk = Get-WmiObject -Class Win32_LogicalDisk -Filter "DeviceID='$($args[0]):'" 103 | return $LogicalDisk.VolumeName 104 | } 105 | 106 | if ((Get-VolumeLabel "C") -ne "System") { 107 | Write-Output "Setting System volume label..." 108 | Set-Volume -DriveLetter "C" -NewFileSystemLabel "System" 109 | $rebootRequired = $True 110 | } 111 | 112 | # Perform reboot. 113 | if ($rebootRequired -eq $True) { 114 | Reboot 115 | } 116 | 117 | # Import system functions. 118 | Import-Module -Name "$PSScriptRoot\system" 119 | 120 | # =========================================================================================================== 121 | # Privacy Tweaks 122 | # =========================================================================================================== 123 | 124 | DisableTelemetry 125 | DisableCortana 126 | DisableWiFiSense 127 | DisableSmartScreen 128 | DisableWebSearch 129 | DisableAppSuggestions 130 | DisableActivityHistory 131 | #DisableSensors 132 | #DisableLocation 133 | DisableMapUpdates 134 | DisableFeedback 135 | DisableTailoredExperiences 136 | DisableAdvertisingID 137 | #DisableWebLangList 138 | #DisableBiometrics 139 | #DisableCamera 140 | #DisableMicrophone 141 | DisableErrorReporting 142 | SetP2PUpdateLocal 143 | DisableDiagTrack 144 | DisableWAPPush 145 | EnableClearRecentFiles 146 | DisableRecentFiles 147 | 148 | # =========================================================================================================== 149 | # UWP Privacy Tweaks 150 | # =========================================================================================================== 151 | 152 | #DisableUWPBackgroundApps 153 | DisableUWPVoiceActivation 154 | #DisableUWPNotifications 155 | #DisableUWPAccountInfo 156 | #DisableUWPContacts 157 | #DisableUWPCalendar 158 | DisableUWPPhoneCalls 159 | DisableUWPCallHistory 160 | #DisableUWPEmail 161 | #DisableUWPTasks 162 | DisableUWPMessaging 163 | DisableUWPRadios 164 | DisableUWPOtherDevices 165 | DisableUWPDiagInfo 166 | #DisableUWPFileSystem 167 | DisableUWPSwapFile 168 | 169 | # =========================================================================================================== 170 | # Security Tweaks 171 | # =========================================================================================================== 172 | 173 | #SetUACHigh 174 | DisableSharingMappedDrives 175 | DisableAdminShares 176 | #EnableFirewall 177 | 178 | EnableScriptHost 179 | HideDefenderTrayIcon 180 | DisableCIMemoryIntegrity 181 | DisableCtrldFolderAccess 182 | DisableDefenderAppGuard 183 | DisableDownloadBlocking 184 | DisableMeltdownCompatFlag 185 | HideAccountProtectionWarn 186 | DisableDefenderCloud 187 | DisableDefender 188 | 189 | DisableBootRecovery 190 | #EnableRecoveryAndReset 191 | SetDEPOptOut 192 | 193 | # =========================================================================================================== 194 | # Network Tweaks 195 | # =========================================================================================================== 196 | 197 | SetCurrentNetworkPrivate 198 | SetUnknownNetworksPrivate 199 | DisableNetDevicesAutoInst 200 | DisableHomeGroups 201 | DisableSMB1 202 | #EnableSMBServer 203 | DisableNetBIOS 204 | DisableLLMNR 205 | DisableLLDP 206 | DisableLLTD 207 | DisableMSNetClient 208 | #EnableQoS 209 | #DisableIPv4 210 | #DisableIPv6 211 | #DisableNCSIProbe 212 | DisableConnectionSharing 213 | DisableRemoteAssistance 214 | #DisableRemoteDesktop 215 | 216 | Write-Output "Disabling scheduled tasks..." 217 | Get-ScheduledTask -ErrorAction SilentlyContinue "XblGameSaveTaskLogon" | Disable-ScheduledTask 218 | Get-ScheduledTask -ErrorAction SilentlyContinue "XblGameSaveTask" | Disable-ScheduledTask 219 | Get-ScheduledTask -ErrorAction SilentlyContinue "Consolidator" | Disable-ScheduledTask 220 | Get-ScheduledTask -ErrorAction SilentlyContinue "UsbCeip" | Disable-ScheduledTask 221 | Get-ScheduledTask -ErrorAction SilentlyContinue "DmClient" | Disable-ScheduledTask 222 | Get-ScheduledTask -ErrorAction SilentlyContinue "DmClientOnScenarioDownload" | Disable-ScheduledTask 223 | 224 | # =========================================================================================================== 225 | # Service Tweaks 226 | # =========================================================================================================== 227 | 228 | DisableUpdateMSRT 229 | #DisableUpdateDriver 230 | EnableUpdateMSProducts 231 | DisableUpdateRestart 232 | EnableAutoRestartSignOn 233 | DisableSharedExperiences 234 | DisableClipboardHistory 235 | DisableAutoplay 236 | DisableAutorun 237 | DisableStorageSense 238 | DisableDefragmentation 239 | DisableSuperfetch 240 | #DisableIndexing 241 | #DisableRecycleBin 242 | EnableNTFSLongPaths 243 | DisableNTFSLastAccess 244 | SetBIOSTimeUTC 245 | DisableHibernation 246 | DisableSleepButton 247 | #DisableFastStartup 248 | DisableAutoRebootOnCrash 249 | 250 | DisableRestorePoints 251 | vssadmin Delete Shadows /For=$env:SYSTEMDRIVE /Quiet 252 | 253 | Write-Output "Setting display and sleep mode timeouts..." 254 | powercfg /X monitor-timeout-ac 30 255 | powercfg /X monitor-timeout-dc 10 256 | powercfg /X standby-timeout-ac 0 257 | powercfg /X standby-timeout-dc 360 258 | 259 | # gpedit.msc > Local Computer Policy > Computer Configuration > Administrative Templates 260 | # > Windows Components > Windows Update > Configure Automatic Updates: Enabled 261 | Write-Output "Configuring Windows Update..." 262 | if (!(Test-Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU")) { 263 | New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null 264 | } 265 | Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 0 266 | 267 | # Configure automatic updating: 2 - Notify for download and auto install 268 | Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 2 269 | 270 | # [ ] Install during automatic maintenance 271 | Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AutomaticMaintenanceEnabled" -Type DWord -Value 0 272 | 273 | # Scheduled install day: 6 - Every Friday 274 | Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "ScheduledInstallDay" -Type DWord -Value 6 275 | 276 | # Scheduled install time: 22:00 277 | Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "ScheduledInstallTime" -Type DWord -Value 22 278 | 279 | # [x] Install updates for other Microsoft products 280 | Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AllowMUUpdateService" -Type DWord -Value 1 281 | 282 | # Do not wake up to install updates. 283 | Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0 284 | Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" -Name "WakeUp" -Type DWord -Value 0 285 | 286 | # =========================================================================================================== 287 | # UI Tweaks 288 | # =========================================================================================================== 289 | 290 | DisableActionCenter 291 | HideNetworkFromLockScreen 292 | #HideShutdownFromLockScreen 293 | DisableAeroShake 294 | DisableAccessibilityKeys 295 | ShowTaskManagerDetails 296 | ShowFileOperationsDetails 297 | DisableFileDeleteConfirm 298 | HideTaskbarSearch 299 | #HideTaskView 300 | ShowSmallTaskbarIcons 301 | SetTaskbarCombineAlways 302 | HideTaskbarPeopleIcon 303 | ShowTrayIcons 304 | #ShowSecondsInTaskbar 305 | DisableSearchAppInStore 306 | DisableNewAppPrompt 307 | HideRecentlyAddedApps 308 | #SetWinXMenuCmd 309 | DisableShortcutInName 310 | SetAppsDarkMode 311 | SetSystemDarkMode 312 | #EnableNumlock 313 | SetSoundSchemeNone 314 | DisableStartupSound 315 | #DisableChangingSoundScheme 316 | #EnableVerboseStatus 317 | DisableF1HelpKey 318 | 319 | Write-Output "Setting mouse pointer options..." 320 | Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSpeed" -Type String -Value "0" 321 | Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseThreshold1" -Type String -Value "0" 322 | Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseThreshold2" -Type String -Value "0" 323 | Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSensitivity" -Type String -Value "4" 324 | 325 | Write-Output "Setting custom visual effects..." 326 | Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "DragFullWindows" -Type String -Value 1 327 | Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type String -Value 400 328 | Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](150,62,7,128,18,0,0,0)) 329 | Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Type String -Value 1 330 | Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name "KeyboardDelay" -Type DWord -Value 1 331 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 1 332 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 1 333 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 1 334 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3 335 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 1 336 | 337 | # Enable transparency. 338 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "EnableTransparency" -Type DWord -Value 1 339 | 340 | # Enable dark title bars. 341 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "ColorPrevalence" -Type DWord -Value 1 342 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "AccentColor" -Type DWord -Value 0x282828 343 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "AccentColorInactive" -Type DWord -Value 0x282828 344 | 345 | # =========================================================================================================== 346 | # Explorer UI Tweaks 347 | # =========================================================================================================== 348 | 349 | #ShowExplorerTitleFullPath 350 | ShowKnownExtensions 351 | ShowHiddenFiles 352 | #ShowSuperHiddenFiles 353 | ShowEmptyDrives 354 | HideFolderMergeConflicts 355 | #EnableNavPaneExpand 356 | HideNavPaneAllFolders 357 | HideNavPaneLibraries 358 | #EnableFldrSeparateProcess 359 | #EnableRestoreFldrWindows 360 | #HideEncCompFilesColor 361 | DisableSharingWizard 362 | HideSelectCheckboxes 363 | #HideSyncNotifications 364 | HideRecentShortcuts 365 | SetExplorerThisPC 366 | #HideQuickAccess 367 | HideRecycleBinFromDesktop 368 | #ShowThisPCOnDesktop 369 | #ShowUserFolderOnDesktop 370 | #ShowControlPanelOnDesktop 371 | #ShowNetworkOnDesktop 372 | #HideDesktopIcons 373 | #HideBuildNumberFromDesktop 374 | HideDesktopFromThisPC 375 | HideDesktopFromExplorer 376 | HideDocumentsFromThisPC 377 | HideDocumentsFromExplorer 378 | HideDownloadsFromThisPC 379 | HideDownloadsFromExplorer 380 | HideMusicFromThisPC 381 | HideMusicFromExplorer 382 | HidePicturesFromThisPC 383 | HidePicturesFromExplorer 384 | HideVideosFromThisPC 385 | HideVideosFromExplorer 386 | Hide3DObjectsFromThisPC 387 | Hide3DObjectsFromExplorer 388 | HideNetworkFromExplorer 389 | HideIncludeInLibraryMenu 390 | HideGiveAccessToMenu 391 | HideShareMenu 392 | #DisableThumbnails 393 | #DisableThumbnailCache 394 | DisableThumbsDBOnNetwork 395 | 396 | # =========================================================================================================== 397 | # Application Tweaks 398 | # =========================================================================================================== 399 | 400 | DisableOneDrive 401 | UninstallOneDrive 402 | 403 | Write-Output "Uninstalling default Microsoft applications..." 404 | Get-AppxPackage "Microsoft.3DBuilder" | Remove-AppxPackage 405 | Get-AppxPackage "Microsoft.AppConnector" | Remove-AppxPackage 406 | Get-AppxPackage "Microsoft.BingFinance" | Remove-AppxPackage 407 | Get-AppxPackage "Microsoft.BingFoodAndDrink" | Remove-AppxPackage 408 | Get-AppxPackage "Microsoft.BingHealthAndFitness" | Remove-AppxPackage 409 | Get-AppxPackage "Microsoft.BingMaps" | Remove-AppxPackage 410 | Get-AppxPackage "Microsoft.BingNews" | Remove-AppxPackage 411 | Get-AppxPackage "Microsoft.BingSports" | Remove-AppxPackage 412 | Get-AppxPackage "Microsoft.BingTranslator" | Remove-AppxPackage 413 | Get-AppxPackage "Microsoft.BingTravel" | Remove-AppxPackage 414 | Get-AppxPackage "Microsoft.CommsPhone" | Remove-AppxPackage 415 | Get-AppxPackage "Microsoft.ConnectivityStore" | Remove-AppxPackage 416 | Get-AppxPackage "Microsoft.FreshPaint" | Remove-AppxPackage 417 | Get-AppxPackage "Microsoft.GetHelp" | Remove-AppxPackage 418 | Get-AppxPackage "Microsoft.Getstarted" | Remove-AppxPackage 419 | Get-AppxPackage "Microsoft.HelpAndTips" | Remove-AppxPackage 420 | Get-AppxPackage "Microsoft.Media.PlayReadyClient.2" | Remove-AppxPackage 421 | Get-AppxPackage "Microsoft.Messaging" | Remove-AppxPackage 422 | Get-AppxPackage "Microsoft.Microsoft3DViewer" | Remove-AppxPackage 423 | Get-AppxPackage "Microsoft.MicrosoftOfficeHub" | Remove-AppxPackage 424 | Get-AppxPackage "Microsoft.MicrosoftPowerBIForWindows" | Remove-AppxPackage 425 | Get-AppxPackage "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxPackage 426 | Get-AppxPackage "Microsoft.MicrosoftStickyNotes" | Remove-AppxPackage 427 | Get-AppxPackage "Microsoft.MinecraftUWP" | Remove-AppxPackage 428 | Get-AppxPackage "Microsoft.MixedReality.Portal" | Remove-AppxPackage 429 | Get-AppxPackage "Microsoft.MoCamera" | Remove-AppxPackage 430 | Get-AppxPackage "Microsoft.MSPaint" | Remove-AppxPackage 431 | Get-AppxPackage "Microsoft.NetworkSpeedTest" | Remove-AppxPackage 432 | Get-AppxPackage "Microsoft.OfficeLens" | Remove-AppxPackage 433 | Get-AppxPackage "Microsoft.Office.OneNote" | Remove-AppxPackage 434 | Get-AppxPackage "Microsoft.Office.Sway" | Remove-AppxPackage 435 | Get-AppxPackage "Microsoft.OneConnect" | Remove-AppxPackage 436 | Get-AppxPackage "Microsoft.People" | Remove-AppxPackage 437 | Get-AppxPackage "Microsoft.Print3D" | Remove-AppxPackage 438 | Get-AppxPackage "Microsoft.Reader" | Remove-AppxPackage 439 | Get-AppxPackage "Microsoft.RemoteDesktop" | Remove-AppxPackage 440 | Get-AppxPackage "Microsoft.SkypeApp" | Remove-AppxPackage 441 | Get-AppxPackage "Microsoft.Todos" | Remove-AppxPackage 442 | Get-AppxPackage "Microsoft.Wallet" | Remove-AppxPackage 443 | Get-AppxPackage "Microsoft.WebMediaExtensions" | Remove-AppxPackage 444 | Get-AppxPackage "Microsoft.Whiteboard" | Remove-AppxPackage 445 | Get-AppxPackage "Microsoft.WindowsAlarms" | Remove-AppxPackage 446 | Get-AppxPackage "Microsoft.WindowsCamera" | Remove-AppxPackage 447 | Get-AppxPackage "Microsoft.WindowsFeedbackHub" | Remove-AppxPackage 448 | Get-AppxPackage "Microsoft.WindowsMaps" | Remove-AppxPackage 449 | Get-AppxPackage "Microsoft.WindowsPhone" | Remove-AppxPackage 450 | Get-AppxPackage "Microsoft.WindowsReadingList" | Remove-AppxPackage 451 | Get-AppxPackage "Microsoft.WindowsScan" | Remove-AppxPackage 452 | Get-AppxPackage "Microsoft.WindowsSoundRecorder" | Remove-AppxPackage 453 | Get-AppxPackage "Microsoft.WinJS.1.0" | Remove-AppxPackage 454 | Get-AppxPackage "Microsoft.WinJS.2.0" | Remove-AppxPackage 455 | Get-AppxPackage "Microsoft.YourPhone" | Remove-AppxPackage 456 | Get-AppxPackage "Microsoft.ZuneMusic" | Remove-AppxPackage 457 | Get-AppxPackage "Microsoft.ZuneVideo" | Remove-AppxPackage 458 | 459 | Get-AppxPackage "Microsoft.Windows.Photos" | Remove-AppxPackage # Photos 460 | Get-AppxPackage "microsoft.windowscommunicationsapps" | Remove-AppxPackage # Mail and Calendar 461 | Get-AppxPackage "Microsoft.BingWeather" | Remove-AppxPackage # Weather 462 | Get-AppxPackage "Microsoft.Advertising.Xaml" | Remove-AppxPackage # Dependency for Mail and Calendar, Weather 463 | 464 | # List remaining apps. 465 | # Get-AppxPackage | Select Name,PackageFullName | Sort Name 466 | # 467 | # Uninstall unwanted apps. 468 | # Get-AppxPackage "Microsoft.3DBuilder" | Remove-AppxPackage 469 | 470 | UninstallThirdPartyBloat 471 | #UninstallWindowsStore 472 | DisableXboxFeatures 473 | #DisableFullscreenOptims 474 | DisableAdobeFlash 475 | DisableEdgePreload 476 | DisableEdgeShortcutCreation 477 | DisableIEFirstRun 478 | DisableFirstLogonAnimation 479 | DisableMediaSharing 480 | DisableMediaOnlineAccess 481 | EnableDeveloperMode 482 | UninstallMediaPlayer 483 | InstallInternetExplorer 484 | UninstallWorkFolders 485 | UninstallHelloFace 486 | UninstallMathRecognizer 487 | UninstallPowerShellV2 488 | UninstallPowerShellISE 489 | InstallHyperV 490 | InstallSSHClient 491 | InstallTelnetClient 492 | 493 | #if ((Get-NetConnectionProfile).IPv4Connectivity -contains "Internet") { 494 | # InstallNET23 495 | #} 496 | 497 | RemovePhotoViewerOpenWith 498 | #UninstallPDFPrinter 499 | UninstallXPSPrinter 500 | RemoveFaxPrinter 501 | UninstallFaxAndScan 502 | 503 | # =========================================================================================================== 504 | # Custom Tweaks 505 | # =========================================================================================================== 506 | 507 | # Make the "HKCR:" registry drive available. 508 | if (!(Test-Path "HKCR:")) { 509 | New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 510 | } 511 | 512 | Write-Output 'Removing "Edit with Paint 3D" from Explorer context menu.' 513 | # reg query "HKLM\Software\Classes\SystemFileAssociations" /f "3D Edit" /s /k /e 514 | ("3mf", "bmp", "fbx", "gif", "glb", "jfif", "jpe", "jpeg", "jpg", "obj", "ply", "png", "stl", "tif", "tiff") | ForEach { 515 | Remove-Item -Path "HKLM:\Software\Classes\SystemFileAssociations\.$_\Shell\3D Edit" -Recurse -ErrorAction SilentlyContinue -Force | Out-Null 516 | } 517 | 518 | Write-Output 'Removeing "Set as desktop background" from Explorer context menu.' 519 | # reg query "HKLM\Software\Classes\SystemFileAssociations" /f "setdesktopwallpaper" /s /k /e 520 | ("bmp", "dib", "gif", "jfif", "jpe", "jpeg", "jpg", "png", "tif", "tiff", "wdp") | ForEach { 521 | Remove-Item -Path "HKLM:\Software\Classes\SystemFileAssociations\.$_\Shell\setdesktopwallpaper" -Recurse -ErrorAction SilentlyContinue -Force | Out-Null 522 | } 523 | 524 | Write-Output 'Removing "AMD Radeon Software" from Explorer context menu...' 525 | if (!(Test-Path "HKCR:\Directory\Background\shellex\ContextMenuHandlers\ACE")) { 526 | New-Item -Path "HKCR:\Directory\Background\shellex\ContextMenuHandlers\ACE" -Force | Out-Null 527 | } 528 | Set-ItemProperty -Path "HKCR:\Directory\Background\shellex\ContextMenuHandlers\ACE" -Name "(Default)" -Type String -Value "--" 529 | 530 | Write-Output "Uninstalling Microsoft Internet Printing..." 531 | Disable-WindowsOptionalFeature -Online -FeatureName "Printing-Foundation-InternetPrinting-Client" -NoRestart -WarningAction SilentlyContinue | Out-Null 532 | 533 | # =========================================================================================================== 534 | # Destructive Tweaks 535 | # =========================================================================================================== 536 | 537 | $doUnpinStartMenuTiles = Read-Host -Prompt "Unpin all Start Menu tiles [no]" 538 | if ($doUnpinStartMenuTiles -like "yes") { 539 | UnpinStartMenuTiles 540 | $rebootRequired = $True 541 | } 542 | 543 | $doUnpinTaskbarIcons = Read-Host -Prompt "Unpin all Taskbar icons [no]" 544 | if ($doUnpinTaskbarIcons -like "yes") { 545 | UnpinTaskbarIcons 546 | $rebootRequired = $True 547 | } 548 | 549 | $doDisableLockScreen = Read-Host -Prompt "Disable Lock screen [no]" 550 | if ($doDisableLockScreen -like "yes") { 551 | DisableLockScreenBlur 552 | DisableLockScreen 553 | $rebootRequired = $True 554 | } 555 | 556 | if ($rebootRequired -eq $True) { 557 | Reboot 558 | } 559 | 560 | Write-Output 'Configuration complete!' 561 | Wait-Event 562 | Exit 563 | -------------------------------------------------------------------------------- /setup/utility.psm1: -------------------------------------------------------------------------------- 1 | function Confirm { 2 | If ($Host.Name -eq "ConsoleHost") { 3 | Write-Output $args 4 | $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") | Out-Null 5 | } 6 | } 7 | 8 | function Reboot { 9 | Confirm "Press any key to reboot the system..." 10 | Restart-Computer -Force 11 | Exit 12 | } 13 | 14 | function Error { 15 | Write-Output "Error: $args" 16 | Confirm "Press any key to exit..." 17 | Exit 18 | } 19 | 20 | function IsAdmin { 21 | $identity = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent()) 22 | return $identity.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) 23 | } 24 | -------------------------------------------------------------------------------- /vlan/000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/vlan/000.png -------------------------------------------------------------------------------- /vlan/001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/vlan/001.png -------------------------------------------------------------------------------- /vlan/002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qis/windows/1254febd5e4da8aeea10180f1ba7e095274d88f6/vlan/002.png -------------------------------------------------------------------------------- /vlan/readme.md: -------------------------------------------------------------------------------- 1 | # VLAN 2 | Configure VLANs on Windows 10. 3 | 4 | ## Hyper-V Manager 5 | Create a virtual switch using the Hyper-V Manager (`virtmgmt.msc`). 6 | 7 | ![Virtual Switch Manager...](000.png) 8 | ![New virtual network switch](001.png) 9 | ![Virtual Switch Properties](002.png) 10 | 11 | # PowerShell 12 | Manage virtual adapters as Administrator in `powershell.exe`. 13 | 14 | 1. Create virtual adapters on the virtual switch. 15 | 16 | ```ps 17 | Add-VMNetworkAdapter -ManagementOS -SwitchName "VLAN" -Name "VLAN 10" 18 | Add-VMNetworkAdapter -ManagementOS -SwitchName "VLAN" -Name "VLAN 400" 19 | ``` 20 | 21 | 2. Assign VLAN IDs to virtual adapters. 22 | 23 | ```ps 24 | Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "VLAN 10" -Access -VlanId 10 25 | Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "VLAN 400" -Access -VlanId 400 26 | ``` 27 | 28 | 3. Remove virtual adapters when no longer needed. 29 | 30 | ```ps 31 | Remove-VMNetworkAdapter -ManagementOS -SwitchName "VLAN" -Name "VLAN 10" 32 | Remove-VMNetworkAdapter -ManagementOS -SwitchName "VLAN" -Name "VLAN 400" 33 | ``` 34 | -------------------------------------------------------------------------------- /wsl/alpine.md: -------------------------------------------------------------------------------- 1 | # Alpine 2 | Enable WSL support as **administrator**. 3 | 4 | ```cmd 5 | dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 6 | dism /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart 7 | ``` 8 | 9 | Reboot Windows. 10 | 11 | ```cmd 12 | shutdown /r /t 0 13 | ``` 14 | 15 | Install [WSL 2 Linux Kernel](https://aka.ms/wsl2kernel), then configure WSL. 16 | 17 | ```cmd 18 | wsl --set-default-version 2 19 | ``` 20 | 21 | Install, launch and configure [Alpine WSL](https://aka.ms/wslstore), then `exit` shell. 22 | 23 | ```cmd 24 | wsl --list 25 | wsl --setdefault Alpine 26 | wsl --set-version Alpine 2 27 | wsl --distribution Alpine --user root 28 | ``` 29 | 30 | Switch to rolling release. 31 | 32 | ```sh 33 | sed -E 's/v\d+\.\d+/edge/g' -i /etc/apk/repositories 34 | ``` 35 | 36 | Update system. 37 | 38 | ```sh 39 | apk update 40 | apk upgrade --purge 41 | ``` 42 | 43 | Install packages. 44 | 45 | ```sh 46 | apk add coreutils curl file git grep htop p7zip pv pwgen sshpass sudo tmux tree tzdata wipe 47 | apk add neovim openssh-client imagemagick pngcrush 48 | ``` 49 | 50 | Install `nvim` as default `vim`. 51 | 52 | ```sh 53 | sudo ln -s nvim /usr/bin/vim 54 | ``` 55 | 56 | Configure system. 57 | 58 | ```sh 59 | curl -L https://raw.githubusercontent.com/qis/windows/master/wsl/tmux.conf -o /etc/tmux.conf 60 | curl -L https://raw.githubusercontent.com/qis/windows/master/wsl/ash.sh -o /etc/profile.d/ash.sh 61 | curl -L https://raw.githubusercontent.com/qis/windows/master/wsl/wsl.sh -o /etc/profile.d/wsl.sh 62 | chmod 0755 /etc/profile.d/ash.sh /etc/profile.d/wsl.sh 63 | ``` 64 | 65 | Configure [sudo(8)](http://manpages.ubuntu.com/manpages/xenial/man8/sudo.8.html). 66 | 67 | ```sh 68 | EDITOR=tee visudo >/dev/null <<'EOF' 69 | # Locale settings. 70 | Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET" 71 | 72 | # Profile settings. 73 | Defaults env_keep += "MM_CHARSET EDITOR PAGER LS_COLORS TMUX SESSION USERPROFILE" 74 | 75 | # User privilege specification. 76 | root ALL=(ALL) ALL 77 | %wheel ALL=(ALL) NOPASSWD: ALL 78 | 79 | # See sudoers(5) for more information on "#include" directives: 80 | #includedir /etc/sudoers.d 81 | EOF 82 | ``` 83 | 84 | Create `/etc/wsl.conf`. 85 | 86 | ```sh 87 | tee /etc/wsl.conf >/dev/null <<'EOF' 88 | [automount] 89 | enabled=true 90 | options=case=off,metadata,uid=1000,gid=1000,umask=022 91 | EOF 92 | ``` 93 | 94 | Disable message of the day. 95 | 96 | ```sh 97 | sed -E 's/^(session.*pam_motd\.so.*)/#\1/' -i /etc/pam.d/* 98 | ``` 99 | 100 | Exit shell to release `/root/.ash_history`. 101 | 102 | ```sh 103 | exit 104 | ``` 105 | 106 | Restart distribution to apply `/etc/wsl.conf` settings. 107 | 108 | ```cmd 109 | wsl --terminate Alpine 110 | wsl --distribution Alpine 111 | ``` 112 | 113 | Configure `nvim`. 114 | 115 | ```sh 116 | sudo rm -rf /etc/vim /etc/xdg/nvim; sudo mkdir -p /etc/xdg 117 | sudo ln -s "${USERPROFILE}/vimfiles" /etc/vim 118 | sudo ln -s /etc/vim /etc/xdg/nvim 119 | sudo touch /root/.viminfo 120 | touch ~/.viminfo 121 | ``` 122 | 123 | Clean home directory files. 124 | 125 | ```sh 126 | sudo rm -f /root/.ash_history 127 | rm -f ~/.ash_history 128 | ``` 129 | 130 | Create **user** home directory symlinks. 131 | 132 | ```sh 133 | ln -s "${USERPROFILE}/.gitconfig" ~/.gitconfig 134 | ln -s "${USERPROFILE}/Documents" ~/documents 135 | ln -s "${USERPROFILE}/Downloads" ~/downloads 136 | ln -s /mnt/c/Workspace ~/workspace 137 | mkdir -p ~/.ssh; chmod 0700 ~/.ssh 138 | for i in authorized_keys config id_rsa id_rsa.pub known_hosts; do 139 | ln -s "${USERPROFILE}/.ssh/$i" ~/.ssh/$i 140 | done 141 | sudo chown `id -un`:`id -gn` "${USERPROFILE}/.ssh"/* ~/.ssh/* 142 | sudo chmod 0600 "${USERPROFILE}/.ssh"/* ~/.ssh/* 143 | ``` 144 | 145 | ## Development 146 | Install basic development packages. 147 | 148 | ```sh 149 | sudo apk add binutils binutils-dev fortify-headers gcc g++ linux-headers libc-dev 150 | sudo apk add cmake make nasm ninja nodejs npm patch perl pkgconf python3 py3-pip sqlite swig z3 151 | sudo apk add libedit-dev libnftnl-dev libmnl-dev libxml2-dev 152 | sudo apk add curl-dev ncurses-dev openssl-dev xz-dev z3-dev 153 | ``` 154 | -------------------------------------------------------------------------------- /wsl/ash.sh: -------------------------------------------------------------------------------- 1 | # Files 2 | umask 0022 3 | 4 | # Limits 5 | ulimit -S -c 0 6 | 7 | # Unicode 8 | export NCURSES_NO_UTF8_ACS="1" 9 | export MM_CHARSET="UTF-8" 10 | 11 | # Localization 12 | export LANG="C.UTF-8" 13 | export LC_MESSAGES="C.UTF-8" 14 | export LC_COLLATE="C.UTF-8" 15 | export LC_CTYPE="C.UTF-8" 16 | export LC_ALL= 17 | 18 | # Applications 19 | export EDITOR="vim" 20 | export PAGER="less" 21 | 22 | # Colors 23 | export LS_COLORS="di=1;34:ln=1;36:so=1;35:pi=33:ex=1;32:bd=1;33:cd=1;33:su=1;31:sg=1;30;41:tw=1;31:ow=1;35" 24 | 25 | # Aliases 26 | alias ..="cd .." 27 | 28 | alias ls="ls --color=auto --group-directories-first" 29 | alias ll="ls -lh --time-style long-iso" 30 | alias lsa="ls -A" 31 | alias lla="ll -A" 32 | 33 | alias tm="tmux -2" 34 | alias ta="tm attach -t" 35 | alias ts="tm new-session -s" 36 | alias tl="tm list-sessions" 37 | 38 | alias crush="pngcrush -brute -reduce -rem allb -ow" 39 | alias grep="grep --color=auto" 40 | alias sudo="sudo " 41 | 42 | # Settings 43 | export HISTFILE="${HOME}/.history" 44 | 45 | PS1= 46 | if [ -n "${TMUX}" ]; then 47 | id="$(echo $TMUX | awk -F, '{print $3 + 1}')" 48 | session="$(tmux ls | head -${id} | tail -1 | cut -d: -f1)" 49 | PS1="${PS1}\[\e[90m\][\[\e[0m\]${session}\[\e[90m\]]\[\e[0m\] " 50 | fi 51 | if [ $(id -u) -ne 0 ]; then 52 | PS1="${PS1}\[\e[32m\]\u\[\e[0m\]" 53 | else 54 | PS1="${PS1}\[\e[31m\]\u\[\e[0m\]" 55 | fi 56 | if [ -x "/bin/wslpath" ] && [ -f /etc/alpine-release ]; then 57 | PS1="${PS1}@\[\e[32m\]alpine\[\e[0m\]" 58 | else 59 | PS1="${PS1}@\[\e[32m\]\h\[\e[0m\]" 60 | fi 61 | PS1="${PS1} \[\e[34m\]\w\[\e[0m\] " 62 | export PS1 63 | -------------------------------------------------------------------------------- /wsl/bash.sh: -------------------------------------------------------------------------------- 1 | # Files 2 | umask 0022 3 | 4 | # Limits 5 | ulimit -S -c 0 6 | 7 | # Unicode 8 | export NCURSES_NO_UTF8_ACS="1" 9 | export MM_CHARSET="UTF-8" 10 | 11 | # Localization 12 | export LC_COLLATE=C.UTF-8 13 | export LC_MESSAGES=C.UTF-8 14 | export LC_NUMERIC=C.UTF-8 15 | 16 | # Applications 17 | export EDITOR="vim" 18 | export PAGER="less" 19 | 20 | # Colors 21 | export LS_COLORS="di=1;34:ln=1;36:so=1;35:pi=33:ex=1;32:bd=1;33:cd=1;33:su=1;31:sg=1;30;41:tw=1;31:ow=1;35" 22 | 23 | # Aliases 24 | alias ..="cd .." 25 | 26 | alias ls="ls -v --color=auto --group-directories-first" 27 | alias ll="ls -lh --time-style long-iso" 28 | alias lsa="ls -A" 29 | alias lla="ll -A" 30 | 31 | alias tm="tmux -2" 32 | alias ta="tm attach -t" 33 | alias ts="tm new-session -s" 34 | alias tl="tm list-sessions" 35 | 36 | alias mime="file --mime-type -b" 37 | alias diff="diff --color=auto" 38 | alias grep="grep --color=auto" 39 | alias sudo="sudo " 40 | 41 | # Settings 42 | export HISTFILE="${HOME}/.history" 43 | export HISTCONTROL="ignoreboth:erasedups" 44 | shopt -s histappend 45 | 46 | tp() { 47 | if [ -n "${TMUX}" ]; then 48 | id="$(echo $TMUX | awk -F, '{print $3 + 1}')" 49 | session="$(tmux ls | head -${id} | tail -1 | cut -d: -f1)" 50 | echo -e "\e[90m[\e[0m${session}\e[90m]\e[0m " 51 | fi 52 | } 53 | 54 | if [ $(id -u) -ne 0 ]; then 55 | export PS1='$(tp)\[\e[32m\]\u\[\e[0m\]@\[\e[32m\]\h\[\e[0m\] \[\e[34m\]\w\[\e[0m\] ' 56 | else 57 | export PS1='$(tp)\[\e[31m\]\u\[\e[0m\]@\[\e[32m\]\h\[\e[0m\] \[\e[34m\]\w\[\e[0m\] ' 58 | fi 59 | 60 | if [[ $- == *i* ]]; then 61 | set -o emacs 62 | stty werase '^_' 63 | bind '"\C-H":backward-kill-word' 64 | fi 65 | -------------------------------------------------------------------------------- /wsl/gentoo.md: -------------------------------------------------------------------------------- 1 | # Gentoo 2 | Enable WSL support as **administrator**. 3 | 4 | ```cmd 5 | dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 6 | dism /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart 7 | ``` 8 | 9 | Install [WSL 2 Linux Kernel](https://aka.ms/wsl2kernel), then configure WSL. 10 | 11 | ```cmd 12 | wsl --set-default-version 2 13 | ``` 14 | 15 | 16 | -------------------------------------------------------------------------------- /wsl/tmux.conf: -------------------------------------------------------------------------------- 1 | set-window-option -g alternate-screen on 2 | set-option -g default-terminal "screen-256color" 3 | set-option -g terminal-overrides "xnerm*:smcup@:rmcup@" 4 | set-option -g base-index 1 5 | set-option -g status off 6 | -------------------------------------------------------------------------------- /wsl/ubuntu.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 2 | Enable WSL support as **administrator**. 3 | 4 | ```cmd 5 | dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 6 | dism /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart 7 | ``` 8 | 9 | Reboot Windows. 10 | 11 | ```cmd 12 | shutdown /r /t 0 13 | ``` 14 | 15 | Install [WSL 2 Linux Kernel](https://aka.ms/wsl2kernel), then configure WSL. 16 | 17 | ```cmd 18 | wsl --set-default-version 2 19 | ``` 20 | 21 | Install and launch [Ubuntu](https://aka.ms/wslstore). 22 | 23 | ```sh 24 | sudo visudo -c 25 | 26 | sudo EDITOR=tee visudo >/dev/null <<'EOF' 27 | # Locale settings. 28 | Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET" 29 | 30 | # Profile settings. 31 | Defaults env_keep += "MM_CHARSET EDITOR PAGER LS_COLORS TMUX SESSION USERPROFILE" 32 | 33 | # User privilege specification. 34 | root ALL=(ALL) ALL 35 | %sudo ALL=(ALL) NOPASSWD: ALL 36 | 37 | # See sudoers(5) for more information on "#include" directives: 38 | #includedir /etc/sudoers.d 39 | EOF 40 | 41 | exit 42 | ``` 43 | 44 | Set Ubuntu as the default WSL distribution and start it. 45 | 46 | ```sh 47 | wsl -s Ubuntu 48 | wsl -d Ubuntu 49 | ``` 50 | 51 | Update system. 52 | 53 | ```sh 54 | sudo apt update 55 | sudo apt upgrade -y 56 | sudo apt autoremove --purge -y 57 | sudo apt clean 58 | ``` 59 | 60 | Remove snapd. 61 | 62 | ```sh 63 | sudo apt purge snapd -y 64 | sudo apt autoremove --purge -y 65 | sudo rm -rf /root/snap /snap 66 | sudo apt clean 67 | ``` 68 | 69 | Install packages. 70 | 71 | ```sh 72 | sudo apt install -y ccze jq net-tools p7zip pv pwgen tree wipe zip 73 | sudo apt install -y -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 pngcrush imagemagick 74 | ``` 75 | 76 | Configure system. 77 | 78 | ```sh 79 | sudo curl -L https://raw.githubusercontent.com/qis/windows/master/wsl/tmux.conf -o /etc/tmux.conf 80 | sudo curl -L https://raw.githubusercontent.com/qis/windows/master/wsl/bash.sh -o /etc/profile.d/bash.sh 81 | sudo curl -L https://raw.githubusercontent.com/qis/windows/master/wsl/wsl.sh -o /etc/profile.d/wsl.sh 82 | sudo chmod 0755 /etc/profile.d/bash.sh /etc/profile.d/wsl.sh 83 | ``` 84 | 85 | Configure WSL. 86 | 87 | ```sh 88 | sudo tee /etc/wsl.conf >/dev/null <<'EOF' 89 | [automount] 90 | enabled=true 91 | options=case=off,metadata,uid=1000,gid=1000,umask=022 92 | EOF 93 | ``` 94 | 95 | Disable message of the day. 96 | 97 | ```sh 98 | sudo sed -E 's/^(session.*pam_motd\.so.*)/#\1/' -i /etc/pam.d/* 99 | ``` 100 | 101 | Replace shell config files. 102 | 103 | ```sh 104 | sudo rm -f /{root,home/*}/.{bashrc,profile,viminfo} 105 | ln -s /etc/profile.d/bash.sh ~/.bashrc 106 | ``` 107 | 108 | Exit shell to release `~/.bash_history`. 109 | 110 | ```sh 111 | exit 112 | ``` 113 | 114 | Restart distribution to apply `/etc/wsl.conf` settings. 115 | 116 | ```cmd 117 | wsl -t Ubuntu 118 | wsl -d Ubuntu 119 | ``` 120 | 121 | Configure `vim`. 122 | 123 | ```sh 124 | sudo rm -rf /etc/vim 125 | sudo git clone https://github.com/qis/vim /etc/vim 126 | sudo touch /root/.viminfo 127 | touch ~/.viminfo 128 | ``` 129 | 130 | Clean home directory files. 131 | 132 | ```sh 133 | sudo rm -f /root/.bash_history /root/.bash_logout 134 | rm -f ~/.bash_history ~/.bash_logout 135 | sudo touch /root/.hushlogin 136 | touch ~/.hushlogin 137 | ``` 138 | 139 | Create **user** home directory symlinks in WSL. 140 | 141 | ```sh 142 | mkdir -p ~/.ssh; chmod 0700 ~/.ssh 143 | for i in authorized_keys config id_rsa id_rsa.pub known_hosts; do 144 | ln -s "${USERPROFILE}/.ssh/$i" ~/.ssh/$i 145 | done 146 | sudo chown `id -un`:`id -gn` "${USERPROFILE}/.ssh"/* ~/.ssh/* 147 | sudo chmod 0600 "${USERPROFILE}/.ssh"/* ~/.ssh/* 148 | ln -s "${USERPROFILE}/.gitconfig" ~/.gitconfig 149 | ``` 150 | 151 | ## SSH Server 152 | Reinstall SSH server. 153 | 154 | ```sh 155 | sudo apt remove openssh-server 156 | sudo apt install openssh-server 157 | sudo service ssh start 158 | ``` 159 | 160 | Automatically start SSH server. 161 | 162 | ``` 163 | Task Scheduler > Create Task... 164 | + General 165 | Name: WSL SSH Server 166 | Description: Start SSH server in WSL 167 | Security options: ◉ Run whether user is logged on or not 168 | ☑ Hidden | Configure for: Windows 10 169 | + Triggers > New... 170 | Begin the task: At startup 171 | + Actions > New... 172 | Program/script: C:\Windows\System32\wsl.exe 173 | Add arguments (optional): sudo service ssh start 174 | ``` 175 | -------------------------------------------------------------------------------- /wsl/wsl.sh: -------------------------------------------------------------------------------- 1 | if [ -x "/bin/wslpath" ] && [ -f "/mnt/c/Windows/System32/cmd.exe" ]; then 2 | export CMD="/mnt/c/Windows/System32/cmd.exe" 3 | USERPROFILE="$(/bin/wslpath -a $(${CMD} /C 'echo %UserProfile%' 2>/dev/null | sed 's/\r//g') 2>/dev/null)" \ 4 | && export USERPROFILE 5 | fi 6 | 7 | alias crush="pngcrush -brute -reduce -rem allb -ow" 8 | 9 | md() { 10 | if [ -z "$(which generate-md)" ]; then 11 | echo "error: missing generate-md application" 12 | echo "" 13 | echo "installation instructions:" 14 | echo "" 15 | echo " sudo npm install -g markdown-styles" 16 | echo "" 17 | exit 1 18 | fi 19 | if [ -z "${1}" ]; then 20 | echo "error: missing input file" 21 | exit 1 22 | fi 23 | if [ -z "${2}" ]; then 24 | echo "error: missing output file" 25 | exit 1 26 | fi 27 | generate-md --layout jasonm23-swiss --input "${1}" --output "${2}" 28 | } 29 | --------------------------------------------------------------------------------