文章目录
  1. 1. JAVA
    1. 1.1. 安装
    2. 1.2. 添加系统变量
  2. 2. WSL win10子系统
  3. 3. chmod 777 /usr/boot.sh
  4. 4. 1.备份原来的数据源配置文件
  5. 5. 2.编辑数据源配置文件
  6. 6. 在这里我使用的是阿里云的数据源:
  7. 7. deb cdrom:[Ubuntu 16.04 LTS Xenial Xerus - Release amd64 (20160420.1)]/ xenial main restricted
  8. 8. 3.更新配置
  9. 9. 搭建环境

Grand theft dora-小夫

JAVA

安装

添加系统变量

  1. 变量名JAVA_HOME

变量值:C:\Program Files\Java\jdk1.8.0_121

jdk的目录

  1. 添加变量名CLASSPATH

变量值:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

  1. 在Path添加
    添加%JAVA_HOME%\bin%JAVA_HOME%\jre\bin两个系统变量。Path使得系统可以在任何路径下识别java命令

  2. 检查是否正确正确配置
    在CMD下执行java -version

WSL win10子系统

  • 子系统路径:
    子系统目录在
    1
    %USERPROFILE%\AppData\Local\lxss

换个说法
C:\Users\你的用户名\AppData\Local\lxss

如果downloading from the windows store总是失败可以,在windows10地区选台湾/香港 再下载试试

或者离线下载


  • 卡机自动启动WSL,并自动开启ssh

l. 首先是需要修改的sshd_config内容其实只有这几项:

1
2
3
4
5
6
7
8
9
10
11
12
Port (随便改一个就行)
UsePrivilegeSeparation no (因为WSL默认不提供chroot
PasswordAuthentication yes
StrictModes no
PermitRootLogin yes
````


2. 添加两条针对你那条端口的规则(传入的和传出的),允许你那个端口的TCP连接。


3. 接下来生成新的密钥

sudo ssh-keygen -A

1
2

最后重启一下ssh服务

sudo service ssh restart

1
2
4. 添加计划任务,具体操作:
保存一下文本为``hide.vbe``并扔进``C:\Windows\System32\``

Set ws = CreateObject(“Wscript.Shell”)
ws.run “bash /usr/boot.sh”,vbhide

1
2
3
4
5
6
7
>``WScript.Shell``是一个对象,可以执行操作系统外壳常用的操作:比如运行程序、读写注册表、环境变量等

再在控制版面中``Task Scheduler``创建``Create Basic Task``------->选择``trigger``方式``when I log on``------>``Start a program``填写``hide.vbe``


5. 在WSL创建一个shell脚本
如果 默认启动用户不是root,记得切换成root

lxrun /setdefaultuser root

1
如果是ubntu18.04则应该在

ubuntu1804 config –default-user root

1
2
3
4
5



+ 建立ssh启动脚本

#!/bin/sh
service ssh start
$SHELL #这句很重要,挂起当前脚本进程, 进而维持 base.exe 一直打开

1
再赋权限

chmod 777 /usr/boot.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
>在CMD中设置  ``ubuntu config --default-user root`` 不然普通用户无法执行脚本
>>如果提示'ubuntu' is not recognized as an internal or external command,
operable program or batch file.则应该用这个命令: `lxrun /setdefaultuser root `






6. 存疑
笔记本电脑不插适配器开机,这个开机自启脚本无效,怎么解决?

[参考了][2]

[2]: https://www.zhihu.com/question/50664903

-------------------------------------------------------------------------------

+ 备份WSL

1.备份原来的数据源配置文件

cp /etc/apt/sources.list /etc/apt/sources.list_backup

2.编辑数据源配置文件

vim /etc/apt/sources.list

在这里我使用的是阿里云的数据源:

#==============================================================================================

deb cdrom:[Ubuntu 16.04 LTS Xenial Xerus - Release amd64 (20160420.1)]/ xenial main restricted

deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
#===============================================================================================

3.更新配置

apt-get update

1
2
3
4
5
6
7
8
9
10

+ WSL挂在移动硬盘

[看这篇文章] [1]
[1]:https://blogs.msdn.microsoft.com/wsl/2017/04/18/file-system-improvements-to-the-windows-subsystem-for-linux/c



Mounting DrvFs
In order to mount a Windows drive using DrvFs, you can use the regular Linux mount command. For example, to mount a removable drive D: as /mnt/d directory, run the following commands:

$ sudo mkdir /mnt/d
$ sudo mount -t drvfs D: /mnt/d

1
Now, you will be able to access the files of your D: drive under /mnt/d. When you wish to unmount the drive, for example so you can safely remove it, run the following command:

$ sudo umount /mnt/d

1
2

+ wsl中文乱码
  • 执行scp用tab键补全:
    -bash: warning: setlocale: LC_CTYPE: cannot change locale (zh_CN.UTF-8)
    解决方法:

编辑 ~/.bashrc文件或~/.profile文件(修改/etc/profile文件也可以,但是会影响全局的设置)

1
vim ~/.bahsrc

在文件尾部添加一语句:

1
2
export LC_CTYPE="en_US.UTF-8"

搭建环境

  1. HTTP服务软件
    Apache

  2. 网页程序设计语言
    PHP

  3. 数据库管理系统软件
    MySQL

  4. 图形界面的数据管理软件
    phpMyAdmin

文章目录
  1. 1. JAVA
    1. 1.1. 安装
    2. 1.2. 添加系统变量
  2. 2. WSL win10子系统
  3. 3. chmod 777 /usr/boot.sh
  4. 4. 1.备份原来的数据源配置文件
  5. 5. 2.编辑数据源配置文件
  6. 6. 在这里我使用的是阿里云的数据源:
  7. 7. deb cdrom:[Ubuntu 16.04 LTS Xenial Xerus - Release amd64 (20160420.1)]/ xenial main restricted
  8. 8. 3.更新配置
  9. 9. 搭建环境