Viarotel Memo

website·Indexed 29 days ago

https://viarotel.github.io/

A collection of technical notes and troubleshooting guides covering Windows, macOS, Git, Node.js, Vue.js, Nginx, and Hyper-V. Includes specific fixes for Microsoft developer registration error 2201, pnpm configuration, and WeChat Mini Program HTTPS issues.

Tokens
10.7K
Snippets
102
Records
111
Agent score
64%

What's inside Viarotel Memo

  1. Run macOS environment configuration scripts

    The author provides two Zsh-based shell scripts for macOS environment setup: a general script loader and a specific environment configuration script.
    # macOS Script Loader
    /bin/zsh -c "$(curl -fsSL https://gitee.com/viarotel/environments/raw/gitee/apple/shell/main.sh)"
    
    # macOS Environment Configuration
    /bin/zsh -c "$(curl -fsSL https://gitee.com/viarotel/environments/raw/gitee/apple/shell/macos/main.sh)"
  2. Configure Windows to use UTC for dual-boot time sync

    To fix time discrepancies in a dual-boot setup, configure Windows to treat the Real-Time Clock (RTC) as Universal Time. Open PowerShell as an Administrator and run the following command to add the RealTimeIsUniversal registry key.
    Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1
  3. Initialize a local Git repository and push to a remote server

    Follow these steps to create a new Git repository in the current directory, commit changes locally, and push them to a remote repository (e.g., GitHub).
    # Initialize a new Git repository in the current directory
    git init
    
    # Add all changes to the staging area
    git add .
    
    # Commit changes from the staging area to the local repository
    git commit -m "your commit message"
    
    # Link the local repository to a remote server
    git remote add origin https://github.com/username/repository.git
    
    # Push the local main branch to the remote repository and set it as the default upstream
    git push -u origin main
  4. Install Homebrew using custom scripts

    Use these zsh commands to install Homebrew or restore backups using provided shell scripts.
    # Install and restore backup
    /bin/zsh -c "$(curl -fsSL https://gitee.com/viarotel/environments/raw/gitee/apple/shell/homebrew/main.sh)"
    
    # Install only
    /bin/zsh -c "$(curl -fsSL https://gitee.com/viarotel/environments/raw/gitee/apple/shell/homebrew/install.sh)"
    
    # Restore backup only
    /bin/zsh -c "$(curl -fsSL https://gitee.com/viarotel/environments/raw/gitee/apple/shell/homebrew/restore.sh)"
  5. Rename Git branches locally and remotely

    To rename a branch that has already been pushed to a remote server, you must rename the local branch, delete the old remote branch, push the new branch, and reset the upstream tracking.
    # 1. Rename the local branch
    git branch -m oldName newName
    
    # 2. Delete the old branch from the remote
    git push --delete origin oldName
    
    # 3. Push the new renamed branch to the remote
    git push origin newName
    
    # 4. Associate the modified local branch with the remote branch
    git branch --set-upstream-to origin/newName
  6. Bypass network requirements during Windows OOBE

    During the Windows Out-of-Box Experience (OOBE) setup process, you can bypass the requirement to connect to a network/internet to create a local account instead of a Microsoft account. Open the command shell (Shift + F10) and run the bypass command.
    oobe\bypassnro
  7. Edit the Nginx configuration file

    The primary Nginx configuration file is located at /etc/nginx/nginx.conf. You can edit it using the nano text editor.
    sudo nano /etc/nginx/nginx.conf
  8. Add a virtual display monitor on Windows

    To add a virtual display monitor on Windows, run the provided installation script in a PowerShell terminal with Administrator privileges. The script fetches and executes a configuration from a remote repository to set up the virtual monitor environment.
    $env:script = "windows-virtual-monitor"; irm "https://gitee.com/viarotel/environments/raw/gitee/microsoft/powershell/main.ps1" | iex
  9. Bypass network connection requirement during Windows OOBE

    During the Windows Out-of-Box Experience (OOBE), you can bypass the requirement to connect to a network (internet) to create a local account by running the oobe\bypassnro command in the shell.
    oobe\bypassnro
  10. Configure the macOS environment

    Run the specific macOS environment configuration script using zsh to set up system-level preferences and tools.
    /bin/zsh -c "$(curl -fsSL https://gitee.com/viarotel/environments/raw/gitee/apple/shell/macos/main.sh)"