Go 是一个开源的编程语言,它能让构造简单、可靠且高效的软件变得容易。
Golang官网下载地址:https://golang.org/dl/
如果打不开,这里也可以下载:https://studygolang.com/dl
wget https://studygolang.com/dl/golang/go1.19.4.linux-amd64.tar.gz
Go 是一个开源的编程语言,它能让构造简单、可靠且高效的软件变得容易。
Golang官网下载地址:https://golang.org/dl/
如果打不开,这里也可以下载:https://studygolang.com/dl
wget https://studygolang.com/dl/golang/go1.19.4.linux-amd64.tar.gz
安装好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.
Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。 Node.js 使用了一个事件驱动、非阻塞式 I/O 的模型,使其轻量又高效。
Linux下安装Node.js主要有两种方法,一种是源码编译安装,一种是编译后的文件。源码编译安装比较麻烦,这里介绍通过编译好的
文件安装。
首先去官网下载 https://nodejs.org/en/download/ ,这里用的是Linux Binaries (x64)。
在wsl里搭建lnmp环境时,
访问简单的PHP 文件 (例如Hello world)没有问题,
但访问多数 PHP 文件卡死,
有的(例如phpinfo()),虽然可以加载出来但浏览器显示网页仍未加载完全或者巨慢。
fileinfo
模块中的函数通过在文件的给定位置查找特定的魔术
字节序列 来猜测文件的内容类型以及编码。 虽然不是百分百的精确, 但是通常情况下能够很好的工作。
这里以php7.2为例,本文php的安装目录为/usr/local/php/
。
首先进入php的源码包fileinfo目录,如果没有源码先下载解压:
cd php-7.2.6/ext/fileinfo/
爱折腾的我,最近安装了Windows子系统ubuntu,系统默认的是nana
,不会用啊。
怎么办,因此修改下默认的编辑器为vim
,网上找了两个方法:
选择编号3 /usr/bin/vim.basic
:
# update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 15 manual mode
Press <enter> to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode
工作中有个项目需要个单独非分支放文档,该分支不继承任何提交,没有父节点,完全是一个干净的分支,使用git checkout
命令创建的分支是有父节点的,包含了历史提交的,网站找了一下,所有就记录下来备用。
使用git checkout
的--orphan
参数:
git checkout --orphan document
进入windows开机启动目录C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
新建vbs文件start-wsl.vbs
:
Set ws = WScript.CreateObject("WScript.Shell")
cmd = "C:\Windows\System32\bash.exe -c ""bash /home/init.sh"""
' 运行命令不显示cmd窗口
ws.Run cmd, 0, false
Set ws = Nothing
WScript.quit
WSL 子系统是基于 LxssManager 服务运行的。
只需要将 LxssManager 重启即可。
Windows Subsystem for Linux(简称WSL)是一个为在Windows 10上能够原生运行Linux二进制可执行文件(ELF格式)的兼容层。它是由微软与Canonical公司合作开发,目标是使纯正的Ubuntu 14.04 "Trusty Tahr"映像能下载和解压到用户的本地计算机,并且映像内的工具和实用工具能在此子系统上原生运行。
记得上学的时候就开始用Vmware workstation
,搭建过各种网络架构,期间也用过VirtualBox
、Docker
,后来用了一段时间Hyper-V
,最终还是回到Vmware workstation
怀抱。
最近,一时兴起,决定折腾一下,体验一下WSL...
专业企业官网建设,塑造企业形象,传递企业价值
系统软件开发,用心思考,用心设计,用心体验
打破技术瓶颈,让不堪重负的项目起死回生
构建全渠道一体化运营能力,实现全链路数字化
文案撰写、营销策划,专注品牌全案
一站式解决企业互联网营销痛点和难题
以技术的力量,改变互联网
联系我们