Code Monkey home page Code Monkey logo

til's Introduction

Hi there 👋

til's People

Watchers

 avatar  avatar

til's Issues

Install centos via WSL

Basic tips

  • windows Version 1903 or higher
  • Enable the "Windows Subsystem for Linux" optional feature,Enable Virtual Machine feature
  • Set WSL 2 as your default version

Note

1. Chocolatey

a software management solution that allows you to manage 100% of your software, anywhere you have Windows, with any endpoint management tool.

# run powershell(administrator), close protection software
Get-ExecutionPolicy
Set-ExecutionPolicy AllSigned
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'))

2. LxRunOffline

A full-featured utility for managing Windows Subsystem for Linux (WSL)

choco install lxrunoffline

reopen powershell(administrator)

3. Centos-WSL

wget https://github.com/CentOS/sig-cloud-instance-images/raw/CentOS-7/docker/centos-7-docker.tar.xz
LxRunOffline install -n centos -d E:/centos -f D:\centos-8-x86_64.tar.xz
LxRunOffline.exe list

uninstall

LxRunOffline.exe uninstall -n centos

4. WSL2

wsl -l -v
wsl --set-version centos 2
# start
wsl -d centos
uname -a
cat /proc/version
cat /etc/redhat-release
# stop
wsl --shutdown -n

5. Windows Terminal

open setting, automatically attach when saving

Question

The above centos is not pure, how to use iso to package it yourself

Refrence

Sed text processing and stream editor

Basic

Replace

sed -i 's/before/after/' file

Execute multiple commands in the same line

sed -i -e '' -e '' file

Value

sed -i 's/'$value'/after/' file 

Save

sed -i 's/abc\(def\)/ghi/' file # ghidef
sed -i 's/abc\(def\)/\1/' file # defdef
sed -i 's/abc.*/[&]/' file # [abc.*] 

Delete

sed -i '1,$d' file # remove 1-end line
sed -i 's/abc//' file # delete all abc

Note

  • Special matching characters need to be escaped

Question

  • Cannot execute when the variable contains special characters

Refrence

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.