Skip to content

Latest commit

 

History

History
170 lines (142 loc) · 8.39 KB

new-pc.md

File metadata and controls

170 lines (142 loc) · 8.39 KB

$\color{green}\textsf{\large 🦞 Configuración fácil de nuevo PC}$

Windows

1. Abrir PowerShell como administrador

  • Tecla , escribir PW y presionar Ctrl+Shift+Enter

2. Instalar WSL2

wsl --install

Mientras se instala, abrir otro PowerShell de admin y continuar:

3. Utilidades Windows

¿Qué es esto?

Son 4 archivos que se copiarán en tu $HOME (C:\Users\...)

Archivo Descripción
choko.bat Permite ejecutar choko <programa> para instalar programa desde Chocolatey, el cual pedirá permisos de administración
shoko.bat Permite hacer búsquedas de programas con shoko <texto>
.wslconfig Configura WSL para usar máximo 8gb de RAM
utils.reg Modifica el registro de windows para:
👉 Mostrar opción "Administrador de tareas" en click secundario de barra inferior
👉 Activar los menús clasicos al hacer clic derecho
👉 Hace que la tecla Impr. Pant seleccione un área de la pantalla
👉 Desactiva la barra de acoplamiento que aparece al arrastrar ventanas
👉 Cambia región a Chile
👉 Cambia teclado a "Español (España)"
👉 Configura gestos de 3 dedos en el Touchpad, para cambiar y cerrar pestañas
Invoke-WebRequest -Uri "https://onedrive.live.com/download?resid=5156943EC82A5E7F%21788787&authkey=!ADnDSv2ft36jfAg"  -OutFile "$HOME\Fuentes.zip"
Invoke-WebRequest -Uri "https://gist.githubusercontent.com/sebolio/b38f7ef6db673fd32b5f5366f0d97e86/raw/bd3eea8019b3803c59ce5415d92e88d0f56fb474/choko.bat" -OutFile "$HOME\choko.bat"
Invoke-WebRequest -Uri "https://gist.githubusercontent.com/sebolio/b38f7ef6db673fd32b5f5366f0d97e86/raw/bd3eea8019b3803c59ce5415d92e88d0f56fb474/shoko.bat" -OutFile "$HOME\shoko.bat"
Invoke-WebRequest -Uri "https://gist.githubusercontent.com/sebolio/b38f7ef6db673fd32b5f5366f0d97e86/raw/bd3eea8019b3803c59ce5415d92e88d0f56fb474/wslconfig" -OutFile "$HOME\.wslconfig"
Invoke-WebRequest -Uri "https://gist.githubusercontent.com/sebolio/b38f7ef6db673fd32b5f5366f0d97e86/raw/c5495d99941f0721e7972e10e97fc7864ce8362e/utils.reg" -OutFile "$HOME\seb-utils.reg"
reg import $HOME\seb-utils.reg

4. Instalar Chocolatey

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

5. Instalar mis programas favoritos:

choco install -y --force --allow -empty-checksums --ignore-checksum steam discord googlechrome notion authy-desktop winrar vscode slack telegram tableplus treesizefree spotify

6. Instalar fuentes (🖱️)

  1. Descargar aquí (no descomprimir)
  2. Ejecutar esto para instalar:
Expand-Archive -Path "$HOME\Fuentes.zip" -DestinationPath $ENV:TEMP\Fuentes
$SourceFolder = "$HOME\AppData\Local\Temp\Fuentes"
Add-Type -AssemblyName System.Drawing
$WindowsFonts = [System.Drawing.Text.PrivateFontCollection]::new()
Get-ChildItem -Path $SourceFolder -Include *.ttf, *.otf -Recurse -File |
Copy-Item -Destination "$env:SystemRoot\Fonts" -Force -Confirm:$false -PassThru |
ForEach-Object {
$WindowsFonts.AddFontFile($_.fullname)
$RegistryValue = @{
Path = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts'
Name = $WindowsFonts.Families[-1].Name
Value = $_.Fullname
}
$RemoveRegistry = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
Remove-ItemProperty -name $($WindowsFonts.Families[-1].Name) -path $RemoveRegistry
New-ItemProperty @RegistryValue
}
$\color{red}\textsf{\Large Ahora reinicia tu PC}$

