技术圈开发者交流群:

WSL设置root为默认登录用户

安装好WSL后,默认的用为自己设置的,每次执行命令都要sodu以下,毕竟是自己开发环境用的,没必要这么麻烦,索性直接改默认用户为root,这里以Ubuntu为例:

首先以管理员身份打开cmd命令行,查看用法:

C:\WINDOWS\system32> ubuntu /?
Launches or configures a Linux distribution.

Usage:
    <no args>
        Launches the user's default shell in the user's home directory.

    install [--root]
        Install the distribuiton and do not launch the shell when complete.
          --root
              Do not create a user account and leave the default user set to root.

    run <command line>
        Run the provided command line in the current working directory. If no
        command line is provided, the default shell is launched.

    config [setting [value]]
        Configure settings for this distribution.
        Settings:
          --default-user <username>
              Sets the default user to <username>. This must be an existing user.

    help
        Print usage information.
windows 2019年10月24日 8931

Linux下快速安装Node.js笔记

Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。 Node.js 使用了一个事件驱动、非阻塞式 I/O 的模型,使其轻量又高效。

Linux下安装Node.js主要有两种方法,一种是源码编译安装,一种是编译后的文件。源码编译安装比较麻烦,这里介绍通过编译好的文件安装。

首先去官网下载 https://nodejs.org/en/download/ ,这里用的是Linux Binaries (x64)

wget https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.xz
Node.js 2019年09月24日 28838

Linux环境下给PHP安装fileinfo扩展及其作用

fileinfo模块中的函数通过在文件的给定位置查找特定的 魔术 字节序列 来猜测文件的内容类型以及编码。 虽然不是百分百的精确, 但是通常情况下能够很好的工作。

这里以php7.2为例,本文php的安装目录为/usr/local/php/

首先进入php的源码包fileinfo目录,如果没有源码先下载解压:

cd php-7.2.6/ext/fileinfo/
Linux 2019年03月10日 5908

修改ubuntu默认Nano编辑器为vim

爱折腾的我,最近安装了Windows子系统ubuntu,系统默认的是nana,不会用啊。

怎么办,因此修改下默认的编辑器为vim,网上找了两个方法:

Linux 2019年03月10日 749

在GIT中创建一个空分支

工作中有个项目需要个单独非分支放文档,该分支不继承任何提交,没有父节点,完全是一个干净的分支,使用git checkout命令创建的分支是有父节点的,包含了历史提交的,网站找了一下,所有就记录下来备用。

使用git checkout--orphan参数:

git checkout --orphan document
工具 2019年03月07日 653

如何重启 Windows 10 子系统(WSL)

WSL 子系统是基于 LxssManager 服务运行的。

只需要将 LxssManager 重启即可。

也可以做成一个 bat 文件。

net stop LxssManager
net start LxssManager
windows 2019年03月05日 2104

WSL(Windows Subsystem for Linux) 适用于Linux的Windows子系统初体验

Windows Subsystem for Linux(简称WSL)是一个为在Windows 10上能够原生运行Linux二进制可执行文件(ELF格式)的兼容层。它是由微软与Canonical公司合作开发,目标是使纯正的Ubuntu 14.04 "Trusty Tahr"映像能下载和解压到用户的本地计算机,并且映像内的工具和实用工具能在此子系统上原生运行。

记得上学的时候就开始用Vmware workstation,搭建过各种网络架构,期间也用过VirtualBoxDocker,后来用了一段时间Hyper-V,最终还是回到Vmware workstation怀抱。

最近,一时兴起,决定折腾一下,体验一下WSL...

WSL是Windows10很久之前就推出的功能,据说从win10秋季创意者更新(1709,内部版本16299),WSL才正式脱离beta,逐渐趋于稳定。

Linux 2019年03月05日 36942
鄂ICP备19028750号-1 @copyright 2024 tech1024.com