Make sure all run in admin powershell
Install chocolatey from chocolatey.org.
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))install all other software using chocolatey
choco install `
postman `
free-download-manager `
psutils `
wezterm `
rclone `
vcxsrv `
filezilla dbeaver 7zip `
advanced-ip-scanner wireshark `
libreoffice notepadplusplus `
paint.net inkscape `
vlc `
git `
flameshot `
powertoys `
cpu-z hwmonitor wiztree `
-ysudo keyword is available after installing psutils, which is included in the above install command.
Users can now install using chocolatey without admin enabled powershell as shown below.
sudo choco install <software_name>Some application not available in chocolatey, we can use scoop instead.
Install command
iwr -useb get.scoop.sh | iex
scoop bucket add extraswsl --install- start wsl
- copy file from
wsl/wsl.confto/etc/wsl.conf - shutdown wsl to allow it to reload config.
wsl --shutdownsudo ln -sT /mnt/c/Windows/explorer.exe /usr/bin/explorer
sudo ln -sT /mnt/c/Windows/System32/wsl.exe /usr/bin/wsl
sudo ln -sT /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe /usr/bin/powershell
sudo ln -sT /mnt/c/Windows/System32/clip.exe /usr/bin/clipAdd following to bash_alias.
alias pwsh='powershell -Command'This allow for executing powershell cmd such as chocolatey install
pwsh sudo choco install ...
pwsh Get-VM
pwsh "iwr -useb get.scoop.sh | iex" # pipe need to be in quote sudo apt install build-essential- copy this into
~/.bashrc.
export LS_COLORS="$(echo $LS_COLORS)ow=01;34:"sudo apt install wsluHyper-V is not turn on by default. Enable it:
- Search and start "Turn Window features on or off"
- Tick Hyper-V option.
- !make sure do not use dynamic or expanding hard disk. it will keep growing without shrinking.
- To successfully shrink the disk, we need to zeroout all deleted items. on linux run.
sudo fstrim -v /- Alternatively if still not working, create large file of zeros then delete them.
sudo dd if=/dev/zero of=/tmp/zero.file bs=1M # stop when you run out of space. this does not take host disk space.
sudo rm /tmp/zero.file- Shrink the vhdx using following powershell cmdlet.
Optimize-VHD -Path c:\test\dynamic.vhdx -Mode Full- do not use
Resize-VHD, this will corrupt your partition table.- to recover incase you corrupt it, do following.
- boot using live gparted image.
- open terminal and use
testdisk. - properly select the partition type and try write the partition back.
- double check the
/etc/fstabfor partition uuid. (get partion uuid using gparted). (by right no change)
- to recover incase you corrupt it, do following.
Configure new virtual switch (default switch need to use dhcp for internet and external network)
- Open Hyper-V Manager after reboot.
- Add new virtual switch (Internal) and named is as "192.168.5.1"
- Search and start "View network connections".
- Configure new vEthernet(192.168.5.1) with static ip of 192.168.5.1.
When adding new virtual machine
- Suffix it name with default ip such as 192.168.5.2
- Add new network adapter and connect to "192.168.5.1" switch.
- Start virtual machine and configure the adapter to be the assigned ip.
- Note: if app delay start when pressing shortcut, open menu and search for background apps. Then disable all except used one.
Clone dotfiles repo at https://github.com/farhanmustar/dotfiles.git.
git clone https://github.com/farhanmustar/dotfiles.gitTo remap caps_lock key to esc key and scroll_lock key to caps_lock key.
- Double click
keyboard_remap/remap_caps_lock_to_escape_scroll_lock_to_caps_lock.regand accept importing the register
To restore back the keyboard layout maping to default value
- Double click
keyboard_remap/default_keyboard_remap.regand accept importing the register
install extension
- vimmium c
- configure search to accept js regex
- dark reader
- configure dark reader shortcut to ctrl+shift+d
- js error notify
- free download manager for chrome
scoop install komorebi
scoop install autohotkey- Set environment variable
KOMOREBI_CONFIG_HOMEto~/.config/komorebi(in full windows path) - Copy autohotkey script from
.config/komorebiintoKOMOREBI_CONFIG_HOMEpath. - Create link to following bash script and set
Ctrl + Alt + sto execute it.
komorebic.exe startchoco install gimp -yor gimp with photoshop-like plugin.
choco install photogimp -ychoco install googlechrome -ychoco install virtualbox -y --params "/ExtensionPack"Need to use pip to install only. Refer to python section to install pip.
pip install platformio
Download easyeda manually, for now no package on chocolatey.
choco install kicad -yBuild in board should be enough, But if required can try to search at snapeda.com. Maybe add other library:- SparkFun Digi-Key
choco install freecad -ychoco install origin steam epicgameslauncher ds4windows -yCurrently not working, need to install manually. Miktex have mpm as its package manager can explore that.
choco install miktex --params '"/Set:essential"' -ychoco install obs-studio -ychoco install screentogif -ychoco install audacity -ychoco install kdenlive -ychoco install keycastow -ychoco install crystaldiskmark crystaldiskinfo -ywinget install anyburn rufuswinget install tigervncon ubuntu to run vnc server do this
sudo apt install x11vnc
sudo -u guiuser bash -c "x11vnc -forever -nopw -display :0"
# default port 5900- Using tinyproxy installed on ubuntu (wsl)
sudo apt install tinyproxy- Tinyproxy default to use port 8888 and listend to all interface so no need to configure.
- Wsl does not have systemd so we manually run tinyproxy.
sudo tinyproxy -d- Port forward the port 8888 to remote server using
-R 8888:localhost:8888 - On the remote server we have to configure env variable to use the proxy.
export http_proxy="http://localhost:8888/"
export ftp_proxy="http://localhost:8888/"- For
apt, it will not use proxy set by env. Instead add the following config. - edit
/etc/apt/apt.conf.d/99proxy.conf
Acquire::http::Proxy "http://localhost:8888";
Acquire::https::Proxy "http://localhost:8888";Powershell got its own build in module manager. Need to explore, as for now the package available is very limited.
https://www.powershellgallery.com/packages
Windows package manager.
https://docs.microsoft.com/en-gb/windows/package-manager/
Note that are not relevant anymore.
Change Powershell tab completion behaviour and set ls alias to get-childitemcolorformatwide
copy ./PowerShell/profile.ps1 to ~/Documents/PowerShell/profile.ps1
set script execution policy to remotesigned
Set-ExecutionPolicy remotesignedcopy content of ./scripts to /ProgramData/Chocolatey/bin
install all other software using chocolatey
choco install `
psutils get-childitemcolor `
powershell-core `
microsoft-windows-terminal `
neovim universal-ctags git rclone `
ripgrep grep less which wget rsync watchexec fd tac findutils `
putty.install vcxsrv `
--install-arguments='"ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1"' `
--params "/NoGuiHereIntegration /NoShellHereIntegration" `
--ignore-checksums -yFor now there is no watch replacement in windows.
watchexec is almost similar to watch, but only execute command if got file change.
Exemple: execute node index.js if file change in current directory.
watchexec -- node .\index.js
TIPS: for nodejs use console.clear() inside index.js to clear console log before print new stuff.
To ensure consistent configuration path with linux,
- set XDG_CONFIG_HOME to
C:\Users\<username>\.configin user env variable.
To use Nightly NeoVim.
choco update neovim --pre- On server, install xclip. For example, in ubuntu:
apt install xclip- Run the
vcxsrvon host machine. - Set
DISPLAYenvironment variable tolocalhost:10.0
export DISPLAY=localhost:10.0- Test xserver forwarding working by using
xclock
xclockConfigure putty shortcut to be ctrl + alt + r
Configure windows terminal shortcut to be ctrl + alt + t
- open run window + r
- run this
shell:AppsFolder - create shortcut for windows terminal at
C:\ProgramData\Microsoft\Windows\Start Menu\Programs - right click properties and add keyboard shortcut.
putty use register to store settings. Double click on ./putty/putty.reg then accept importing the register.
configure shortcut for pagent to pass private key,
just add path of the key in quote after the pagent url.
configure Xlaunch. then save the config to document folder. (xserver.xlaunch)
Clone dotfiles repo at https://github.com/farhanmustar/dotfiles.git.
Run vim and run :PlugInstall to install all plugins.
git clone https://github.com/farhanmustar/dotfiles.git
copy paste settings from ./windows-terminal/settings.json to terminal settings.
choco install openssl openssl-wizard -ychoco install androidstudio -yAdd set ANDROID_HOME path to the sdk path.
Add set JAVA_HOME path to C:\Program Files\Android\Android Studio\jre
Add C:\Program Files\Android\Android Studio\jre\bin to Path env variable.
Add sdk/tools, sdk/tools/bin and sdk/platform-tools to Path env variable.
choco install nodejs -ybasic tools used to build pkg manually.
sudo npm install -g windows-build-toolschoco install python2 -yRemove python alias. windows did that to auto start windows store when use python keyword.why!!!
- Go to start menu and search
manage app execution aliases - Disable alias for python and python 3.
choco install composer -ychoco install arduino arduino-cli -yInstall wsl-ssh-pageant to allow use of pageant as ssh auth. (required scoop package manager)
scoop install wsl-ssh-pageant
copy ssh-pageant.bat script and added to path.
copy script from ./scripts/ssh-pageant.bat to /ProgramData/Chocolatey/bin
set env variable SSH_AUTH_SOCK to ssh-pageant.
SSH_AUTH_SOCK=\\.\pipe\ssh-pageant
How to use.
- start Pageant.
- run
ssh-pageantcommand from terminal. - use
sshcommand as usual.
configure git to use ssh key from putty. (git use windows credential manager for http/s)
note that thare is bug to add new server to known host in terminal. need to manually ssh using putty and accept in gui.
Set env variable GIT_SSH to plink.exe path. hint: use which plink to display its path.
GIT_SSH=C:\ProgramData\chocolatey\bin\PLINK.EXE
Follow similar step to use pagent in powershell ssh-agent. Then in wsl add environment variable in .bashrc
export SSH_AUTH_SOCK=/mnt/c/ssh-agent.sock- Microsoft added winget which is a build in package manager preloaded with windows.
- Noticed this is more like semi auto as the permission popup still require user input.
winget install wez.wezterm `
famatech.advancedipscanner `
microsoft.powertoys `
logitech.options `
7zip.7zip `
flameshot.flameshot `
notepad++ `
chocolatey `
libreoffice `
videolan.vlc `
inkscape.inkscape `
mozilla.firefox `
nickemanarin.screentogif `
dotpdnllc.paintdotnet `
AntibodySoftware.WizTree `
kde.kdenlive `
obsproject.obsstudio `
techpowerup.gpu-z `
techpowerup.gpu-z `
lars-berger.GlazeWM `
CPUID.HWMonitor `
--disable-interactivity winget install `
postman.postman `
handbrake.handbrake `
mulaRahul.Keyviz `
--disable-interactivity pencil project ui design gravit designer
https://github.com/proviq/AccountManagement/releases https://www.makeuseof.com/install-hyper-v-windows-11-home/
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
pause