$\color{red}\textsf{Ubuntu se instalará automáticamente al reiniciar}$

shutdown /r /t 0 /f

Configurar Terminal

  • Abrir Windows Terminal ➡️ y seguir instrucciones para dejarlo como predeterminado
  • Elegir Ubuntu 🐧 como default, guardar y abrir una nueva pestaña del terminal

Habilitar sudo sin password

sudo sed -i 's/) ALL/) NOPASSWD:ALL/' /etc/sudoers

Instalar Zsh, Node y configuraciones

sudo apt install zsh -y
curl https://gist.githubusercontent.com/sebolio/b38f7ef6db673fd32b5f5366f0d97e86/raw/3d2d9802708bb276a5360dd8356bc1bebea2074a/z-p10k.zsh -o .p10k.zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

$\color{blue}\textsf{Presionar "enter" antes de seguir}$

Luego pegar esto para implementar nvm, fuente, p10k y alias.

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
. $HOME/.nvm/nvm.sh
nvm install --lts
WINDIR=`cmd.exe /c echo %systemdrive%%homepath% 2> /dev/null | tr -d '\r' | xargs -0 wslpath`           
sed -i 's/robbyrussell/powerlevel10k\/powerlevel10k/' .zshrc
sed -i '1s/^/source "${XDG_CACHE_HOME:-$HOME\/.cache}\/p10k-instant-prompt-${(%):-%n}.zsh"\n/' .zshrc
sed -i 's/"name": "Ubuntu",/"name": "Ubuntu", "font": { "face": "CaskaydiaCove Nerd Font", "size": 10 },/' $WINDIR/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json
echo "
#alias y comandos
unalias gp
unalias gg
function gp { git add -A; git commit -m \"\$*\"; git push }
function gg { git clone [email protected]:sebolio/\$1 }
function x { printf \"\\e[45mPROXY INICIADO EN PUERTO 8888\\e[m\"; ssh -ND 8888 bot }
alias dev=\"([ -f bun.lockb ] && echo bun && bun run dev) || ([ -f pnpm-lock.yaml ] && echo pnpm && pnpm run dev) || npm run dev\"
alias doc=\"npm run storybook\"
alias json=\"npm run stub\"
alias stub=\"npm run stub\"
alias pu=\"git pull\"
alias p=\"ping nic.cl\"
\n[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh">>~/.zshrc
pnpm setup
sudo apt update;sudo apt install -y openjdk-11-jre

Ignorar mensajes de error

Instalaciones por click

Añadir llaves
mkdir ~/.ssh 2>/dev/null
WINDIR=`cmd.exe /c echo %systemdrive%%homepath% 2> /dev/null | tr -d '\r' | xargs -0 wslpath`
while [ ! -f ~/.ssh/config ]; do
  cmd.exe /c explorer.exe /select,%userprofile%\\onedrive\\.ssh 2>/dev/null
  PowerShell.exe -Command "Add-Type -AssemblyName PresentationFramework;[System.Windows.MessageBox]::Show(\"Para configurar reposotorios:\`n‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\`n\`n-> Haz clic derecho en [.ssh]\`n-> Elige [Mantener siempre en este dispositivo]\`n\`nAcepta cuando termine de descargar.\",'', 'OK', 'Info', 'OK', [System.Windows.MessageBoxOptions]::DefaultDesktopOnly)"
  cp $WINDIR/OneDrive/.ssh/* ~/.ssh
  chmod 600 ~/.ssh/*
done

Clonar

git clone [email protected]:sebolio/enti.git
git clone [email protected]:sebolio/seb.cl.git
git clone -b main [email protected]:sebolio/fichero.git fichero
git clone -b master [email protected]:sebolio/fichero.git vetmaster