#+TITLE: Window Env * Windows Environment 모든 명령어는 Powershell에서 수행된다. ** 사전준비 *** 환경변수 #+begin_src shell $git_username = "JaeYoo-Im" $git_email = "cpu3792@gmail.com" #+end_src *** CapsLock키 비활성화 #+begin_src shell # Change KeyMap (Capslock to ctrl key) reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout" /v "Scancode Map" /t REG_BINARY /d 0000000000000000020000001d003a0000000000 /f #+end_src *** Win + L 비활성화 Note : 이거 하면 동작이 이상해지는 듯? #+begin_src shell reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "DisableLockWorkstation" /t REG_DWORD /d 1 /f #+end_src *** Chocolatey 설치 #+begin_src shell 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')) #+end_src ** Application *** Base Apps #+begin_src shell choco install powershell-core -y choco install firefox -y choco install git -y choco install git-fork -y choco install dejavufonts -y choco install firacode -y choco install enpass.install -y #+end_src windows에서 기본으로 제공하는 openssh는 proxycommand등의 기능이 지원되지 않는다. 삭제후 Git을 설치하면 같이 설치되는 ssh를 사용한다. [[./images/screenshot-04.png]] [[./images/screenshot-05.png]] 개인적으로 =%HOME%/usr_cmd= 를 환경변수에 추가하여 스크립트들을 넣어 사용한다. #+begin_src shell [Environment]::SetEnvironmentVariable("HOME", $HOME, "Machine") [Environment]::SetEnvironmentVariable("Path", $env:Path + ";" + $HOME + "\usr_cmd;c:\Program Files\Git\bin;c:\Program Files\Git\usr\bin", "Machine") $env:Path = [Environment]::GetEnvironmentVariable("Path", "Machine") git config --global user.name $git_username git config --global user.email $git_email git config --global core.autocrlf true # 저장소로 보낼때 LF로 들여올때 CRLF로 conversion git clone https://github.com/JaeYoo-Im/myDots.git $HOME/.dotfiles #+end_src *** Neovim #+begin_src shell choco install neovim -y choco install ctags -y cp -r $HOME/.dotfiles/.config/nvim $HOME/AppData/Local #+end_src Context 메뉴 추가 [[./images/screenshot-06.png]] #+begin_src shell # Edit with neovim context menu reg add HKEY_CLASSES_ROOT\*\shell\NeoVim /t REG_SZ /d "Edit with NeoVim..." /f reg add HKEY_CLASSES_ROOT\*\shell\NeoVim /v Icon /t REG_SZ /d "C:\tools\neovim\Neovim\nvim-qt.exe" /f reg add HKEY_CLASSES_ROOT\*\shell\NeoVim\Command /t REG_SZ /d "C:\tools\neovim\Neovim\nvim-qt.exe """"%1""""" /f #+end_src Plugin Manager 설치 #+begin_src shell md ~\AppData\Local\nvim\autoload $uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' (New-Object Net.WebClient).DownloadFile( $uri, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath( "~\AppData\Local\nvim\autoload\plug.vim" ) ) #+end_src *** Networking #+begin_src shell choco install angryip -y choco install wireshark -y choco install putty.install -y #+end_src *** Media #+begin_src shell choco install handbrake.install -y choco install potplayer -y choco install reaper -y choco install gimp -y choco install inkscape -y #choco install blender -y #+end_src *** Gaming #+begin_src shell choco install goggalaxy -y choco install msiafterburner -y choco install steam -y choco install epicgameslauncher -y choco install discord -y #+end_src *** Programming #+begin_src shell choco install visualstudio2019buildtools -y #+end_src **** Clang #+begin_src shell choco install llvm -y choco install cmake -y #+end_src **** Rust Rust는 build tools 설치후 진행. #+begin_src shell wget https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe ./rustup-init.exe $env:Path += ";$HOME/.cargo/bin" rustup component add rls rustup component add rust-src rustup component add rust-analysis rm ./rustup-init.exe #+end_src **** Python Packages #+begin_src shell choco install python -y $env:Path += ";C:/Python39/Scripts" python -m pip install --upgrade pip #pip install wheel #pip install six #pip uninstall pygls #pip install pygls==0.9.1 # hdl_checker dependency #pip install hdl_checker #neovim / modelsim 연동 pip install numpy pip install matplotlib #+end_src **** Julia #+begin_src shell choco install julia atom -y #+end_src ***** Package Install Julia 실행후 #+begin_src julia ] #package 관리자 진입 add Plots add FFTW #+end_src ***** ATOM =Ctrl+,= 입력하여 설정창 띄운후 uber-juno 설치. *** Latex 예전에 사용하던 방법인데 남겨놓는다. 최근에는 WSL의 EMACS에서 AUCTEX를 이용해서 사용하고자 하고 있음. **** Texlive 사용방법 #+begin_src shell wget http://mirror.navercorp.com/CTAN/systems/texlive/Images/texlive.iso -OutFile texlive.iso $image_path = (Get-Location).path + "\texlive.iso" $mountResult = Mount-DiskImage -ImagePath $image_path -PassThru $driveLetter = ($mountResult | Get-Volume).DriveLetter + ":" Push-Location $driveLetter .\install-tl-windows.bat Pop-Location Dismount-DiskImage -ImagePath $image_path choco install texstudio -y rm ./texlive.iso #+end_src Context Menu #+begin_src shell reg add "HKEY_CLASSES_ROOT\tex File\shell\pdfLatex" /t REG_SZ /d "Generate PDF..." /f $texlive_context_cmd = $texlive_inst_dir + "/bin/win32/pdflatex.exe -synctex=1 -interaction=nonstopmode ""%1""" reg add "HKEY_CLASSES_ROOT\tex File\shell\pdfLatex\Command" /t REG_SZ /d $texlive_context_cmd /f #+end_src **** Miktex 사용방법 #+begin_src shell choco install miktex -y choco install texmaker -y choco install graphviz -y choco install gnuplot -y #+end_src *** Others #+begin_src shell choco install bandizip -y choco install everything -y choco install sumatrapdf.install -y choco install filezilla -y choco install transgui -y choco install honeyview -y choco install rufus -y choco install pdfsam.install -y choco install dotnetcore-sdk -y choco install powertoys -y #+end_src * Proxy 프록시를 이용하여 특정앱을 업데이트하거나 특정앱의 인터넷접속을 할때 쓰던 방식이다. 환경변수는 아래와 같다. #+begin_src shell $proxy_addr = "192.168.1.168:3128" #+end_src ** Global Proxy 앞서 usr_cmd를 환경변수에 추가하였기에 여기에 =proxy.bat= 파일을 생성하여 =Win-R= 실행창에서 빠르게 프록시를 켜고 끌수 있게 하였다. 1. Proxy 0 프록시 끄기 2. Proxy 1 프록시 켜기 #+begin_src shell $proxy_bat_file = $HOME + "\usr_cmd\proxy.bat" Add-Content -Path $proxy_bat_file -Value ("set PROXY_ADDR=" + $proxy_addr) Add-Content -Path $proxy_bat_file -Value (Get-Content "./proxy_base.txt") #+end_src 여기서 proxy_base.txt 파일의 내용은 다음과 같다. 이상하게 Internet Explorer를 켜고 꺼야 적용이 되더라. #+begin_src shell @echo off taskkill /IM iexplore.exe set argc=0 for %%x in (%*) do Set /A argc+=1 echo argc : %argc% if %argc% == 1 goto START_BAT echo Argument is needed. goto END_BAT :START_BAT if /i %1 == 0 goto DISABLE goto ENABLE goto DISABLE :ENABLE @%SystemRoot%\system32\reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d %PROXY_ADDR% /f @%SystemRoot%\system32\reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f start iexplore.exe sleep 2 taskkill /IM iexplore.exe goto END_BAT :DISABLE @%SystemRoot%\system32\reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d 0.0.0.0:80 /f @%SystemRoot%\system32\reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f start iexplore.exe sleep 2 taskkill /IM iexplore.exe goto END_BAT :END_BAT #+end_src ** Chocolatey #+begin_src shell choco config set proxy http://$proxy_addr #+end_src ** Git #+begin_src shell git config --global http.proxy http://$proxy_addr git config --global https.proxy https://$proxy_addr #+end_src ** Powershell에서 임시 활성화 #+begin_src shell $proxy='http://'+$proxy_addr $ENV:HTTP_PROXY=$proxy $ENV:HTTPS_PROXY=$proxy #+end_src