├── .gitattributes ├── .editorconfig ├── gitconfig.md ├── .gitignore ├── misc ├── wsl.md ├── macOS.md └── misc.md ├── README.md ├── scripts ├── wsl-yt-dlp.md ├── wsl.md ├── macos.md └── herodamage.md ├── setup ├── hyper-v-gpu-pv.md ├── vscode.md ├── macos.md ├── wsl.md └── macos-defaults.md └── LICENSE /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_size = 2 6 | indent_style = space 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | -------------------------------------------------------------------------------- /gitconfig.md: -------------------------------------------------------------------------------- 1 | # .gitconfig 2 | 3 | ```txt 4 | [core] 5 | excludesfile = /Users/quentin/.gitignore_global 6 | autocrlf = input 7 | ignorecase = false 8 | symlinks = true 9 | ``` 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE # 2 | ####### 3 | .idea/* 4 | .vscode/* 5 | 6 | # OS generated files # 7 | ###################### 8 | .DS_Store 9 | .DS_Store? 10 | ._* 11 | .Spotlight-V100 12 | .Trashes 13 | ehthumbs.db 14 | Thumbs.db 15 | -------------------------------------------------------------------------------- /misc/wsl.md: -------------------------------------------------------------------------------- 1 | # Misc: WSL 2 | 3 | ## List the distributions 4 | 5 | ```powershell 6 | wsl --list 7 | ``` 8 | 9 | ## Set the default distribution 10 | 11 | ```powershell 12 | wsl --setdefault Ubuntu-20.04 13 | ``` 14 | 15 | ## Uninstall a distribution 16 | 17 | ```powershell 18 | wsl --unregister Ubuntu-20.04 19 | ``` 20 | 21 | ## Terminate a distribution 22 | 23 | ```powershell 24 | wslconfig /t Ubuntu-20.04 25 | ``` 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # notes 2 | 3 | My notes about a bunch of stuff 4 | 5 | ## Environment Setup 6 | 7 | Hyper-V GPU-PV: [Install](./setup/hyper-v-gpu-pv.md)\ 8 | macOS: [Defaults](./setup/macos-defaults.md) -> [Install](./setup/macos.md)\ 9 | WSL: [Install](./setup/wsl.md) 10 | 11 | VSCode: [Extensions]() -> [Settings]() 12 | 13 | ## Scripts 14 | 15 | - [HeroDamage](./scripts/herodamage.md) 16 | - [macOS](./scripts/macos.md) 17 | - [WSL yt-dlp](./scripts/wsl-yt-dlp.md) 18 | - [WSL](./scripts/wsl.md) 19 | 20 | ## Misc 21 | 22 | - [macOS](./misc/macos.md) 23 | - [misc](./misc/misc.md) 24 | - [WSL](./misc/wsl.md) 25 | -------------------------------------------------------------------------------- /misc/macOS.md: -------------------------------------------------------------------------------- 1 | # Misc: macOS 2 | 3 | ## SimC 4 | 5 | ### Build 6 | 7 | ```bash 8 | # Clean & Pull 9 | git clean -xdf 10 | git pull 11 | 12 | # CLI only 13 | make -C engine -j $(expr $(sysctl -n hw.ncpu) / 2) LTO=1 optimized 14 | 15 | # CLI + GUI 16 | qmake simulationcraft.pro 17 | make -j $(expr $(sysctl -n hw.ncpu) / 2) LTO=1 18 | ``` 19 | 20 | ### Debug 21 | 22 | ```bash 23 | make -C engine -j $(expr $(sysctl -n hw.ncpu) / 2) debug 24 | lldb ./engine/simc XXX.simc 25 | run 26 | ``` 27 | 28 | ## Force enable TRIM 29 | 30 | ```bash 31 | sudo trimforce enable 32 | ``` 33 | 34 | ## Get ulimit current values 35 | 36 | ```bash 37 | ulimit -a 38 | ``` 39 | 40 | ## Get ulimit max values 41 | 42 | ```bash 43 | ulimit -a -H 44 | ``` 45 | 46 | ## Increase open files 47 | 48 | ```bash 49 | ulimit -n 2048 50 | ``` 51 | 52 | ## Keyboard reset 53 | 54 | Sometimes macOS keyboard is confused and there is no other choice than deleting `/Library/Preferences/com.apple.keyboardtype.plist` file.\ 55 | See: 56 | 57 | ## Concat multiple video files (using ffmpeg) 58 | 59 | `videos.txt` 60 | ```bash 61 | file '/path/to/video1.ext' 62 | file '/path/to/video2.ext' 63 | file '/path/to/video3.ext' 64 | ``` 65 | 66 | ```bash 67 | ffmpeg -f concat -safe 0 -i videos.txt -c copy video.ext 68 | ``` 69 | 70 | ## Splitting a zip into multiple parts 71 | 72 | ```bash 73 | zip -s 10g 100g-split.zip 100g.zip 74 | ``` 75 | 76 | ## Unzip multiple archive parts 77 | 78 | The easiest way is to cat all of them into a single zip, like this: 79 | 80 | ```bash 81 | cat /path/to/archive-parts/my-archive.zip.001 /path/to/archive-parts/my-archive.zip.002 /path/to/archive-parts/my-archive.zip.003 > my-archive.zip 82 | ``` 83 | 84 | If the multi-part was correctly done (i.e. a master .zip), double-clicking on the master .zip should do the trick though. 85 | 86 | ## Delete a part of a zip (mostly used to remove the annoying __MACOSX folder) 87 | 88 | ```bash 89 | zip -d Archive.zip __MACOSX/\* 90 | ``` 91 | -------------------------------------------------------------------------------- /scripts/wsl-yt-dlp.md: -------------------------------------------------------------------------------- 1 | # Scripts: WSL Ubuntu Upgrade 2 | 3 | ## Introduction 4 | 5 | These are my personal WSL Ubuntu yt-dlp notes. Feel free to pick-up whatever you might need.\ 6 | Before starting, remember that those commands are related to my setup, see `wsl` for more info. 7 | 8 | ## Script 9 | 10 | ```bash 11 | # Update packages 12 | sudo apt update 13 | 14 | # ffmpeg 15 | sudo apt install -y ffmpeg exiftool 16 | 17 | # Python package: mutagen 18 | pip install mutagen 19 | 20 | # Python package: pycryptodomex 21 | pip install pycryptodomex 22 | 23 | # Python package: websockets 24 | pip install websockets 25 | 26 | # Python package: secretstorage 27 | pip install jeepney cryptography SecretStorage 28 | 29 | # RTMPDump 30 | sudo apt install -y rtmpdump 31 | 32 | # mplayer 33 | sudo apt install -y mplayer 34 | 35 | # yt-dlp 36 | sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp 37 | sudo chmod a+rx /usr/local/bin/yt-dlp 38 | 39 | # Folder output 40 | mkdir ~/yt-dlp 41 | cd ~/yt-dlp 42 | 43 | ``` 44 | 45 | ## Commands 46 | 47 | ### Update 48 | 49 | ```bash 50 | sudo apt update 51 | sudo apt upgrade -y 52 | pip install mutagen pycryptodomex websockets jeepney cryptography SecretStorage 53 | yt-dlp -U 54 | 55 | ``` 56 | 57 | ### List formats 58 | 59 | ```bash 60 | yt-dlp --cookies youtube.com_cookies.txt --print formats_table [LINK] 61 | ``` 62 | 63 | ### Get Video (w/ Audio) 64 | 65 | ```bash 66 | yt-dlp --cookies youtube.com_cookies.txt --format "bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[height<=1080][ext=mp4]/best[height<=1080]" --merge-output-format mp4 --audio-quality 0 --embed-thumbnail --embed-metadata [LINK] 67 | ``` 68 | 69 | ### Get Audio only 70 | 71 | ```bash 72 | yt-dlp --cookies youtube.com_cookies.txt --format "bestaudio[ext=m4a]/bestaudio" [LINK] 73 | ``` 74 | 75 | ### Get Video (w/ Audio) + Audio 76 | 77 | ```bash 78 | yt-dlp --cookies youtube.com_cookies.txt --format "bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[height<=1080][ext=mp4]/best[height<=1080],bestaudio[ext=m4a]/bestaudio" --merge-output-format mp4 --audio-quality 0 --embed-thumbnail --embed-metadata [LINK] 79 | ``` 80 | -------------------------------------------------------------------------------- /scripts/wsl.md: -------------------------------------------------------------------------------- 1 | # Scripts: WSL Ubuntu Upgrade 2 | 3 | ## Introduction 4 | 5 | These are my personal WSL Ubutu dev-upgrades notes. Feel free to pick-up whatever you might need.\ 6 | Before starting, remember that those commands are related to my setup, see `wsl` for more info. 7 | 8 | ## Script 9 | 10 | ```bash 11 | cat << 'EOF' > ~/upgrade.sh 12 | #!/bin/bash 13 | 14 | nodenv update 15 | yes n | nodenv install $(nodenv-stable-latest) 16 | nodenv global $(nodenv-stable-latest) 17 | yes | nodenv uninstall $(nodenv-stable-previous) 18 | nodenv rehash 19 | npm update -g 20 | nodenv rehash 21 | 22 | curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash > /dev/null 23 | yes n | rbenv install $(rbenv-stable-latest) 24 | rbenv global $(rbenv-stable-latest) 25 | yes | rbenv uninstall $(rbenv-stable-previous) 26 | rbenv rehash 27 | gem update --system 28 | rbenv rehash 29 | gem install bundler 30 | 31 | pyenv update 32 | yes n | pyenv install $(pyenv-stable-latest) 33 | pyenv global $(pyenv-stable-latest) 34 | yes | pyenv uninstall $(pyenv-stable-previous) 35 | pyenv rehash 36 | pip install --upgrade pip 37 | pyenv rehash 38 | pip install bitarray pefile requests fixedint # simc/casc_extract & simc/dbc_extract 39 | pip install SLPP-23 # hero-dbc 40 | pip install setuptools # hero-rotation-generator 41 | pip install pylint # linter used by IDEs 42 | 43 | sdk flush broadcast 44 | sdk flush archives 45 | sdk flush temp 46 | yes | sdk selfupdate 47 | yes | sdk update 48 | yes | sdk upgrade java 49 | yes | sdk upgrade gradle 50 | 51 | rustup update 52 | 53 | printf '\n' 54 | echo '------ nodenv ------' 55 | printf "nodenv versions:\n" && nodenv versions && printf "\nnodenv --version: $(nodenv --version)\n" && printf "node --version: $(node --version)\n" && printf "npm --version: $(npm --version)\n" && printf "yarn --version: $(yarn --version)\n" 56 | printf '\n' 57 | echo '------ rbenv ------' 58 | printf "rbenv versions:\n" && rbenv versions && printf "\nrbenv --version: $(rbenv --version)\n" && printf "ruby --version: $(ruby --version)\n" && printf "gem --version: $(gem --version)\n" 59 | printf '\n' 60 | echo '------ pyenv ------' 61 | printf "pyenv versions:\n" && pyenv versions && printf "\npyenv --version: $(pyenv --version)\n" && printf "python --version: $(python --version)\n" && printf "pip --version: $(pip --version)\n" 62 | printf '\n' 63 | echo '------ sdkman ------' 64 | printf "sdk version: $(sdk version 2>&1 | sed '2q;d')\n" && printf "\njava --version:\n" && java --version && printf "\ngradle --version: $(gradle --version 2>&1 | sed '3q;d')\n" 65 | printf '\n' 66 | echo '------ dotnet ------' 67 | printf "dotnet --version: $(dotnet --version)\n" 68 | printf '\n' 69 | echo '------ rustup ------' 70 | printf "rustup --version: $(rustup --version 2>&1 | head -n 1)\n" && printf "rustc --version: $(rustc --version)\n" 71 | EOF 72 | chmod +x ~/upgrade.sh 73 | ``` 74 | 75 | ## Commands 76 | 77 | ### Update 78 | 79 | ```bash 80 | sudo apt update 81 | sudo apt upgrade -y 82 | . ~/upgrade.sh 83 | ``` 84 | 85 | ### Uninstall nodenv version 86 | 87 | ```bash 88 | yes | nodenv uninstall XXX 89 | ``` 90 | 91 | ### Uninstall rubyenv version 92 | 93 | ```bash 94 | yes | rbenv uninstall XXX 95 | ``` 96 | 97 | ### Uninstall pyenv version 98 | 99 | ```bash 100 | yes | pyenv uninstall XXX 101 | ``` 102 | -------------------------------------------------------------------------------- /scripts/macos.md: -------------------------------------------------------------------------------- 1 | # Scripts: macOS Upgrade 2 | 3 | ## Introduction 4 | 5 | These are my personal macOS dev-upgrades notes. Feel free to pick-up whatever you might need.\ 6 | Before starting, remember that those commands are related to my setup, see `macos` for more info. 7 | 8 | ## Script 9 | 10 | ```bash 11 | cat << 'EOF' > ~/aio-upgrade.sh 12 | #!/bin/bash 13 | 14 | shopt -s expand_aliases 15 | source ~/.profile 16 | 17 | brew update && brew upgrade && brew cask upgrade && brew cleanup 18 | 19 | nvm install node --reinstall-packages-from=${NVM_VERSION_CURRENT_NODE} 20 | nvm use node && npm i npm -g && npm update -g 21 | nvm install lts/* --reinstall-packages-from=${NVM_VERSION_CURRENT_LTS} 22 | nvm use lts/* && npm i npm -g && npm update -g && nvm alias default lts/* 23 | export NVM_VERSION_CURRENT_NODE=$(nvm version node) 24 | export NVM_VERSION_CURRENT_LTS=$(nvm version lts/*) 25 | 26 | rvm get master && rvm reload && rvm reinstall default && yes | rvm upgrade default && rvm use default && gem update 27 | 28 | yes n | env PYTHON_CONFIGURE_OPTS="--enable-framework CC=clang" pyenv install $(pyenv-stable-latest) 29 | pyenv global $(pyenv-stable-latest) 30 | yes | pyenv uninstall $(pyenv-stable-previous) 31 | pyenv rehash 32 | pip install --upgrade pip 33 | pyenv rehash 34 | 35 | pip install --upgrade bitarray pefile requests fixedint # simc/casc_extract & simc/dbc_extract 36 | pip install --upgrade SLPP-23 # hero-dbc 37 | pip install --upgrade setuptools # hero-rotation-generator 38 | pip install --upgrade pylint # linter used by IDEs 39 | 40 | echo -e '\n' 41 | echo '------ Homebrew ------' && brew --version && echo '' 42 | echo '------ NVM ------' && nvm list && echo "nvm: $(nvm --version)" && echo "node: $(node --version)" && echo "npm: $(npm --version)" && echo '' 43 | echo '------ RVM ------' && rvm list && rvm --version && ruby --version && bundler --version && echo '' 44 | echo '------ PyEnv ------' && pyenv versions && pyenv --version && python --version && pip --version && echo '' 45 | EOF 46 | chmod +x ~/aio-upgrade.sh 47 | ``` 48 | 49 | ## Commands 50 | 51 | ### Update 52 | 53 | ```bash 54 | ~/aio-upgrade.sh 55 | ``` 56 | 57 | ### Upgrade brew & casks 58 | 59 | ```bash 60 | brew update && brew upgrade && brew cask upgrade && brew cleanup 61 | brew --version 62 | ``` 63 | 64 | ### Upgrade Node & Node LTS w/ npm 65 | 66 | ```bash 67 | nvm install node --reinstall-packages-from=${NVM_VERSION_CURRENT_NODE} 68 | nvm use node && npm i npm -g && npm update -g 69 | nvm install lts/* --reinstall-packages-from=${NVM_VERSION_CURRENT_LTS} 70 | nvm use lts/* && npm i npm -g && npm update -g && nvm alias default lts/* 71 | export NVM_VERSION_CURRENT_NODE=$(nvm version node) 72 | export NVM_VERSION_CURRENT_LTS=$(nvm version lts/*) 73 | nvm list && echo "nvm: $(nvm --version)" && echo "node: $(node --version)" && echo "npm: $(npm --version)" 74 | ``` 75 | 76 | ### Upgrade RVM & Ruby & Gems 77 | 78 | Note: We reinstall ruby because brew can break it during his update, otherwise it's not needed to reinstall. 79 | 80 | ```bash 81 | rvm get master && rvm reload && rvm reinstall default && yes | rvm upgrade default && rvm use default && gem update 82 | rvm list && rvm --version && ruby --version && bundler --version 83 | ``` 84 | 85 | ### Upgrade a Gemfile 86 | 87 | ```bash 88 | bundle update 89 | ``` 90 | 91 | ### Upgrade Python 92 | 93 | ```bash 94 | yes n | env PYTHON_CONFIGURE_OPTS="--enable-framework CC=clang" pyenv install $(pyenv-stable-latest) 95 | pyenv global $(pyenv-stable-latest) 96 | yes | pyenv uninstall $(pyenv-stable-previous) 97 | pyenv rehash 98 | pip install --upgrade pip 99 | pyenv rehash 100 | pyenv versions && pyenv --version && python --version && pip --version 101 | 102 | pip install --upgrade bitarray pefile requests # simc/casc_extract & simc/dbc_extract 103 | pip install --upgrade SLPP-23 # hero-dbc 104 | pip install --upgrade setuptools # hero-rotation-generator 105 | pip install --upgrade pylint # linter used by IDEs 106 | ``` 107 | -------------------------------------------------------------------------------- /setup/hyper-v-gpu-pv.md: -------------------------------------------------------------------------------- 1 | # Setup: Microsoft Hyper-V GPU ParaVirtualization (Partitioning) 2 | 3 | ## Introduction 4 | 5 | These are my personal Hyper-V GPU-PV through GPU Partitioning notes. Feel free to pick-up whatever you might need.\ 6 | This only works for Enterprise, Pro, or Education editions of Windows 10 and 11. 7 | 8 | ## Enable virtualization in the motherboard 9 | 10 | Refer to your motherboard manual. 11 | 12 | ## Enable Hyper-V 13 | 14 | 1) Open a PowerShell console as Administrator 15 | 2) Run the following command: 16 | 17 | ```powershell 18 | Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All 19 | ``` 20 | 21 | 3) Reboot 22 | 23 | Cf. https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v 24 | 25 | ## Download Windows using Rufus 26 | 27 | Rufus download: https://rufus.ie/en/\ 28 | Change `SELECT` to `DOWNLOAD` using arrow then click on `DOWNLOAD` to choose the right ISO.\ 29 | Close Rufus. 30 | 31 | ## Allow PowerShell scripts execution 32 | 33 | 1) Open a PowerShell console as Administrator 34 | 2) Run the following command: 35 | 36 | ```powershell 37 | Set-ExecutionPolicy unrestricted 38 | ``` 39 | 40 | ## Hyper-V Network Switch 41 | 42 | You might want to use Bridged network instead of NAT.\ 43 | To do so, open `Hyper-V Manager` then `Virtual Switch Manager`.\ 44 | If you want to customize the MAC address that will be assigned, change it in `MAC Address Range`.\ 45 | Create an external switch, you can name it `Bridge-MB_Manufacter-NetworkCard_Manufacter`, for example: `Bridge-Asus-Intel`. 46 | Make sure the network is the network card you want. 47 | 48 | ## GPU Drivers 49 | 50 | Make sure you have the latest NVIDIA/AMD/Intel GPU drivers installed on the host. 51 | 52 | ## Easy-GPU-PV 53 | 54 | We will use [Easy-GPU-PV](https://github.com/jamesstringerparsec/Easy-GPU-PV) scripts for the VM setup.\ 55 | Follow instructions from the [ReadMe](https://github.com/jamesstringerparsec/Easy-GPU-PV#instructions). 56 | 57 | Here are my edited values for reference: 58 | 59 | ```powershell 60 | VMName = "MercuryVM" 61 | SourcePath = "C:\Users\Aethys\Downloads\Win10_21H2_EnglishInternational_x64.iso" 62 | SizeBytes = 80GB 63 | MemoryAmount = 12GB 64 | CPUCores = 6 65 | NetworkSwitch = "Bridge-Asus-Intel" 66 | VHDPath = "C:\Users\Aethys\Documents\Virtual Machines\" 67 | GPUName = "AUTO" 68 | GPUResourceAllocationPercentage = 10 69 | Username = "Mercury" 70 | Password = "WHAT_YOU_WANT" 71 | ``` 72 | 73 | ## Setup 74 | 75 | When the RDC window open, before login to Parsec you can do a quick setup of the VM : 76 | 77 | - Task Bar 78 | - Network Sharing Options 79 | - Keyboard Layout 80 | - ... 81 | 82 | We will use Parsec but through a Virtual Display Adapter so when we disconnect from Parsec (or Hyper-V RDP) we still have a monitor plugged. 83 | 84 | - Quit Parsec and Open `C:\ProgramData\Parsec\config.txt` 85 | - Remove `host_virtual_monitors = 1` and `host_privacy_mode = 1` 86 | - Enable the "Microsoft Hyper-V Video" Display Adapter in the Device Manager 87 | - Download `usbmidd_v2.zip` from https://www.amyuni.com/downloads/usbmmidd_v2.zip 88 | - Extract and run `usbmidd.bat` as administrator 89 | - Open `Display settings` (right-click on desktop) and change the resolution to what you want for the 2nd monitor. -ample: `1920x1080` 90 | - Launch Parsec and log in then go to Settings 91 | - On the `Host` tab, set the Resolution to `1920x1080` and the Bandwidth Limit to `50 Mbps` 92 | - Shutdown the VM 93 | - Edit Hyper-V VM Settings 94 | - Remove the Media from the DVD Drive 95 | - Define a Static MAC Address in the Network Adapter (Advanced Feature) 96 | - Start the VM 97 | - Connect using Parsec 98 | 99 | ## Applications 100 | 101 | Install your applications and have fun.\ 102 | Do not forget to activate Windows. 103 | 104 | ## Update the Resource Allocation Percentage 105 | 106 | 1) Shutdown the VM 107 | 2) Open a PowerShell console as Administrator 108 | 3) Run the following command: 109 | 110 | ```powershell 111 | # Update those values to match your need 112 | [string]$VMName = "MercuryVM" 113 | [decimal]$GPUResourceAllocationPercentage = 35 114 | 115 | [float]$divider = [math]::round($(100 / $GPUResourceAllocationPercentage), 2) 116 | 117 | Set-VMGpuPartitionAdapter -VMName $VMName -MinPartitionVRAM ([math]::round($(1000000000 / $divider))) -MaxPartitionVRAM ([math]::round($(1000000000 / $divider))) -OptimalPartitionVRAM ([math]::round($(1000000000 / $divider))) 118 | Set-VMGpuPartitionAdapter -VMName $VMName -MinPartitionEncode ([math]::round($(18446744073709551615 / $divider))) -MaxPartitionEncode ([math]::round($(18446744073709551615 / $divider))) -OptimalPartitionEncode ([math]::round($(18446744073709551615 / $divider))) 119 | Set-VMGpuPartitionAdapter -VMName $VMName -MinPartitionDecode ([math]::round($(1000000000 / $divider))) -MaxPartitionDecode ([math]::round($(1000000000 / $divider))) -OptimalPartitionDecode ([math]::round($(1000000000 / $divider))) 120 | Set-VMGpuPartitionAdapter -VMName $VMName -MinPartitionCompute ([math]::round($(1000000000 / $divider))) -MaxPartitionCompute ([math]::round($(1000000000 / $divider))) -OptimalPartitionCompute ([math]::round($(1000000000 / $divider))) 121 | ``` 122 | 123 | 4) You can check that everything was applied correctly by doing : 124 | 125 | ```powershell 126 | Get-VMGpuPartitionAdapter -VMName $VMName -ErrorAction SilentlyContinue 127 | ``` 128 | 129 | ## After GPU Drivers Update 130 | 131 | 1) Shutdown the VM (and reboot the PC if it was not after drivers install) 132 | 2) Open a PowerShell console as Administrator 133 | 3) Run the following command: 134 | 135 | ```powershell 136 | cd Easy-GPU-PV 137 | ./Update-VMGpuPartitionDriver.ps1 -VMName "MercuryVM" -GPUName "AUTO" 138 | ``` 139 | -------------------------------------------------------------------------------- /scripts/herodamage.md: -------------------------------------------------------------------------------- 1 | # Scripts: HeroDamage 2 | 3 | Those scripts are meant to be run on Debian WSL which is the distribution I use to run HeroDamage simulations.\ 4 | Technically it can be adapted to work on any Linux distributions. 5 | 6 | ## Debian Install 7 | 8 | ```bash 9 | # Debian 10 | sudo apt update 11 | sudo apt upgrade -y 12 | 13 | # Utils 14 | sudo apt install -y coreutils curl gawk 15 | cat << 'EOF' >> ~/.bashrc 16 | 17 | # prompt 18 | export PS1="\[\033[35m\]\t\[\033[m\]-\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " 19 | EOF 20 | 21 | # Fix Windows drive mounting, cf. https://askubuntu.com/a/1242671 22 | sudo tee /etc/wsl.conf > /dev/null << 'EOF' 23 | [automount] 24 | options = "metadata" 25 | EOF 26 | ``` 27 | 28 | Exit every WSL shells and then run `wsl --shutdown` in a PowerShell (or restart the computer). 29 | 30 | ```bash 31 | # Git 32 | sudo apt install -y git git-flow git-lfs 33 | git config --global user.name "Quentin Giraud" 34 | git config --global user.email "dev@aethys.io" 35 | cat << 'EOF' >> ~/.bashrc 36 | 37 | # Register the SSH private keys from ~/.ssh as identities, cf. https://stackoverflow.com/a/48509425 38 | # Ensure agent is running 39 | ssh-add -l &>/dev/null 40 | if [ "$?" == 2 ]; then 41 | # Could not open a connection to your authentication agent. 42 | 43 | # Load stored agent connection info. 44 | test -r ~/.ssh-agent && eval "$(<~/.ssh-agent)" >/dev/null 45 | 46 | ssh-add -l &>/dev/null 47 | if [ "$?" == 2 ]; then 48 | # Start agent and store agent connection info. 49 | (umask 066; ssh-agent > ~/.ssh-agent) 50 | eval "$(<~/.ssh-agent)" >/dev/null 51 | fi 52 | fi 53 | # Load identities 54 | ssh-add -l &>/dev/null 55 | if [ "$?" == 1 ]; then 56 | # The agent has no identities. 57 | grep -slR "PRIVATE" ~/.ssh | xargs ssh-add &> /dev/null 58 | fi 59 | EOF 60 | # DO NOT FORGET TO PUT THE SSH KEYS IN the '~/.ssh' FOLDER (import from KeePass or generate them) 61 | # cp /mnt/c/Users/Aethys/Documents/ssh/aethys256-GitHub ~/.ssh/aethys256-GitHub 62 | # chmod 600 ~/.ssh/aethys256-GitHub 63 | # cp /mnt/c/Users/Aethys/Documents/ssh/aethys256-GitHub.pub ~/.ssh/aethys256-GitHub.pub 64 | # chmod 600 ~/.ssh/aethys256-GitHub.pub 65 | 66 | # C/C++ 67 | sudo apt install -y build-essential 68 | 69 | # Ruby - rbenv 70 | sudo apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev 71 | curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash 72 | cat << 'EOF' >> ~/.bashrc 73 | 74 | # rbenv 75 | export PATH="$HOME/.rbenv/bin:$PATH" 76 | eval "$(rbenv init -)" 77 | alias rbenv-stable-list="rbenv install --list-all | grep -v '\-\|nightly\|dev\|next\|a\|b\|rc' | awk '{\$1=\$1};1' | grep '^2.7'" 78 | alias rbenv-stable-latest="rbenv-stable-list | tail -1" 79 | alias rbenv-stable-previous="rbenv-stable-list | tail -2 | head -1" 80 | EOF 81 | 82 | # Reload the shell 83 | exec $SHELL 84 | 85 | # Ruby 86 | git clone https://github.com/rbenv/rbenv-each.git "$(rbenv root)/plugins/rbenv-each" 87 | git clone https://github.com/tpope/rbenv-aliases.git "$(rbenv root)/plugins/rbenv-aliases" 88 | rbenv install $(rbenv-stable-latest) 89 | rbenv global $(rbenv-stable-latest) 90 | rbenv rehash 91 | gem update --system 92 | rbenv rehash 93 | printf "rbenv versions:\n" && rbenv versions && printf "\nrbenv --version: $(rbenv --version)\n" && printf "ruby --version: $(ruby --version)\n" && printf "gem --version: $(gem --version)\n" 94 | 95 | # Ruby gems 96 | gem install bundler 97 | ``` 98 | 99 | ## Debian Update 100 | 101 | ### Script 102 | ```bash 103 | cat << 'EOF' > ~/upgrade.sh 104 | #!/bin/bash 105 | 106 | curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash > /dev/null 107 | yes n | rbenv install $(rbenv-stable-latest) 108 | rbenv global $(rbenv-stable-latest) 109 | yes | rbenv uninstall $(rbenv-stable-previous) 110 | rbenv rehash 111 | gem update --system 112 | rbenv rehash 113 | gem install bundler 114 | gem install bundler:1.16.5 115 | 116 | printf '\n' 117 | echo '------ rbenv ------' 118 | printf "rbenv versions:\n" && rbenv versions && printf '\n' 119 | printf "rbenv --version: $(rbenv --version)\n" 120 | printf "ruby --version: $(ruby --version)\n" 121 | printf "gem --version: $(gem --version)\n" 122 | EOF 123 | chmod +x ~/upgrade.sh 124 | ``` 125 | 126 | ### Commands 127 | 128 | #### Update 129 | 130 | ```bash 131 | sudo apt update 132 | sudo apt upgrade -y 133 | . ~/upgrade.sh 134 | ``` 135 | 136 | #### Uninstall rubyenv version 137 | 138 | ```bash 139 | yes | rbenv uninstall XXX 140 | ``` 141 | 142 | ## SimC & SimCScripts 143 | 144 | ### Initial setup 145 | 146 | Choose a folder where the structure will be : 147 | 148 | - simc 149 | - simcscripts 150 | - clean.sh 151 | - run.sh 152 | - SimcConfig.yml 153 | 154 | In my case it is `/mnt/c/Users/Aethys/Documents/herodamage/xxx`, where `xxx` is the version of HD (`legion`, `bfa`, `shadowlands`, ...). 155 | 156 | ```bash 157 | # Legion 158 | git clone -b legion-dev https://github.com/simulationcraft/simc.git simc 159 | chmod +x ./simc/generate_profiles.sh 160 | git clone -b legion https://github.com/Ravenholdt-TC/SimcScripts.git simcscripts 161 | git clone -b master https://github.com/herotc/legion.herodamage.com.git herodamage.com 162 | 163 | # Battle for Azeroth 164 | git clone -b bfa-dev https://github.com/simulationcraft/simc.git simc 165 | chmod +x ./simc/generate_profiles.sh 166 | git clone -b bfa https://github.com/Ravenholdt-TC/SimcScripts.git simcscripts 167 | git clone -b master https://github.com/herotc/bfa.herodamage.com.git herodamage.com 168 | 169 | # Shadowlands 170 | git clone -b shadowlands https://github.com/simulationcraft/simc.git simc 171 | chmod +x ./simc/generate_profiles.sh 172 | git clone -b master https://github.com/Ravenholdt-TC/SimcScripts.git simcscripts 173 | git clone -b master https://github.com/herotc/shadowlands.herodamage.com.git herodamage.com 174 | ``` 175 | 176 | Create the `SimcConfig.yml` file using `simcscripts/SimcConfig_Example.yml`. 177 | 178 | ### run.sh 179 | 180 | ```bash 181 | cat << 'EOF' > ./run.sh 182 | #!/bin/bash 183 | 184 | BASE_DIR=$(pwd) 185 | 186 | cd ${BASE_DIR}/simc/ 187 | git clean -xdf 188 | git reset --hard 189 | git pull 190 | make -C engine -j $(expr $(cat /proc/cpuinfo | grep processor | wc -l) / 2) SC_NO_NETWORKING=1 LTO=1 optimized 191 | cp engine/simc simc 192 | ./generate_profiles.sh 193 | 194 | cd ${BASE_DIR}/herodamage.com/ 195 | git clean -xdf 196 | git reset --hard 197 | git pull 198 | 199 | cd ${BASE_DIR}/simcscripts/ 200 | git pull 201 | bundle install 202 | cp ${BASE_DIR}/SimcConfig.yml ${BASE_DIR}/simcscripts/SimcConfig.yml 203 | ruby Run.rb 204 | 205 | cd ${BASE_DIR} 206 | EOF 207 | chmod +x ./run.sh 208 | ``` 209 | 210 | ```bash 211 | . ./run.sh 212 | ``` 213 | 214 | ### clean.sh 215 | 216 | ```bash 217 | cat << 'EOF' > ./clean.sh 218 | #!/bin/bash 219 | 220 | BASE_DIR=$(pwd) 221 | 222 | cd ${BASE_DIR}/simcscripts/ 223 | git clean -xdf 224 | git reset --hard 225 | 226 | cd ${BASE_DIR} 227 | EOF 228 | chmod +x ./clean.sh 229 | ``` 230 | 231 | ```bash 232 | . ./clean.sh 233 | ``` 234 | -------------------------------------------------------------------------------- /misc/misc.md: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | 3 | ## Docker 4 | 5 | ### Get default Git, NodeJS, NPM and Yarn versions on Node image 6 | 7 | ```bash 8 | docker run -it node:16 /bin/bash 9 | node --version 10 | npm --version 11 | yarn --version 12 | ``` 13 | 14 | ### Clean 15 | 16 | ```bash 17 | docker-compose down # Stop the container(s) 18 | docker rm -f $(docker ps -a -q) # Delete all containers 19 | docker volume rm $(docker volume ls -q) # Delete all volumes 20 | docker-compose up # Restart the containers 21 | ``` 22 | 23 | ## Apache Bench 24 | 25 | ### Simple request 26 | 27 | ```bash 28 | ab -n 10000 -c 512 -k http://127.0.0.1:3000/ 29 | ``` 30 | 31 | ## Symbolic link 32 | 33 | ```bash 34 | ln -s /path/to/original/ /path/to/link 35 | ``` 36 | 37 | ## Diff 38 | 39 | ```bash 40 | diff --unified=3 file1.ext file2.ext > file.diff 41 | ``` 42 | 43 | Where the number after `--unified=` is the number of lines showing the context. To fully output the file, put a big number (> number of lines). 44 | 45 | ## SSL 46 | 47 | ### Convert .pem & .key to .pfx (pkcs12) 48 | 49 | This example use Cloudflare Origin CA root certificates for CAfile but the idea is the same. 50 | 51 | ```bash 52 | openssl pkcs12 -export -out myCertificate.pfx -in myCertificate.pem -inkey myCertificate.key -CAfile origin_ca_rsa_root.pem 53 | ``` 54 | 55 | It will then ask for a password before creating the certificate. 56 | 57 | ## SSH Key 58 | 59 | ### Generate 60 | 61 | ```bash 62 | # Modern system 63 | ssh-keygen -t ed25519 -C "comment, usually mail address" -f "filename, usually username-Platform" 64 | 65 | # Legacy system 66 | ssh-keygen -t rsa -b 4096 -C "comment, usually mail address" -f "filename, usually username-Platform" 67 | ``` 68 | 69 | ### Add 70 | 71 | ```bash 72 | ssh-add ~/.ssh/PRIVATE-KEY-FILE &> /dev/null 73 | ``` 74 | 75 | ### Config 76 | 77 | ~/.ssh/config: 78 | 79 | ```text 80 | Host github.com 81 | HostName github.com 82 | User git 83 | IdentityFile ~/.ssh/aethys256-GitHub 84 | ``` 85 | 86 | ## PostgreSQL 87 | 88 | ### List all collations 89 | 90 | ```sql 91 | SELECT * FROM pg_collation; 92 | ``` 93 | 94 | ### Create Database with UTF8 95 | 96 | ```sql 97 | CREATE DATABASE "myDatabase" ENCODING 'UTF8' LC_COLLATE = 'en_US.utf8' LC_CTYPE = 'en_US.utf8' TEMPLATE template0; 98 | ``` 99 | 100 | ## Python 101 | 102 | ### Uninstall all pip packages 103 | 104 | ```bash 105 | pip freeze | xargs pip uninstall -y 106 | ``` 107 | 108 | ## Git 109 | 110 | ### Aliases 111 | 112 | ```bash 113 | [alias] 114 | rebase-last = "!b=\"$(git branch --no-color | cut -c3-)\" ; h=\"$(git rev-parse $b)\" ; echo \"Current branch: $b $h\" ; c=\"$(git rev-parse $b)\" ; echo \"Recreating $b branch with initial commit $c ...\" ; git checkout --orphan new-start $c ; git commit -C $c ; git rebase --onto new-start $c $b ; git branch -d new-start ; git gc" 115 | ``` 116 | 117 | ### History Clean/Rewrite 118 | 119 | ```bash 120 | # Clone the repository and fetch everything 121 | git clone git@my-repo.git my-repo 122 | git fetch --all 123 | git pull --all 124 | git lfs fetch --all 125 | git lfs pull --all 126 | 127 | # Now make a backup of `my-repo`: `my-repo-bak1` 128 | 129 | # Export LFS objects to normal objects 130 | git lfs migrate export --everything --include="*.3dm,*.3ds,*.blend,*.c4d,*.collada,*.dae,*.dxf,*.fbx,*.jas,*.lws,*.lxo,*.ma,*.max,*.mb,*.obj,*.ply,*.skp,*.stl,*.ztl,*.aif,*.aiff,*.it,*.mod,*.mp3,*.ogg,*.s3m,*.wav,*.xm,*.otf,*.ttf,*.bmp,*.exr,*.gif,*.hdr,*.iff,*.jpeg,*.jpg,*.pict,*.png,*.psd,*.tga,*.tif,*.tiff,*.mov,*.mp4,*.webm" 131 | git lfs prune 132 | git reflog expire --expire=now --all && git gc --prune=now --aggressive 133 | 134 | # Now make a second backup of `my-repo`: `my-repo-bak2` 135 | 136 | # Install `git-filter-repo` and use it inside the git repository to analyze what to remove 137 | python ../git-filter-repo --analyze --force 138 | 139 | # Go to `.git\filter-repo\analysis` and define a filtering strategy (you can apply multiple filtering strategies) 140 | 141 | # Using regex 142 | python ../git-filter-repo --force --path-regex '.*\.(webm|tif|mp4|bundle|7z|psd|cache|zip|obj|blend1|blend|hlsl|bin|playable|terrainlayer|guiskin|lighting|overrideController|hash|signal|watermesh|config|CopyComplete|wav|png|tga)$' --invert-paths --prune-empty never --prune-degenerate never 143 | 144 | # Using paths 145 | python ../git-filter-repo --force --path MyDir/ --path MyOtherDir/ --invert-paths --prune-empty never --prune-degenerate never 146 | 147 | # Using blobs size 148 | python ../git-filter-repo --force --strip-blobs-bigger-than 50K --prune-empty never --prune-degenerate never 149 | 150 | # It will clear everything including your latest "safe" commit, so you might want to port back what should be kept from your last commit in case you went too far in the cleaning 151 | # You might need to rebase if you have multiple branches 152 | 153 | # Now make a third backup of `my-repo`: `my-repo-bak2` 154 | 155 | # Import LFS objects from normal objects 156 | git lfs migrate import --everything --include="*.3dm,*.3ds,*.blend,*.c4d,*.collada,*.dae,*.dxf,*.fbx,*.jas,*.lws,*.lxo,*.ma,*.max,*.mb,*.obj,*.ply,*.skp,*.stl,*.ztl,*.aif,*.aiff,*.it,*.mod,*.mp3,*.ogg,*.s3m,*.wav,*.xm,*.otf,*.ttf,*.bmp,*.exr,*.gif,*.hdr,*.iff,*.jpeg,*.jpg,*.pict,*.png,*.psd,*.tga,*.tif,*.tiff,*.mov,*.mp4,*.webm" 157 | 158 | # Export/Import might have messed your `.gitattributes`, so update it and commit it. 159 | 160 | # Clear your local .git from artefacts 161 | git reflog expire --expire=now --all && git gc --prune=now --aggressive 162 | 163 | # Add back the origin you want to push to since `git-filter-repo` might have removed it. KEEP IN MIND THAT FOR GITHUB YOU NEED TO MAKE A NEW REPO TO CLEAN EFFECTIVELY LFS OBJECTS 164 | git remote add origin git@address.git 165 | git push --all 166 | 167 | # Delete your local directories and backups if not needed anymore. 168 | ``` 169 | 170 | ## GPSBabel 171 | 172 | ### Convert GPX Track to GPX Waypoints 173 | 174 | ```bash 175 | gpsbabel -i gpx -f INPUT.gpx -x transform,wpt=trk -o gpx -F OUTPUT.gpx 176 | ``` 177 | 178 | ## Pandoc 179 | 180 | ### Convert Markdown to PDF 181 | 182 | ```bash 183 | pandoc file.md --pdf-engine=xelatex -V geometry:margin=1.5in -V urlcolor=blue -o file.pdf 184 | ``` 185 | 186 | ## FFmpeg 187 | 188 | ### 360 Video 189 | 190 | ```bash 191 | # Credits: https://headjack.io/blog/360-video-cloud-encoding-profiles/ 192 | 193 | # PC (VR Headset) 194 | ffmpeg -i "monoscopic_video.mp4" -c:v libx264 -crf 18 -x264-params "mvrange=511" -maxrate 120M -bufsize 150M -vf "scale=5760x2880" -pix_fmt yuv420p -c:a aac -b:a 192k -r 30 -movflags faststart "monoscopic_output.mp4" 195 | ffmpeg -i "stereoscopic_video.mp4" -c:v libx265 -crf 17 -maxrate 120M -bufsize 150M -vf "scale=4096x4096" -pix_fmt yuv420p -c:a aac -b:a 192k -r 30 -movflags faststart "stereoscopic_output.mp4" 196 | 197 | # Mobile (Cardboard / Autonomous VR Headset): up to 3840×2160 for Stereo 198 | ffmpeg -i "monoscopic_video.mp4" -c:v libx265 -crf 17 -maxrate 80M -bufsize 100M -vf "scale=4096x2048" -pix_fmt yuv420p -c:a aac -b:a 192k -r 30 -movflags faststart "monoscopic_output.mp4" 199 | 200 | # Stream: use Mobile for Mono 201 | ffmpeg -i "stereoscopic_video.mp4" -c:v libx265 -crf 20 -x265-params "keyint=60:min-keyint=60" -maxrate 25M -bufsize 35M -vf "scale=3840x2160" -pix_fmt yuv420p -c:a aac -b:a 192k -r 30 -g 60 "stereoscopic_output.mp4" 202 | 203 | # WebVR: no Stereo 204 | ffmpeg -i "monoscopic_video.mp4" -c:v libx264 -crf 21 -maxrate 10M -bufsize 15M -vf "scale=1920x1080" -pix_fmt yuv420p -c:a aac -b:a 192k -r 30 -g 60 -keyint_min 60 "monoscopic_output.mp4" 205 | ``` 206 | 207 | ### Copy metadata 208 | 209 | ```bash 210 | exiftool -api largefilesupport=1 -tagsFromFile "source.mov" -all:all "destination.mp4" 211 | ``` 212 | 213 | ### MediaInfo 214 | 215 | ## Sheet Template 216 | 217 | ```csv 218 | ColumnsCount;21 219 | Column0;General;0;CompleteName;80 220 | Column1;General;0;Format;10 221 | Column2;Video;0;Format/String;10 222 | Column3;Audio;0;Format/String;10 223 | Column4;Text;0;Format/String;10 224 | Column5;General;0;FileSize/String;10 225 | Column6;General;0;Duration/String3;10 226 | Column7;Video;0;BitRate_Mode/String;10 227 | Column8;Video;0;BitRate/String;10 228 | Column9;Audio;0;BitRate_Mode/String;10 229 | Column10;Audio;0;BitRate/String;10 230 | Column11;Video;0;FrameRate_Mode/String;10 231 | Column12;Video;0;Width/String;10 232 | Column13;Video;0;Height/String;10 233 | Column14;Audio;0;SamplingRate/String;10 234 | Column15;Audio;0;BitDepth/String;10 235 | Column16;Audio;0;Channel(s)/String;10 236 | Column19;Video;0;ColorSpace;10 237 | Column17;Video;0;ChromaSubsampling/String;10 238 | Column20;Video;0;colour_range;10 239 | Column18;Video;0;BitDepth/String;10 240 | ``` 241 | -------------------------------------------------------------------------------- /setup/vscode.md: -------------------------------------------------------------------------------- 1 | # Setup: Microsoft Visual Studio Code 2 | 3 | ## Extensions 4 | 5 | Any extension prefixed by \[WSL] is meant to be installed on WSL rather than locally if you are using it.\ 6 | This does not matter for macOS / Linux. 7 | 8 | ### UI 9 | 10 | - \[WSL] [Copy Relative Path and Line Numbers (ezforo.copy-relative-path-and-line-numbers)](https://marketplace.visualstudio.com/items?itemName=ezforo.copy-relative-path-and-line-numbers) 11 | - \[WSL] [EditorConfig for VS Code (editorconfig.editorconfig)](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) 12 | - \[WSL] [GitLens — Git supercharged (eamodio.gitlens)](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) 13 | - \[WSL] [Live Share (ms-vsliveshare.vsliveshare)](https://marketplace.visualstudio.com/items?itemName=ms-vsliveshare.vsliveshare) 14 | - [Material Icon Theme (pkief.material-icon-theme)](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) 15 | - [Material Theme (equinusocio.vsc-material-theme)](https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-material-theme) (Uninstall [Community Material Theme (equinusocio.vsc-community-material-theme)](https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-community-material-theme) & [Material Theme Icons (equinusocio.vsc-material-theme-icons)](https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-material-theme-icons) that are installed as Pack) 16 | - [Remote Development (ms-vscode-remote.vscode-remote-extensionpack)](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) 17 | - \[WSL] [Terminals Manager (fabiospampinato.vscode-terminals)](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-terminals) 18 | - [TODO Highlight (wayou.vscode-todo-highlight)](https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight) 19 | 20 | ### C/C++ 21 | 22 | - \[WSL] [C/C++ Extension Pack (ms-vscode.cpptools-extension-pack)](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack) 23 | 24 | ### C Sharp 25 | 26 | - \[WSL] [C# (ms-vscode.csharp)](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp) 27 | 28 | ### GraphQL 29 | 30 | - \[WSL] [GraphQL (graphql.vscode-graphql)](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql) 31 | 32 | ### JavaScript / TypeScript 33 | 34 | - \[WSL] [ESLint (dbaeumer.vscode-eslint)](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 35 | - \[WSL] [Package Json Upgrade (codeandstuff.package-json-upgrade)](https://marketplace.visualstudio.com/items?itemName=codeandstuff.package-json-upgrade) 36 | - \[WSL] [Prettier - Code formatter (esbenp.prettier-vscode)](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) 37 | - \[WSL] [vscode-styled-components (styled-components.vscode-styled-components)](https://marketplace.visualstudio.com/items?itemName=styled-components.vscode-styled-components) 38 | - \[WSL] [Sort package.json (unional.vscode-sort-package-json)](https://marketplace.visualstudio.com/items?itemName=unional.vscode-sort-package-json) 39 | 40 | ### Lua 41 | 42 | - \[WSL] [Lua (sumneko.lua)](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) 43 | - [WoW Bundle (septh.wow-bundle)](https://marketplace.visualstudio.com/items?itemName=Septh.wow-bundle) 44 | 45 | ### Python 46 | 47 | - \[WSL] [Python (ms-python.python)](https://marketplace.visualstudio.com/items?itemName=ms-python.python) 48 | - \[WSL] [Pylance (ms-python.vscode-pylance)](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) 49 | 50 | ### Ruby 51 | 52 | - \[WSL] [Ruby (rebornix.ruby)](https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby) (will also install [VSCode Ruby (wingrunr21.vscode-ruby)](https://marketplace.visualstudio.com/items?itemName=wingrunr21.vscode-ruby)) 53 | 54 | ### Rust 55 | 56 | - \[WSL] [rust-analyzer (rust-lang.rust-analyzer)](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) 57 | 58 | ### SQL 59 | 60 | - \[WSL] [SQLTools (mtxr.sqltools)](https://marketplace.visualstudio.com/items?itemName=mtxr.sqltools) 61 | - \[WSL] [SQLTools PostgreSQL/Cockroach/Redshift Driver (mtxr.sqltools-driver-pg)](https://marketplace.visualstudio.com/items?itemName=mtxr.sqltools-driver-pg) 62 | - \[WSL] [SQLTools SQLite (mtxr.sqltools-driver-sqlite)](https://marketplace.visualstudio.com/items?itemName=mtxr.sqltools-driver-sqlite) 63 | 64 | ### Misc 65 | 66 | - \[WSL] [AutoIt (damien.autoit)](https://marketplace.visualstudio.com/items?itemName=Damien.autoit) 67 | - \[WSL] [Rainbow CSV (mechatroner.rainbow-csv)](https://marketplace.visualstudio.com/items?itemName=mechatroner.rainbow-csv) 68 | - [DotENV (mikestead.dotenv)](https://marketplace.visualstudio.com/items?itemName=mikestead.dotenv) 69 | - \[WSL] [gettext (mrorz.language-gettext)](https://marketplace.visualstudio.com/items?itemName=mrorz.language-gettext) 70 | - [Log File Highlighter (emilast.logfilehighlighter)](https://marketplace.visualstudio.com/items?itemName=emilast.LogFileHighlighter) 71 | - [Markdown All in One (yzhang.markdown-all-in-one)](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) 72 | - \[WSL] [markdownlint (davidanson.vscode-markdownlint)](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) 73 | - [SimulationCraft (mystler.simulationcraft)](https://marketplace.visualstudio.com/items?itemName=Mystler.simulationcraft) 74 | - \[WSL] [Visual Studio IntelliCode (visualstudioexptteam.vscodeintellicode)](https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.vscodeintellicode) 75 | 76 | ### DevOps 77 | 78 | - \[WSL] [Azure Pipelines (ms-azure-devops.azure-pipelines)](https://marketplace.visualstudio.com/items?itemName=ms-azure-devops.azure-pipelines) (will also install [Azure Account (ms-vscode.azure-account)](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account)) 79 | - \[WSL] [Docker (ms-azuretools.vscode-docker)](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) 80 | - \[WSL] [ShellCheck (timonwong.shellcheck)](https://marketplace.visualstudio.com/items?itemName=timonwong.shellcheck) 81 | - \[WSL] [PowerShell (ms-vscode.powershell)](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) 82 | - \[WSL] [YAML (redhat.vscode-yaml)](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) 83 | 84 | ## settings.json 85 | 86 | ```json 87 | { 88 | "autoit.enableDiagnostics": false, 89 | "autoit.consoleParams": "", 90 | "csharp.referencesCodeLens.enabled": false, 91 | "diffEditor.renderSideBySide": true, 92 | "editor.detectIndentation": true, 93 | "editor.fontSize": 14, 94 | "editor.insertSpaces": true, 95 | "editor.linkedEditing": true, 96 | "editor.renderWhitespace": "boundary", 97 | "editor.semanticHighlighting.enabled": true, 98 | "editor.suggestSelection": "first", 99 | "editor.tabSize": 2, 100 | "editor.unicodeHighlight.nonBasicASCII": false, 101 | "eslint.packageManager": "yarn", 102 | "explorer.confirmDelete": false, 103 | "explorer.confirmDragAndDrop": false, 104 | "files.associations": { 105 | "*.asset": "yaml", 106 | "*.unity": "yaml" 107 | }, 108 | "files.autoSave": "onFocusChange", 109 | "git.allowForcePush": true, 110 | "git.allowNoVerifyCommit": true, 111 | "git.autofetch": true, 112 | "git.branchSortOrder": "alphabetically", 113 | "git.confirmForcePush": false, 114 | "git.confirmNoVerifyCommit": false, 115 | "git.confirmSync": false, 116 | "git.fetchOnPull": true, 117 | "git.rebaseWhenSync": true, 118 | "git.showPushSuccessNotification": true, 119 | "git.suggestSmartCommit": false, 120 | "github.gitProtocol": "ssh", 121 | "gitlens.codeLens.enabled": false, 122 | "gitlens.showWelcomeOnInstall": false, 123 | "gitlens.showWhatsNewAfterUpgrades": false, 124 | "javascript.preferences.importModuleSpecifier": "project-relative", 125 | "javascript.suggest.completeFunctionCalls": true, 126 | "javascript.updateImportsOnFileMove.enabled": "always", 127 | "Lua.runtime.version": "Lua 5.1", 128 | "Lua.workspace.maxPreload": 1000000, 129 | "Lua.workspace.preloadFileSize": 10000, 130 | "material-icon-theme.activeIconPack": "react_redux", 131 | "npm.packageManager": "yarn", 132 | "python.languageServer": "Pylance", 133 | "python.terminal.activateEnvironment": false, 134 | "redhat.telemetry.enabled": false, 135 | "security.workspace.trust.untrustedFiles": "open", 136 | "telemetry.telemetryLevel": "off", 137 | "typescript.locale": "en", 138 | "typescript.suggest.completeFunctionCalls": true, 139 | "typescript.tsserver.maxTsServerMemory": 6144, 140 | "typescript.updateImportsOnFileMove.enabled": "always", 141 | "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", 142 | "workbench.colorCustomizations": { 143 | "editorWhitespace.foreground": "#ffffff10" 144 | }, 145 | "workbench.colorTheme": "Material Theme Darker High Contrast", 146 | "workbench.iconTheme": "material-icon-theme", 147 | "workbench.tree.indent": 14, 148 | "[html]": { 149 | "editor.codeActionsOnSave": { 150 | "source.fixAll.eslint": true 151 | }, 152 | "editor.defaultFormatter": "esbenp.prettier-vscode" 153 | }, 154 | "[javascript]": { 155 | "editor.codeActionsOnSave": { 156 | "source.fixAll.eslint": true 157 | }, 158 | "editor.defaultFormatter": "esbenp.prettier-vscode" 159 | }, 160 | "[javascriptreact]": { 161 | "editor.codeActionsOnSave": { 162 | "source.fixAll.eslint": true 163 | }, 164 | "editor.defaultFormatter": "esbenp.prettier-vscode" 165 | }, 166 | "[json]": { 167 | "editor.defaultFormatter": "esbenp.prettier-vscode" 168 | }, 169 | "[jsonc]": { 170 | "editor.defaultFormatter": "esbenp.prettier-vscode" 171 | }, 172 | "[markdown]": { 173 | "editor.codeActionsOnSave": { 174 | "source.fixAll.eslint": true 175 | }, 176 | "editor.defaultFormatter": "esbenp.prettier-vscode" 177 | }, 178 | "[typescript]": { 179 | "editor.codeActionsOnSave": { 180 | "source.fixAll.eslint": true 181 | }, 182 | "editor.defaultFormatter": "esbenp.prettier-vscode" 183 | }, 184 | "[typescriptreact]": { 185 | "editor.codeActionsOnSave": { 186 | "source.fixAll.eslint": true 187 | }, 188 | "editor.defaultFormatter": "esbenp.prettier-vscode" 189 | }, 190 | "[vue]": { 191 | "editor.codeActionsOnSave": { 192 | "source.fixAll.eslint": true 193 | }, 194 | "editor.defaultFormatter": "esbenp.prettier-vscode" 195 | } 196 | } 197 | ``` 198 | -------------------------------------------------------------------------------- /setup/macos.md: -------------------------------------------------------------------------------- 1 | # Setup: macOS 2 | 3 | ## Introduction 4 | 5 | These are my personal macOS post-install notes. Feel free to pick-up whatever you might need.\ 6 | Before starting, do not forget to update macOS to the latest update thanks to the App Store. 7 | 8 | ## macOS defaults 9 | 10 | Refer to `macOS-defaults` instructions. 11 | 12 | ## Dev Environment 13 | 14 | Here is how I setup my development environment. 15 | 16 | ### Install XCode / XCode Command Line Tools 17 | 18 | I do use XCode that's why, if you use it just for the CLI, homebrew will install it for you.\ 19 | Once it's installed, `reboot` then do: 20 | 21 | ```bash 22 | sudo xcode-select -s /Applications/Xcode.app/Contents/Developer 23 | 24 | sudo xcodebuild -license accept 25 | ``` 26 | 27 | If you want to install the Command Line Tools yourself, you can also do it using this: 28 | 29 | ```bash 30 | xcode-select --install 31 | 32 | sudo xcode-select --switch /Library/Developer/CommandLineTools 33 | ``` 34 | 35 | ### Install brew + cask & cask versions 36 | 37 | ```bash 38 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 39 | echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile 40 | eval "$(/opt/homebrew/bin/brew shellenv)" 41 | ``` 42 | 43 | ```bash 44 | 45 | brew doctor 46 | ``` 47 | 48 | ```bash 49 | brew tap homebrew/cask 50 | brew tap homebrew/cask-versions 51 | brew update && brew upgrade && brew upgrade --cask && brew cleanup 52 | brew --version 53 | ``` 54 | 55 | ### Basics + NVM + RVM + Java8 + Misc 56 | 57 | ```bash 58 | # Basics 59 | brew install git git-flow git-lfs gnupg openssl zlib sqlite 60 | git lfs install 61 | 62 | # Node - nodenv 63 | brew install nodenv 64 | echo 'eval "$(nodenv init -)"' >> ~/.zprofile 65 | 66 | # Ruby - rbenv 67 | brew install rbenv ruby-build 68 | echo 'eval "$(rbenv init - zsh)"' >> ~/.zprofile 69 | 70 | # Python - PyEnv 71 | brew install pyenv 72 | cat << 'EOF' >> ~/.zprofile 73 | export PYENV_ROOT="$HOME/.pyenv" 74 | command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" 75 | eval "$(pyenv init -)" 76 | EOF 77 | 78 | # .NET Core SDK + Mono 79 | brew install --cask dotnet-sdk 80 | 81 | ## Requires password 82 | # Java 83 | brew install openjdk 84 | 85 | # Rust 86 | curl -fsSL --tlsv1.2 --proto '=https' https://sh.rustup.rs | sh 87 | ``` 88 | 89 | ```bash 90 | # Note the quotes around the first EOF to avoid variable expansion :) 91 | cat << 'EOF' > ~/.zshrc 92 | ## Prompt 93 | export PS1="%F{magenta}%*%f %F{blue}%n%f@%F{green}%m%f %F{yellow}%~%k%f $ " 94 | 95 | ## LANG 96 | export LANG="en_US.UTF-8" 97 | export LANGUAGE="en_US.UTF-8" 98 | export LC_ALL="en_US.UTF-8" 99 | 100 | ## SSH 101 | # Register the SSH private keys from ~/.ssh as identities 102 | grep -slR "PRIVATE" ~/.ssh | xargs ssh-add &> /dev/null 103 | 104 | ## SourceTree 105 | # In order to have our PATH correctly setup, we have to open SourceTree from a terminal, so we make an alias for that. 106 | # See https://community.atlassian.com/t5/Bitbucket-questions/SourceTree-Hook-failing-because-paths-don-t-seem-to-be-set/qaq-p/274792 107 | alias ostree="open /Applications/SourceTree.app" 108 | 109 | ## Homebrew 110 | eval "$(/opt/homebrew/bin/brew shellenv)" 111 | 112 | ## Authentication Tokens (GitHub + NPM) 113 | export GH_TOKEN="XXXXXXXX" 114 | export NPM_TOKEN_AETHYS="XXXXXXXX" 115 | export NPM_TOKEN_CTA="XXXXXXXX" 116 | export NPM_TOKEN="$NPM_TOKEN_CTA" 117 | USE_NPM_TOKEN_AETHYS () { 118 | export NPM_TOKEN="$NPM_TOKEN_AETHYS" 119 | } 120 | USE_NPM_TOKEN_CTA () { 121 | export NPM_TOKEN="$NPM_TOKEN_CTA" 122 | } 123 | 124 | ## Python (PyEnv) 125 | export PYENV_ROOT="$HOME/.pyenv" 126 | command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" 127 | eval "$(pyenv init -)" 128 | alias pyenv-stable-list="pyenv install --list | sed 's/^ //' | grep '^\d' | grep --invert-match 'dev\|a\|b\|rc'" 129 | alias pyenv-stable-latest="pyenv-stable-list | tail -1" 130 | alias pyenv-stable-previous="pyenv-stable-list | tail -2 | head -1" 131 | 132 | ## NodeJS (nodenv) 133 | eval "$(nodenv init -)" 134 | alias nodenv-stable-list="nodenv install --list | grep -v '\-\|nightly\|dev\|next\|a\|b\|rc' | awk '{\$1=\$1};1' | grep '^16.'" 135 | alias nodenv-stable-latest="nodenv-stable-list | tail -1" 136 | alias nodenv-stable-previous="nodenv-stable-list | tail -2 | head -1" 137 | 138 | ## Ruby (pyenv) 139 | eval "$(rbenv init -)" 140 | alias rbenv-stable-list="rbenv install --list-all | grep -v '\-\|nightly\|dev\|next\|a\|b\|rc' | awk '{\$1=\$1};1' | grep '^3.1'" 141 | alias rbenv-stable-latest="rbenv-stable-list | tail -1" 142 | alias rbenv-stable-previous="rbenv-stable-list | tail -2 | head -1" 143 | 144 | ## Java 145 | export JAVA_HOME=`/usr/libexec/java_home` 146 | 147 | ## Android 148 | export ANDROID_HOME="${HOME}/Library/Android/sdk" 149 | export PATH="${PATH}:${ANDROID_HOME}/tools" 150 | export PATH="${PATH}:${ANDROID_HOME}/platform-tools" 151 | EOF 152 | 153 | cat << 'EOF' > ~/.npmrc 154 | //registry.npmjs.org/:_authToken=${NPM_TOKEN} 155 | registry=https://registry.npmjs.org 156 | EOF 157 | ``` 158 | 159 | It's time for a `reboot` to be safe. 160 | 161 | ### Upgrade Ruby & Node LTS & Tools 162 | 163 | ```bash 164 | # Node 165 | git clone https://github.com/nodenv/nodenv-update.git "$(nodenv root)/plugins/nodenv-update" 166 | git clone https://github.com/nodenv/nodenv-package-json-engine.git "$(nodenv root)/plugins/nodenv-package-json-engine" 167 | git clone https://github.com/nodenv/nodenv-aliases.git "$(nodenv root)/plugins/nodenv-aliases" 168 | git clone https://github.com/nodenv/nodenv-each.git "$(nodenv root)/plugins/nodenv-each" 169 | git clone https://github.com/nodenv/nodenv-package-rehash.git "$(nodenv root)/plugins/nodenv-package-rehash" 170 | git clone https://github.com/nodenv/nodenv-npm-migrate.git "$(nodenv root)/plugins/nodenv-npm-migrate" 171 | nodenv install $(nodenv-stable-latest) 172 | nodenv global $(nodenv-stable-latest) 173 | nodenv rehash 174 | npm install --global npm@latest 175 | nodenv rehash 176 | npm install --global yarn 177 | nodenv rehash 178 | printf "nodenv versions:\n" && nodenv versions && printf "\nnodenv --version: $(nodenv --version)\n" && printf "node --version: $(node --version)\n" && printf "npm --version: $(npm --version)\n" && printf "yarn --version: $(yarn --version)\n" 179 | 180 | # Ruby 181 | git clone https://github.com/rbenv/rbenv-each.git "$(rbenv root)/plugins/rbenv-each" 182 | git clone https://github.com/tpope/rbenv-aliases.git "$(rbenv root)/plugins/rbenv-aliases" 183 | rbenv install $(rbenv-stable-latest) 184 | rbenv global $(rbenv-stable-latest) 185 | rbenv rehash 186 | gem update --system 187 | rbenv rehash 188 | printf "rbenv versions:\n" && rbenv versions && printf "\nrbenv --version: $(rbenv --version)\n" && printf "ruby --version: $(ruby --version)\n" && printf "gem --version: $(gem --version)\n" 189 | 190 | # Python & Pip 191 | git clone https://github.com/pyenv/pyenv-pip-migrate.git "$(pyenv root)/plugins/pyenv-pip-migrate" 192 | pyenv install $(pyenv-stable-latest) 193 | pyenv global $(pyenv-stable-latest) 194 | pyenv rehash 195 | pip install --upgrade pip 196 | pyenv rehash 197 | printf "pyenv versions:\n" && pyenv versions && printf "\npyenv --version: $(pyenv --version)\n" && printf "python --version: $(python --version)\n" && printf "pip --version: $(pip --version)\n" 198 | 199 | # Install Python dependencies 200 | pip install bitarray pefile requests fixedint # simc/casc_extract & simc/dbc_extract 201 | pip install SLPP-23 # hero-dbc 202 | pip install setuptools # hero-rotation-generator 203 | pip install pylint # linter used by IDEs 204 | 205 | # Others 206 | brew install mongo postgresql # This is only for the CLI (use Docker) 207 | brew install libpng # 3rd party post-process lib (like webpack image loaders/plugins) 208 | brew install graphicsmagick # Image resizing 209 | brew install ffmpeg # Video conversion 210 | brew install awscli # AWS CLI 211 | brew install gradle # Mostly for Android stuff 212 | brew install gpsbabel # GPSBabel (GPS utility) 213 | brew install qt clang-format # QT & ClangFormat (mostly for SimC) 214 | ``` 215 | 216 | ### Markdown 217 | 218 | ```bash 219 | brew install librsvg 220 | brew install pandoc 221 | brew cask install basictex 222 | 223 | ## Requires password 224 | sudo tlmgr update --self 225 | sudo tlmgr install collection-fontsrecommended 226 | ``` 227 | 228 | ### Manually 229 | 230 | #### Development 231 | 232 | - [Cyberduck](https://cyberduck.io/download/) 233 | - [DB Browser for SQLite](https://sqlitebrowser.org/dl/) 234 | - [Docker](https://download.docker.com/mac/stable/Docker.dmg) 235 | - [FileZilla](https://filezilla-project.org/download.php?platform=osx) 236 | - [Java](https://www.java.com/en/download/) 237 | - [MongoDB Compass Comunity Edition](https://www.mongodb.com/download-center/compass) 238 | - [pgAdmin](https://www.pgadmin.org/download/pgadmin-4-macos/) 239 | - [Postman](https://www.postman.com/downloads/) 240 | - [Sourcetree](https://www.sourcetreeapp.com/) 241 | - [Unity Hub](https://unity3d.com/get-unity/download) + [.NET Core](https://dotnet.microsoft.com/download) + [Mono](https://www.mono-project.com/download/stable/) (Stable channel for VSCode) 242 | 243 | #### Productivity 244 | 245 | - [Google Chrome](https://www.google.com/chrome/) 246 | - [Google Chrome Remote Desktop](https://remotedesktop.google.com/) 247 | - [Google Drive](https://www.google.com/drive/download/) 248 | - [KeepassXC](https://keepassxc.org/download/) 249 | - [Microsoft Office](https://www.office.com/apps) 250 | - [Microsoft OneDrive](https://www.microsoft.com/en-us/microsoft-365/onedrive/download) 251 | 252 | 253 | #### Communication 254 | 255 | - [Discord](https://discordapp.com/download) 256 | - [Microsoft Teams](https://teams.microsoft.com/downloads) 257 | - [Slack](https://slack.com/downloads/mac) 258 | - [Telegram](https://desktop.telegram.org/) 259 | - [WhatsApp](https://www.whatsapp.com/download/) 260 | 261 | #### Audio / Image / Video 262 | 263 | - [Adobe Creative Cloud](https://creativecloud.adobe.com/en/apps/download/creative-cloud) 264 | - [Audacity](https://www.audacityteam.org/download/mac/) 265 | - [Inkscape](https://inkscape.org/release/) 266 | - [NDI Tools](https://www.ndi.tv/tools/#download-tools) 267 | - [OBS](https://obsproject.com/download) 268 | - [Spotify](https://www.spotify.com/us/download/mac) 269 | - [VLC](https://www.videolan.org/vlc/) 270 | 271 | #### Utils 272 | 273 | - [Corsair iCue](https://www.corsair.com/us/en/icue-mac) 274 | - [iStat Menus](https://beta.bjango.com/mac/istatmenus/) 275 | - [Logitech G Hub](https://www.logitechg.com/en-au/innovation/g-hub.html) 276 | - [NordVPN](https://nordvpn.com/download/) 277 | - [Onyx](https://www.titanium-software.fr/en/onyx.html) 278 | - [Scroll Reverser](https://pilotmoon.com/scrollreverser/) 279 | - [Spectacle](https://www.spectacleapp.com/) 280 | - [SteerMouse](https://plentycom.jp/en/steermouse/download.php) 281 | - [The Unarchiver](https://theunarchiver.com/) 282 | 283 | #### Others 284 | 285 | - [Battle.net](https://www.blizzard.com/en-us/apps/battle.net/desktop) 286 | - [League of Legends](https://signup.euw.leagueoflegends.com/en/signup/redownload) 287 | - [Transmission](https://transmissionbt.com/download/) 288 | -------------------------------------------------------------------------------- /setup/wsl.md: -------------------------------------------------------------------------------- 1 | # Setup: WSL 2 | 3 | ## Introduction 4 | 5 | These are my personal Windows WSL post-install notes, using Ubuntu distribution. Feel free to pick-up whatever you might need.\ 6 | Before starting, do not forget to update Windows to the latest update. 7 | 8 | ## Install WSL2 & Ubuntu 20.04 9 | 10 | This is how I setup my development environment. This is assuming a pristine Windows installation but you might attempt it on an already used one.\ 11 | Follow instructions from this [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) in order to get WSL2. 12 | 13 | TL;DR: 14 | ```powershell 15 | dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 16 | 17 | dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart 18 | ``` 19 | Restart. 20 | ```powershell 21 | wsl --set-default-version 2 22 | ``` 23 | 24 | Get and launch the distribution from the [Ubuntu 20.04 Microsoft Store](https://www.microsoft.com/store/apps/9n6svws3rx71) page.\ 25 | If you already have Ubuntu 20.04 and you want to start over, you can unregister it and register it again (you loose every data inside).\ 26 | Once in the distribution shell, setup the username and password (save it in a credentials manager like KeePass). 27 | 28 | ## Initial setup 29 | ```bash 30 | # Ubuntu 31 | sudo apt update 32 | sudo apt upgrade -y 33 | 34 | # Utils 35 | sudo apt install -y coreutils curl file gawk gnupg 36 | cat << 'EOF' >> ~/.bashrc 37 | 38 | # prompt 39 | export PS1="\[\033[35m\]\t\[\033[m\] \[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h \[\033[33;1m\]\w\[\033[m\] \$ " 40 | EOF 41 | 42 | # Fix Windows drive mounting, cf. https://askubuntu.com/a/1242671 43 | sudo tee /etc/wsl.conf > /dev/null << 'EOF' 44 | [automount] 45 | options = "metadata" 46 | EOF 47 | ``` 48 | 49 | Exit every WSL shells and then run `wsl --shutdown` in a PowerShell (or restart the computer). 50 | 51 | ## cpp + nodenv + rbenv + pyenv + sdkman + Android + .NET Core + Rust 52 | 53 | ```bash 54 | # Git 55 | sudo apt install -y git git-flow git-lfs 56 | git config --global user.name "Quentin Giraud" 57 | git config --global user.email "dev@aethys.io" 58 | cat << 'EOF' >> ~/.bashrc 59 | 60 | # Register the SSH private keys from ~/.ssh as identities, cf. https://stackoverflow.com/a/48509425 61 | # Ensure agent is running 62 | ssh-add -l &>/dev/null 63 | if [ "$?" == 2 ]; then 64 | # Could not open a connection to your authentication agent. 65 | 66 | # Load stored agent connection info. 67 | test -r ~/.ssh-agent && eval "$(<~/.ssh-agent)" >/dev/null 68 | 69 | ssh-add -l &>/dev/null 70 | if [ "$?" == 2 ]; then 71 | # Start agent and store agent connection info. 72 | (umask 066; ssh-agent > ~/.ssh-agent) 73 | eval "$(<~/.ssh-agent)" >/dev/null 74 | fi 75 | fi 76 | # Load identities 77 | ssh-add -l &>/dev/null 78 | if [ "$?" == 1 ]; then 79 | # The agent has no identities. 80 | grep -slR "PRIVATE" ~/.ssh | xargs ssh-add &> /dev/null 81 | fi 82 | EOF 83 | # DO NOT FORGET TO PUT THE SSH KEYS IN the '~/.ssh' FOLDER (import from KeePass or generate them) 84 | # cp /mnt/c/Users/Aethys/Documents/ssh/aethys256-GitHub ~/.ssh/aethys256-GitHub 85 | # chmod 600 ~/.ssh/aethys256-GitHub 86 | # cp /mnt/c/Users/Aethys/Documents/ssh/aethys256-GitHub.pub ~/.ssh/aethys256-GitHub.pub 87 | # chmod 600 ~/.ssh/aethys256-GitHub.pub 88 | 89 | # C/C++ 90 | sudo apt install -y build-essential gdb lldb 91 | 92 | # Node - nodenv 93 | sudo apt-get install g++ make python python3-distutils 94 | curl -fsSL https://raw.githubusercontent.com/nodenv/nodenv-installer/master/bin/nodenv-installer | bash 95 | cat << 'EOF' >> ~/.bashrc 96 | 97 | # nodenv 98 | export PATH="$HOME/.nodenv/bin:$PATH" 99 | eval "$(nodenv init -)" 100 | alias nodenv-stable-list="nodenv install --list | grep -v '\-\|nightly\|dev\|next\|a\|b\|rc' | awk '{\$1=\$1};1' | grep '^16.'" 101 | alias nodenv-stable-latest="nodenv-stable-list | tail -1" 102 | alias nodenv-stable-previous="nodenv-stable-list | tail -2 | head -1" 103 | EOF 104 | # Authentications Tokens (replace the XXXXXXXX) 105 | cat << 'EOF' >> ~/.bashrc 106 | 107 | # Authentication Tokens (GitHub + NPM) 108 | export GH_TOKEN="XXXXXXXX" 109 | export NPM_TOKEN_AETHYS="XXXXXXXX" 110 | export NPM_TOKEN_MYSG="XXXXXXXX" 111 | export NPM_TOKEN="$NPM_TOKEN_MYSG" 112 | USE_NPM_TOKEN_AETHYS () { 113 | export NPM_TOKEN="$NPM_TOKEN_AETHYS" 114 | } 115 | USE_NPM_TOKEN_MYSG () { 116 | export NPM_TOKEN="$NPM_TOKEN_MYSG" 117 | } 118 | EOF 119 | # npmrc file for NPM (also used by Yarn v1) 120 | cat << 'EOF' > ~/.npmrc 121 | //registry.npmjs.org/:_authToken=${NPM_TOKEN} 122 | registry=https://registry.npmjs.org 123 | EOF 124 | # yarnrc.yml file for Yarn v2 125 | cat << 'EOF' > ~/.yarnrc.yml 126 | npmAuthToken: "${NPM_TOKEN}" 127 | npmPublishRegistry: "https://registry.npmjs.org" 128 | npmRegistryServer: "https://registry.npmjs.org" 129 | npmScopes: 130 | mysg: 131 | npmPublishRegistry: "https://registry.npmjs.org" 132 | npmRegistryServer: "https://registry.npmjs.org" 133 | npmAlwaysAuth: false 134 | npmAuthToken: "${NPM_TOKEN_MYSG}" 135 | EOF 136 | 137 | # Ruby - rbenv 138 | sudo apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev 139 | curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash 140 | cat << 'EOF' >> ~/.bashrc 141 | 142 | # rbenv 143 | export PATH="$HOME/.rbenv/bin:$PATH" 144 | eval "$(rbenv init -)" 145 | alias rbenv-stable-list="rbenv install --list-all | grep -v '\-\|nightly\|dev\|next\|a\|b\|rc' | awk '{\$1=\$1};1' | grep '^3.1'" 146 | alias rbenv-stable-latest="rbenv-stable-list | tail -1" 147 | alias rbenv-stable-previous="rbenv-stable-list | tail -2 | head -1" 148 | EOF 149 | 150 | # Python - pyenv 151 | sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \ 152 | libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ 153 | xz-utils tk-dev libffi-dev liblzma-dev python-openssl git 154 | curl -fsSL https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash 155 | cat << 'EOF' >> ~/.bashrc 156 | 157 | # pyenv 158 | export PYENV_ROOT="$HOME/.pyenv" 159 | export PATH="$PYENV_ROOT/bin:$PATH" 160 | eval "$(pyenv init --path)" 161 | eval "$(pyenv virtualenv-init -)" 162 | alias pyenv-stable-list="pyenv install --list | grep -v '\-\|nightly\|dev\|next\|a\|b\|rc' | awk '{\$1=\$1};1' | grep '^3.10'" 163 | alias pyenv-stable-latest="pyenv-stable-list | tail -1" 164 | alias pyenv-stable-previous="pyenv-stable-list | tail -2 | head -1" 165 | EOF 166 | 167 | # Java (+ Scala, Gradle, ...) - SDKMAN 168 | sudo apt-get install -y curl sed unzip zip 169 | curl -fsSL "https://get.sdkman.io?rcupdate=false" | bash 170 | cat << 'EOF' >> ~/.bashrc 171 | 172 | # sdkman 173 | export SDKMAN_DIR="$HOME/.sdkman" 174 | [[ -s "${SDKMAN_DIR}/bin/sdkman-init.sh" ]] && source "${SDKMAN_DIR}/bin/sdkman-init.sh" 175 | export JAVA_HOME="$SDKMAN_DIR/candidates/java/current" 176 | EOF 177 | 178 | # Android 179 | sudo apt-get install -y android-sdk 180 | cat << 'EOF' >> ~/.bashrc 181 | 182 | # android 183 | export ANDROID_HOME="/usr/lib/android-sdk" 184 | export PATH="$PATH:$ANDROID_HOME/tools/bin" 185 | export PATH="$PATH:$ANDROID_HOME/platform-tools" 186 | EOF 187 | 188 | # .NET Core (SDK will automatically install the Runtime) 189 | curl -fsSL https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb 190 | sudo dpkg -i packages-microsoft-prod.deb 191 | rm packages-microsoft-prod.deb 192 | sudo apt-get update 193 | sudo apt-get install -y apt-transport-https 194 | sudo apt-get install -y dotnet-sdk-3.1 195 | 196 | # Rust 197 | curl -fsSL --tlsv1.2 --proto '=https' https://sh.rustup.rs | sh # Type '1' for normal installation 198 | cat << 'EOF' >> ~/.bashrc 199 | 200 | # rustup 201 | export PATH="$HOME/.cargo/bin:$PATH" 202 | EOF 203 | 204 | # Reload the shell 205 | exec $SHELL 206 | ``` 207 | 208 | ## Install Node + Ruby + Python + Java 209 | 210 | ```bash 211 | # Node 212 | git clone https://github.com/nodenv/nodenv-update.git "$(nodenv root)/plugins/nodenv-update" 213 | git clone https://github.com/nodenv/nodenv-package-json-engine.git "$(nodenv root)/plugins/nodenv-package-json-engine" 214 | git clone https://github.com/nodenv/nodenv-aliases.git "$(nodenv root)/plugins/nodenv-aliases" 215 | git clone https://github.com/nodenv/nodenv-each.git "$(nodenv root)/plugins/nodenv-each" 216 | git clone https://github.com/nodenv/nodenv-package-rehash.git "$(nodenv root)/plugins/nodenv-package-rehash" 217 | git clone https://github.com/nodenv/nodenv-npm-migrate.git "$(nodenv root)/plugins/nodenv-npm-migrate" 218 | nodenv install $(nodenv-stable-latest) 219 | nodenv global $(nodenv-stable-latest) 220 | nodenv rehash 221 | npm update -g 222 | nodenv rehash 223 | printf "nodenv versions:\n" && nodenv versions && printf "\nnodenv --version: $(nodenv --version)\n" && printf "node --version: $(node --version)\n" && printf "npm --version: $(npm --version)\n" 224 | 225 | # Ruby 226 | git clone https://github.com/rbenv/rbenv-each.git "$(rbenv root)/plugins/rbenv-each" 227 | git clone https://github.com/tpope/rbenv-aliases.git "$(rbenv root)/plugins/rbenv-aliases" 228 | rbenv install $(rbenv-stable-latest) 229 | rbenv global $(rbenv-stable-latest) 230 | rbenv rehash 231 | gem update --system 232 | rbenv rehash 233 | printf "rbenv versions:\n" && rbenv versions && printf "\nrbenv --version: $(rbenv --version)\n" && printf "ruby --version: $(ruby --version)\n" && printf "gem --version: $(gem --version)\n" 234 | 235 | # Python & Pip 236 | git clone https://github.com/pyenv/pyenv-pip-migrate.git "$(pyenv root)/plugins/pyenv-pip-migrate" 237 | pyenv install $(pyenv-stable-latest) 238 | pyenv global $(pyenv-stable-latest) 239 | pyenv rehash 240 | pip install --upgrade pip 241 | pyenv rehash 242 | printf "pyenv versions:\n" && pyenv versions && printf "\npyenv --version: $(pyenv --version)\n" && printf "python --version: $(python --version)\n" && printf "pip --version: $(pip --version)\n" 243 | 244 | # Java 245 | sdk install java 246 | sdk install gradle # Mostly for Android stuff 247 | printf "sdk version:" && sdk version && printf "\njava --version:\n" && java --version && printf "\ngradle --version:" && gradle --version 248 | ``` 249 | 250 | ## Other Utilities 251 | 252 | ```bash 253 | # Node - yarn 254 | curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 255 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 256 | sudo apt-get update 257 | sudo apt-get install -y --no-install-recommends yarn 258 | 259 | # Ruby gems 260 | gem install bundler 261 | 262 | # Python packages 263 | pip install bitarray pefile requests fixedint # simc/casc_extract & simc/dbc_extract 264 | pip install SLPP-23 # hero-dbc 265 | pip install setuptools # hero-rotation-generator 266 | pip install pylint # linter used by IDEs 267 | 268 | # Markdown 269 | sudo apt-get install -y pandoc texlive texlive-latex-recommended texlive-full 270 | 271 | # NCurses Disk Usage 272 | sudo apt-get install -y ncdu 273 | 274 | # AWS CLI 275 | sudo apt-get install -y unzip 276 | curl -fsSL https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o ~/awscliv2.zip 277 | unzip ~/awscliv2.zip 278 | rm ~/awscliv2.zip 279 | ~/aws/install -i $HOME/.awscli -b $HOME/.awscli/bin 280 | cat << 'EOF' >> ~/.bashrc 281 | 282 | # AWS CLI 283 | export PATH="$HOME/.awscli/bin:$PATH" 284 | EOF 285 | rm -rf ~/aws 286 | # AWS ElasticBeanstalk CLI 287 | sudo apt-get install -y build-essential zlib1g-dev libssl-dev libncurses-dev libffi-dev libsqlite3-dev libreadline-dev libbz2-dev 288 | git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git ~/aws-elastic-beanstalk-cli-setup 289 | ~/aws-elastic-beanstalk-cli-setup/scripts/bundled_installer 290 | cat << 'EOF' >> ~/.bashrc 291 | 292 | # AWS ElasticBeanstalk CLI 293 | export PATH="$HOME/.ebcli-virtual-env/executables:$PATH" 294 | EOF 295 | rm -rf ~/aws-elastic-beanstalk-cli-setup 296 | # Azure CLI 297 | curl -fsSL https://aka.ms/InstallAzureCLIDeb | sudo bash 298 | # Heroku CLI 299 | sudo apt-get install -y apt-transport-https 300 | echo "deb https://cli-assets.heroku.com/apt ./" | sudo tee /etc/apt/sources.list.d/heroku.list 301 | curl -fsSL https://cli-assets.heroku.com/apt/release.key | sudo apt-key add - 302 | sudo apt-get update 303 | sudo apt-get install -y heroku 304 | 305 | # Misc 306 | sudo apt-get install -y libpng-dev # 3rd party post-process lib (like webpack image loaders/plugins) 307 | sudo apt-get install -y graphicsmagick # Image resizing 308 | sudo apt-get install -y gpsbabel # GPSBabel (GPS utility) 309 | sudo apt-get install -y clang-format # ClangFormat (mostly for SimC) 310 | 311 | # VS Code Extension 312 | curl -fsSL https://aka.ms/vsls-linux-prereq-script -o ~/vsls-reqs && chmod +x ~/vsls-reqs && ~/vsls-reqs && rm ~/vsls-reqs # Live Share 313 | 314 | ``` 315 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | EUROPEAN UNION PUBLIC LICENCE v. 1.2 2 | EUPL © the European Union 2007, 2016 3 | 4 | This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined below) which is provided under the 5 | terms of this Licence. Any use of the Work, other than as authorised under this Licence is prohibited (to the extent such 6 | use is covered by a right of the copyright holder of the Work). 7 | The Work is provided under the terms of this Licence when the Licensor (as defined below) has placed the following 8 | notice immediately following the copyright notice for the Work: 9 | Licensed under the EUPL 10 | or has expressed by any other means his willingness to license under the EUPL. 11 | 12 | 1.Definitions 13 | In this Licence, the following terms have the following meaning: 14 | — ‘The Licence’:this Licence. 15 | — ‘The Original Work’:the work or software distributed or communicated by the Licensor under this Licence, available 16 | as Source Code and also as Executable Code as the case may be. 17 | — ‘Derivative Works’:the works or software that could be created by the Licensee, based upon the Original Work or 18 | modifications thereof. This Licence does not define the extent of modification or dependence on the Original Work 19 | required in order to classify a work as a Derivative Work; this extent is determined by copyright law applicable in 20 | the country mentioned in Article 15. 21 | — ‘The Work’:the Original Work or its Derivative Works. 22 | — ‘The Source Code’:the human-readable form of the Work which is the most convenient for people to study and 23 | modify. 24 | — ‘The Executable Code’:any code which has generally been compiled and which is meant to be interpreted by 25 | a computer as a program. 26 | — ‘The Licensor’:the natural or legal person that distributes or communicates the Work under the Licence. 27 | — ‘Contributor(s)’:any natural or legal person who modifies the Work under the Licence, or otherwise contributes to 28 | the creation of a Derivative Work. 29 | — ‘The Licensee’ or ‘You’:any natural or legal person who makes any usage of the Work under the terms of the 30 | Licence. 31 | — ‘Distribution’ or ‘Communication’:any act of selling, giving, lending, renting, distributing, communicating, 32 | transmitting, or otherwise making available, online or offline, copies of the Work or providing access to its essential 33 | functionalities at the disposal of any other natural or legal person. 34 | 35 | 2.Scope of the rights granted by the Licence 36 | The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, sublicensable licence to do the following, for 37 | the duration of copyright vested in the Original Work: 38 | — use the Work in any circumstance and for all usage, 39 | — reproduce the Work, 40 | — modify the Work, and make Derivative Works based upon the Work, 41 | — communicate to the public, including the right to make available or display the Work or copies thereof to the public 42 | and perform publicly, as the case may be, the Work, 43 | — distribute the Work or copies thereof, 44 | — lend and rent the Work or copies thereof, 45 | — sublicense rights in the Work or copies thereof. 46 | Those rights can be exercised on any media, supports and formats, whether now known or later invented, as far as the 47 | applicable law permits so. 48 | In the countries where moral rights apply, the Licensor waives his right to exercise his moral right to the extent allowed 49 | by law in order to make effective the licence of the economic rights here above listed. 50 | The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to any patents held by the Licensor, to the 51 | extent necessary to make use of the rights granted on the Work under this Licence. 52 | 53 | 3.Communication of the Source Code 54 | The Licensor may provide the Work either in its Source Code form, or as Executable Code. If the Work is provided as 55 | Executable Code, the Licensor provides in addition a machine-readable copy of the Source Code of the Work along with 56 | each copy of the Work that the Licensor distributes or indicates, in a notice following the copyright notice attached to 57 | the Work, a repository where the Source Code is easily and freely accessible for as long as the Licensor continues to 58 | distribute or communicate the Work. 59 | 60 | 4.Limitations on copyright 61 | Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception or limitation to the 62 | exclusive rights of the rights owners in the Work, of the exhaustion of those rights or of other applicable limitations 63 | thereto. 64 | 65 | 5.Obligations of the Licensee 66 | The grant of the rights mentioned above is subject to some restrictions and obligations imposed on the Licensee. Those 67 | obligations are the following: 68 | 69 | Attribution right: The Licensee shall keep intact all copyright, patent or trademarks notices and all notices that refer to 70 | the Licence and to the disclaimer of warranties. The Licensee must include a copy of such notices and a copy of the 71 | Licence with every copy of the Work he/she distributes or communicates. The Licensee must cause any Derivative Work 72 | to carry prominent notices stating that the Work has been modified and the date of modification. 73 | 74 | Copyleft clause: If the Licensee distributes or communicates copies of the Original Works or Derivative Works, this 75 | Distribution or Communication will be done under the terms of this Licence or of a later version of this Licence unless 76 | the Original Work is expressly distributed only under this version of the Licence — for example by communicating 77 | ‘EUPL v. 1.2 only’. The Licensee (becoming Licensor) cannot offer or impose any additional terms or conditions on the 78 | Work or Derivative Work that alter or restrict the terms of the Licence. 79 | 80 | Compatibility clause: If the Licensee Distributes or Communicates Derivative Works or copies thereof based upon both 81 | the Work and another work licensed under a Compatible Licence, this Distribution or Communication can be done 82 | under the terms of this Compatible Licence. For the sake of this clause, ‘Compatible Licence’ refers to the licences listed 83 | in the appendix attached to this Licence. Should the Licensee's obligations under the Compatible Licence conflict with 84 | his/her obligations under this Licence, the obligations of the Compatible Licence shall prevail. 85 | 86 | Provision of Source Code: When distributing or communicating copies of the Work, the Licensee will provide 87 | a machine-readable copy of the Source Code or indicate a repository where this Source will be easily and freely available 88 | for as long as the Licensee continues to distribute or communicate the Work. 89 | Legal Protection: This Licence does not grant permission to use the trade names, trademarks, service marks, or names 90 | of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and 91 | reproducing the content of the copyright notice. 92 | 93 | 6.Chain of Authorship 94 | The original Licensor warrants that the copyright in the Original Work granted hereunder is owned by him/her or 95 | licensed to him/her and that he/she has the power and authority to grant the Licence. 96 | Each Contributor warrants that the copyright in the modifications he/she brings to the Work are owned by him/her or 97 | licensed to him/her and that he/she has the power and authority to grant the Licence. 98 | Each time You accept the Licence, the original Licensor and subsequent Contributors grant You a licence to their contributions 99 | to the Work, under the terms of this Licence. 100 | 101 | 7.Disclaimer of Warranty 102 | The Work is a work in progress, which is continuously improved by numerous Contributors. It is not a finished work 103 | and may therefore contain defects or ‘bugs’ inherent to this type of development. 104 | For the above reason, the Work is provided under the Licence on an ‘as is’ basis and without warranties of any kind 105 | concerning the Work, including without limitation merchantability, fitness for a particular purpose, absence of defects or 106 | errors, accuracy, non-infringement of intellectual property rights other than copyright as stated in Article 6 of this 107 | Licence. 108 | This disclaimer of warranty is an essential part of the Licence and a condition for the grant of any rights to the Work. 109 | 110 | 8.Disclaimer of Liability 111 | Except in the cases of wilful misconduct or damages directly caused to natural persons, the Licensor will in no event be 112 | liable for any direct or indirect, material or moral, damages of any kind, arising out of the Licence or of the use of the 113 | Work, including without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, loss 114 | of data or any commercial damage, even if the Licensor has been advised of the possibility of such damage. However, 115 | the Licensor will be liable under statutory product liability laws as far such laws apply to the Work. 116 | 117 | 9.Additional agreements 118 | While distributing the Work, You may choose to conclude an additional agreement, defining obligations or services 119 | consistent with this Licence. However, if accepting obligations, You may act only on your own behalf and on your sole 120 | responsibility, not on behalf of the original Licensor or any other Contributor, and only if You agree to indemnify, 121 | defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against such Contributor by 122 | the fact You have accepted any warranty or additional liability. 123 | 124 | 10.Acceptance of the Licence 125 | The provisions of this Licence can be accepted by clicking on an icon ‘I agree’ placed under the bottom of a window 126 | displaying the text of this Licence or by affirming consent in any other similar way, in accordance with the rules of 127 | applicable law. Clicking on that icon indicates your clear and irrevocable acceptance of this Licence and all of its terms 128 | and conditions. 129 | Similarly, you irrevocably accept this Licence and all of its terms and conditions by exercising any rights granted to You 130 | by Article 2 of this Licence, such as the use of the Work, the creation by You of a Derivative Work or the Distribution 131 | or Communication by You of the Work or copies thereof. 132 | 133 | 11.Information to the public 134 | In case of any Distribution or Communication of the Work by means of electronic communication by You (for example, 135 | by offering to download the Work from a remote location) the distribution channel or media (for example, a website) 136 | must at least provide to the public the information requested by the applicable law regarding the Licensor, the Licence 137 | and the way it may be accessible, concluded, stored and reproduced by the Licensee. 138 | 139 | 12.Termination of the Licence 140 | The Licence and the rights granted hereunder will terminate automatically upon any breach by the Licensee of the terms 141 | of the Licence. 142 | Such a termination will not terminate the licences of any person who has received the Work from the Licensee under 143 | the Licence, provided such persons remain in full compliance with the Licence. 144 | 145 | 13.Miscellaneous 146 | Without prejudice of Article 9 above, the Licence represents the complete agreement between the Parties as to the 147 | Work. 148 | If any provision of the Licence is invalid or unenforceable under applicable law, this will not affect the validity or 149 | enforceability of the Licence as a whole. Such provision will be construed or reformed so as necessary to make it valid 150 | and enforceable. 151 | The European Commission may publish other linguistic versions or new versions of this Licence or updated versions of 152 | the Appendix, so far this is required and reasonable, without reducing the scope of the rights granted by the Licence. 153 | New versions of the Licence will be published with a unique version number. 154 | All linguistic versions of this Licence, approved by the European Commission, have identical value. Parties can take 155 | advantage of the linguistic version of their choice. 156 | 157 | 14.Jurisdiction 158 | Without prejudice to specific agreement between parties, 159 | — any litigation resulting from the interpretation of this License, arising between the European Union institutions, 160 | bodies, offices or agencies, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court of Justice 161 | of the European Union, as laid down in article 272 of the Treaty on the Functioning of the European Union, 162 | — any litigation arising between other parties and resulting from the interpretation of this License, will be subject to 163 | the exclusive jurisdiction of the competent court where the Licensor resides or conducts its primary business. 164 | 165 | 15.Applicable Law 166 | Without prejudice to specific agreement between parties, 167 | — this Licence shall be governed by the law of the European Union Member State where the Licensor has his seat, 168 | resides or has his registered office, 169 | — this licence shall be governed by Belgian law if the Licensor has no seat, residence or registered office inside 170 | a European Union Member State. 171 | 172 | 173 | Appendix 174 | 175 | ‘Compatible Licences’ according to Article 5 EUPL are: 176 | — GNU General Public License (GPL) v. 2, v. 3 177 | — GNU Affero General Public License (AGPL) v. 3 178 | — Open Software License (OSL) v. 2.1, v. 3.0 179 | — Eclipse Public License (EPL) v. 1.0 180 | — CeCILL v. 2.0, v. 2.1 181 | — Mozilla Public Licence (MPL) v. 2 182 | — GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3 183 | — Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for works other than software 184 | — European Union Public Licence (EUPL) v. 1.1, v. 1.2 185 | — Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong Reciprocity (LiLiQ-R+). 186 | 187 | The European Commission may update this Appendix to later versions of the above licences without producing 188 | a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the 189 | covered Source Code from exclusive appropriation. 190 | All other changes or additions to this Appendix require the production of a new EUPL version. 191 | -------------------------------------------------------------------------------- /setup/macos-defaults.md: -------------------------------------------------------------------------------- 1 | # Setup: macOS defaults 2 | 3 | ## Credits 4 | 5 | - 6 | - 7 | 8 | It's possible that some of them needs to be done manually (there are some `TODO` remaining).\ 9 | Once it'll be a bit more complete, I'll probably make an unattended script. 10 | 11 | ## General 12 | 13 | ```bash 14 | # Appearance: "Blue" For Buttons, Menus, and Windows 15 | defaults write NSGlobalDomain AppleAquaColorVariant -int 1 16 | 17 | # "enable" Use dark menu bar and Dock 18 | defaults write NSGlobalDomain AppleInterfaceStyle -string 'Dark' 19 | 20 | # "disable" Automatically hide and show the menu bar 21 | defaults write NSGlobalDomain _HIHideMenuBar -bool false 22 | 23 | # Highlight color: "Blue" 24 | defaults write NSGlobalDomain AppleHighlightColor -string '0.780400 0.815700 0.858800' 25 | 26 | # Sidebar icon size: "Medium" 27 | defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2 28 | 29 | # Show scroll bars: "Always" 30 | defaults write NSGlobalDomain AppleShowScrollBars -string Always 31 | 32 | # Click in the scroll bar to "Jump to the spot that's clicked" 33 | defaults write NSGlobalDomain AppleScrollerPagingBehavior -int 1 34 | 35 | # "disable" Ask to keep changes when closing documents 36 | defaults write NSGlobalDomain NSCloseAlwaysConfirmsChanges -bool false 37 | 38 | # "enable" Close windows when quitting an app 39 | defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false 40 | 41 | # "enable" Use LCD font smoothing when available 42 | # TODO 43 | ``` 44 | 45 | ## Desktop & Screen Saver 46 | 47 | ```bash 48 | # Start after: "Never" 49 | defaults -currentHost write com.apple.screensaver idleTime -int 0 50 | ``` 51 | 52 | ## Dock 53 | 54 | ```bash 55 | # Icon "size" 56 | defaults write com.apple.dock tilesize -int 45 57 | 58 | # "enable" Magnification 59 | defaults write com.apple.dock magnification -bool true 60 | 61 | # Magnification "size" 62 | defaults write com.apple.dock largesize -int 60 63 | 64 | # Position on screen: "Bottom" 65 | defaults write com.apple.dock orientation -string 'bottom' 66 | 67 | # Minimize windows using: "Genie effect" 68 | defaults write com.apple.dock mineffect -string 'genie' 69 | 70 | # Prefer tabs when opening documents: "Manually" 71 | defaults write NSGlobalDomain AppleWindowTabbingMode -string 'manual' 72 | 73 | # "enable" Double-click a window's title bar to "minimize" 74 | defaults write NSGlobalDomain AppleActionOnDoubleClick -string 'Minimize' 75 | 76 | # "enable" Minimize windows into application icon 77 | defaults write com.apple.dock minimize-to-application -bool true 78 | 79 | # "enable" Animate opening applications 80 | defaults write com.apple.dock launchanim -bool true 81 | 82 | # "enable" Automatically hide and show the Dock 83 | defaults write com.apple.dock autohide -bool true 84 | 85 | # "enable" Show indicators for open applications 86 | defaults write com.apple.dock show-process-indicators -bool true 87 | 88 | # Remove the auto show/hide trigger delay 89 | defaults write com.apple.dock autohide-delay -float 0 90 | 91 | # Reduce the auto show/hide animation duration 92 | defaults write com.apple.dock autohide-time-modifier -float 0.3 93 | ``` 94 | 95 | ## Mission Control 96 | 97 | ```bash 98 | # "disable" Automatically rearrange Spaces based on most recent use 99 | defaults write com.apple.dock mru-spaces -bool false 100 | 101 | # "enable" When switching to an application, switch to a Space with open windows for the application 102 | defaults write NSGlobalDomain AppleSpacesSwitchOnActivate -bool true 103 | 104 | # "disable" Group windows by application 105 | defaults write com.apple.dock expose-group-by-app -bool false 106 | 107 | # "enable" Displays have seperate Spaces 108 | defaults write com.apple.spaces spans-displays -bool true 109 | 110 | # Dashboard: "Off" 111 | defaults write com.apple.dashboard dashboard-enabled-state -int 1 112 | 113 | ## Hot Corners... 114 | # Top left: "Mission Control" 115 | defaults write com.apple.dock wvous-tl-corner -int 2 116 | defaults write com.apple.dock wvous-tl-modifier -int 0 117 | # Top right: "Launchpad" 118 | defaults write com.apple.dock wvous-tr-corner -int 11 119 | defaults write com.apple.dock wvous-tr-modifier -int 0 120 | # Bottom left: "Launchpad" 121 | defaults write com.apple.dock wvous-bl-corner -int 11 122 | defaults write com.apple.dock wvous-bl-modifier -int 0 123 | # Bottom right: "Desktop" 124 | defaults write com.apple.dock wvous-br-corner -int 4 125 | defaults write com.apple.dock wvous-br-modifier -int 0 126 | # Why two times "Launchpad" ? It's because of dual monitor setup, to have 3 hot corners on each 127 | # it is needed to put them in an asymetric way (the right one being a little bit upper, with the 128 | # left one being the principal one). 129 | ``` 130 | 131 | ## Security & Privacy 132 | 133 | ```bash 134 | # Disable the “Are you sure you want to open this application?” dialog 135 | defaults write com.apple.LaunchServices LSQuarantine -bool false 136 | ``` 137 | 138 | ## Display 139 | 140 | ```bash 141 | # "enable" Show mirroring options in the menu bar when available 142 | defaults write com.apple.airplay showInMenuBarIfPresent -bool true 143 | 144 | # Subpixel font rendering on non-Apple LCDs 145 | # 0 : Disabled | 1 : Minimal | 2 : Medium | 3 : Smoother | 4 : Strong 146 | defaults write NSGlobalDomain AppleFontSmoothing -int 1 147 | 148 | ## Night Shift 149 | # See: https://www.reddit.com/r/osx/comments/6334ac/toggling_night_shift_from_script/ 150 | # sudo defaults read com.apple.CoreBrightness 151 | 152 | # Schedule: "Custom" 153 | # TODO 154 | 155 | # From: "22:00" to: "07:30" 156 | # TODO 157 | 158 | # Color Temperature: 2700 (More Warm) 159 | # TODO 160 | ``` 161 | 162 | ## Energy Saver 163 | 164 | ```bash 165 | # Turn display off after: "300" (5 minutes) 166 | # TODO 167 | 168 | # "enable" Prevent computer from sleeping automatically when the display is off 169 | # TODO 170 | 171 | # "disable" Put hard disks to sleep when possible 172 | # TODO 173 | 174 | # "disable" Wake for Ethernet network access 175 | # TODO 176 | 177 | # "disable" Start up automatically after a power failure 178 | # TODO 179 | 180 | # "disable" Enable Power Nap 181 | # TODO 182 | ``` 183 | 184 | ## Keyboard 185 | 186 | ```bash 187 | # Key Repeat "speed" 188 | defaults write NSGlobalDomain KeyRepeat -int 3 189 | 190 | # "delay" Until Repeat 191 | defaults write NSGlobalDomain InitialKeyRepeat -int 10 192 | 193 | # "enable" Adjust keyboard brightness in low light 194 | # TODO 195 | 196 | # "enable" Turn keyboard backlight off after "10 secs" of inactivity 197 | # TODO 198 | 199 | # "disable" Show keyboard and emoji viewers in menu bar 200 | # TODO 201 | 202 | # "disable" Use F1, F2, etc. keys as standard function keys 203 | defaults write NSGlobalDomain com.apple.keyboard.fnState -bool false 204 | 205 | # "disable" Correct spelling automatically 206 | defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false 207 | 208 | # "disable" Capitalize words automatically 209 | defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false 210 | 211 | # "disable" Add period with double-space 212 | defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false 213 | 214 | # "disable" Use smart quotes and dashes 215 | defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false 216 | defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false 217 | 218 | # Shortcuts 219 | # Launchpad & Dock: 220 | # Uncheck: "Turn Dock Hiding On/Off" 221 | # Check: "Show Launchpad" (CTRL + DOWN arrow) 222 | # Display: 223 | # Uncheck: Everything 224 | # Mission Control: 225 | # Uncheck: "Application windows", "Show Dashboard" 226 | # Check: "Show Notification Center" (F12) 227 | # Keyboard: 228 | # Uncheck: Everything 229 | 230 | # Full Keyboard Access: In windows and dialogs, press Tab to move keyboard focus between: 231 | # "All controls" 232 | defaults write NSGlobalDomain AppleKeyboardUIMode -int 2 233 | 234 | # "enable" Show input menu in menu bar 235 | # TODO 236 | 237 | # Disable Press-And-Hold for keys 238 | defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false 239 | ``` 240 | 241 | ## Mouse 242 | 243 | ```bash 244 | # "enable" Scroll direction: Natural 245 | # TODO 246 | 247 | # Primary mouse buton: "Left" 248 | # TODO 249 | ``` 250 | 251 | ## Trackpad 252 | 253 | ```bash 254 | # TODO 255 | 256 | # "enable" Scroll direction: Natural 257 | # TODO 258 | ``` 259 | 260 | ## Sound 261 | 262 | ```bash 263 | # "enable" Play user interface sound effects 264 | defaults write com.apple.systemsound com.apple.sound.uiaudio.enabled -bool true 265 | 266 | # "disable" Play feedback when volume is changed 267 | defaults write NSGlobalDomain com.apple.sound.beep.feedback -bool false 268 | 269 | # Show volume in the menu bar 270 | # TODO Fix 271 | defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.volume" -int 0 272 | ``` 273 | 274 | ## iCloud 275 | 276 | ```bash 277 | # Save to disk (not to iCloud) by default 278 | defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false 279 | ``` 280 | 281 | ## App Store 282 | 283 | ```bash 284 | # Do not complain about admin password for the next 5 minutes 285 | sudo -v 286 | ``` 287 | 288 | ```bash 289 | # "enable" Automatically check for updates 290 | sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true 291 | 292 | # "enable" Download newly available updates in the background 293 | sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true 294 | 295 | # "disable" Install app updates 296 | sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool true 297 | 298 | # "disable" Install macOS updates 299 | sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool true 300 | 301 | # "disable" Install system ddata files and security updates 302 | sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true 303 | sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true 304 | 305 | # Check for software updates daily, not just once per week 306 | defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 307 | ``` 308 | 309 | ## Siri 310 | 311 | ```bash 312 | # "disable" Enable Ask Siri 313 | defaults write com.apple.assistant.support "Assistant Enabled" -bool false 314 | 315 | # "disable" Show Siri in menu bar 316 | defaults write com.apple.Siri StatusMenuVisible -bool false 317 | ``` 318 | 319 | ## Accessibility 320 | 321 | ```bash 322 | # "disable" Enable Slow Keys 323 | defaults write com.apple.universalaccess slowKey -bool false 324 | ``` 325 | 326 | ## Finder 327 | 328 | ```bash 329 | # Show these items on the desktop: "Hard disks", "External disks", "CDs, DVDs, and iPods", "Connected servers" 330 | defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true 331 | defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true 332 | defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true 333 | defaults write com.apple.finder ShowMountedServersOnDesktop -bool true 334 | 335 | # New Finder windows show: "Home folder" 336 | defaults write com.apple.finder NewWindowTarget -string 'PfHm' 337 | defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/" 338 | 339 | # "disable" Open folders in tabs instead of new windows 340 | defaults write com.apple.finder FinderSpawnTab -bool false 341 | 342 | # "enable" only: 343 | # Recents 344 | # Applications 345 | # Desktop 346 | # Documents 347 | # Downloads 348 | # Home 349 | # 350 | # Back to My Mac 351 | # Connected servers 352 | # Bonjour computers 353 | # 354 | # This PC 355 | # Hard disks 356 | # External disks 357 | # CDs, DVDs, and iPods 358 | # "disable" Sidebar: Recent Tags 359 | defaults write com.apple.finder ShowRecentTags -bool false 360 | 361 | # "enable" Show all filename extensions 362 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true 363 | 364 | # "disable" Show warning before changing an extension 365 | defaults write com.apple.finder FXEnableExtensionsChangeWarning -bool false 366 | 367 | # "disable" Show warning before removing from iCloud Drive 368 | defaults write com.apple.finder FXEnableRemoveFromICloudDriveWarning -bool false 369 | 370 | # "disable" Show warning before emptying the Trash 371 | defaults write com.apple.finder WarnOnEmptyTrash -bool false 372 | 373 | # "disable" Remove items from the Trash after 30 days 374 | defaults write com.apple.finder FXRemoveOldTrashItems -bool false 375 | 376 | # "enable" Keep folders on top when sorting by name 377 | defaults write com.apple.finder _FXSortFoldersFirst -bool true 378 | 379 | # When performing a search: "Search the Current Folder" 380 | defaults write com.apple.finder FXDefaultSearchScope -string 'SCcf' 381 | 382 | # "enable" Path Bar 383 | defaults write com.apple.finder ShowPathbar -bool true 384 | 385 | # "enable" Status Bar 386 | defaults write com.apple.finder ShowStatusBar -bool true 387 | 388 | # Show hidden files by default 389 | defaults write com.apple.finder AppleShowAllFiles -bool true 390 | 391 | # Default view style (List View) 392 | defaults write com.apple.Finder FXPreferredViewStyle -string 'Nlsv' 393 | 394 | # "disable" Writing of .DS_Store files on network or USB volumes 395 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 396 | defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true 397 | 398 | # Show absolute path in Finder's title bar. 399 | defaults write com.apple.finder _FXShowPosixPathInTitle -bool true 400 | 401 | # Expand save panel by default. 402 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 403 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true 404 | 405 | # Expand print panel by default. 406 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true 407 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true 408 | 409 | # Automatically quit printer app once the print jobs complete 410 | defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true 411 | ``` 412 | 413 | ## Safari 414 | 415 | ```bash 416 | # Safari opens with: "All windows from last sessions" 417 | defaults write com.apple.Safari AlwaysRestoreSessionAtLaunch -bool true 418 | 419 | # New windows open with: "Homepage" 420 | defaults write com.apple.Safari NewWindowBehavior -int 0 421 | 422 | # New tabs open with: "Homepage" 423 | defaults write com.apple.Safari NewTabBehavior -int 0 424 | 425 | # Set home page to "https://www.google.com/" 426 | # Not easy, do it manually 427 | 428 | # Remove history items: "Manually" 429 | defaults write com.apple.Safari HistoryAgeInDaysLimit -int 365000 430 | 431 | # Favorites shows: "Favorites" 432 | # Not easy, do it manually 433 | 434 | # Top Sites shows: "12 sites" 435 | defaults write com.apple.Safari TopSitesGridArrangement -int 1 436 | 437 | # File download location: "Downloads" 438 | # Not easy, do it manually 439 | 440 | # Remove downloads list items: "Manually" 441 | defaults write com.apple.Safari DownloadsClearingPolicy -int 0 442 | 443 | # "disable" Open "safe" files after downloading 444 | defaults write com.apple.Safari AutoOpenSafeDownloads -bool false 445 | 446 | # Open pages in tabs instead of windows: "Automatically" 447 | defaults write com.apple.Safari TabCreationPolicy -int 1 448 | 449 | # "enable" Command-click opens a link in a new tab 450 | # TODO 451 | 452 | # "disable" When a new tab or window opens, make it active 453 | # TODO 454 | 455 | # "enable" Use command-1 through command-9 to switch tabs 456 | # TODO 457 | 458 | # AutoFill web forms: None 459 | defaults write com.apple.Safari AutoFillFromAddressBook -bool false 460 | defaults write com.apple.Safari AutoFillPasswords -bool false 461 | defaults write com.apple.Safari AutoFillCreditCardData -bool false 462 | defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false 463 | 464 | # Search engine: "Google" 465 | # Not easy, do it manually 466 | 467 | # "disable" Include search engine suggestions 468 | defaults write com.apple.Safari SuppressSearchSuggestions -bool true 469 | 470 | # "disable" Include Safari Suggestions 471 | defaults write com.apple.Safari UniversalSearchEnabled -bool false 472 | 473 | # "disable" Enable Quick Website Search 474 | defaults write com.apple.Safari WebsiteSpecificSearchEnabled -bool false 475 | 476 | # "disable" Preload Top Hit in the background 477 | defaults write com.apple.Safari PreloadTopHit -bool false 478 | 479 | # "enable" Show Favorites 480 | # Not easy, do it manually 481 | 482 | # "disable" Warn when visiting a fraudulent website 483 | defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool false 484 | 485 | # "enable" Enable JavaScript 486 | defaults write com.apple.Safari WebKitJavaScriptEnabled -bool true 487 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptEnabled -bool true 488 | 489 | # "enable" Block pop-up windows 490 | defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false 491 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false 492 | 493 | # "enable" Prevent cross-site tracking && "disable" Block all cookies 494 | defaults write com.apple.Safari BlockStoragePolicy -int 2 495 | defaults write com.apple.Safari WebKitStorageBlockingPolicy -int 1 496 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2StorageBlockingPolicy -int 1 497 | 498 | # "enable" Ask websites not to track me 499 | defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true 500 | 501 | # "enable" Show full website address 502 | defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true 503 | 504 | # "disable" Press Tab to highlight each item on a webpage 505 | defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool false 506 | 507 | # "disable" Save articles for offline reading automatically 508 | defaults write com.apple.Safari ReadingListSaveArticlesOfflineAutomatically -bool false 509 | 510 | # "enable" Stop plug-ins to save power 511 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PlugInSnapshottingEnabled -bool true 512 | 513 | # Default encoding: "Unicode (UTF-8)" 514 | defaults write com.apple.Safari WebKitDefaultTextEncodingName -string 'utf-8' 515 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DefaultTextEncodingName -string 'utf-8' 516 | 517 | # "enable" Show Develop menu in menu bar 518 | defaults write com.apple.Safari IncludeDevelopMenu -bool true 519 | defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true 520 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true 521 | ``` 522 | 523 | ## Extras 524 | 525 | ```bash 526 | # Terminal: "Pro" theme as default 527 | defaults write com.apple.terminal "Default Window Settings" -string 'Pro' 528 | defaults write com.apple.terminal "Startup Window Settings" -string 'Pro' 529 | 530 | # Terminal: "Pro" theme Window Size: Columns = 155 | Rows = 35 531 | # TODO 532 | 533 | # Terminal: Only use UTF-8 534 | defaults write com.apple.terminal StringEncodings -array 4 535 | 536 | # iTunes: Don't automatically sync connected devices 537 | defaults write com.apple.itunes dontAutomaticallySyncIPods -bool true 538 | 539 | # Disk Utility: Show All Devices 540 | defaults write com.apple.DiskUtility SidebarShowAllDevices -bool true 541 | 542 | # Time Machine: Prevent from prompting to use new hard drives as backup volume 543 | defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true 544 | ``` 545 | 546 | ## Misc 547 | 548 | Should be applied manually -one by one- if needed 549 | 550 | ```bash 551 | # Increase mouse speed beyond the max (GUI max is 3.0), useful mostly for Magic Mouse 552 | defaults write -g com.apple.mouse.scaling -float 5.0 553 | 554 | # Disable automatic termination of inactive apps 555 | defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true 556 | ``` 557 | 558 | Do not forget to manually review **Security & Privacy**, **Displays**, **Inputs (Keyboard/Mouse/Trackpad)**, **Sharing** and **Users & Groups** then `reboot`. 559 | --------------------------------------------------------------------------------