Joyber 发布的文章

复制一个html标签到php的双引号里面时,之前会自动转义双引号,前面加一个反斜线,最近更新了编辑器,发现不行了,很不方便

同样的你遇到这个问题可以这样设置一下就可以了,找到editor > general > smart keys > php “escape symbols on paste in string literals”这里勾上即可:

微信截图_20210104140543.png

https://www.skyfinder.cc/2020/01/12/database-navicat-premium15/

官网下载主程序
http://download.navicat.com.cn/download/navicat150_premium_cs_x64.exe
下载补丁程序
https://www.skyfinder.cc/wp-content/uploads/2020/01/Navicat-Keygen-Patch-v5.6.0-DFoX.zip
解压密码:www.skyfinder.cc

使用方法
卸载掉早期版本,卸载干净,然后安装最新版navicat

  • 安装Navicat Premium 15
  • 将补丁复制到安装目录下并运行补丁点击patch,注意此时不要打开Navicat Premium 15
  • 运行navicat并弹出注册界面
  • 如果没有弹出注册界面手动在菜单打开:帮助->注册
  • 点击 补丁程序的generate按钮同时注册码会自动写到navicat
  • 点击navicat注册界面的激活按钮,提示手动激活
  • 点击手动激活之后将得到的RequestCode复制到注册机
  • 点击补丁程序左下方的Generate按钮,生成ActivationCode
  • 复制粘贴到navicat的激活码框并完成激活

到这里需要你已经安装好子系统了,下面继续本文章的方法,自实现ssh自启动

建议使用清华源:
Ubuntu 镜像使用帮助 https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
Ubuntu 的软件源配置文件是 /etc/apt/sources.list。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用 TUNA 的软件源镜像。

选择你的ubuntu版本: 20.04LTS

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

本镜像仅包含 32/64 位 x86 架构处理器的软件包,在 ARM(arm64, armhf)、PowerPC(ppc64el)、RISC-V(riscv64) 和 S390x 等架构的设备上(对应官方源为ports.ubuntu.com)请使用 ubuntu-ports 镜像。

7.查看ssh服务是否开启,一般没开启,需要手动设置后开启服务

root@SC-201905211111:~# service ssh status

新安装的话,应该显示的状态是未开启的.现在需要去设置ssh的配置文件

#备份原文件
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
#进入配置文件
root@SC-201905211111:~# vim /etc/ssh/sshd_config
#修改端口为23,22有可能已被占用,并去掉之前的#注释符
Port 23
#开放监听IP,将之前的#注释符去掉即可
ListenAddress 0.0.0.0
#开启root用户登录:找下是否有PermitRootLogin no,有的话,将no改为yes.,没有的话,就新增一行
PermitRootLogin yes
#开启账号密码登录PasswordAuthentication no,改为yes
PasswordAuthentication yes
#保存退出(:wq 或 按住shift+zz)

开启ssh服务

service ssh start
#如果提示sshd error: could not load host key,则用下面的命令重新生成
dpkg-reconfigure openssh-server
#执行上述命令后,会有提示选择,直接按确认即可

8.secureCRT连接ubuntu登录
配置端口23
host为127.0.0.1
账号:root
连接后成功后提示输入密码,并保存
登录成功后应该如下:

Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.4.0-17763-Microsoft x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Fri Aug  2 09:26:55 DST 2019

  System load:    0.52      Memory usage: 76%   Processes:       7
  Usage of /home: unknown   Swap usage:   1%    Users logged in: 0

  => There were exceptions while processing one or more plugins. See
     /var/log/landscape/sysinfo.log for more information.


0 packages can be updated.
0 updates are security updates.


Last login: Fri Aug  2 08:38:37 2019 from 127.0.0.1

9.设置开机启动ssh服务:
此时还不完善,因为ubuntu是windows子系统,子系统的开机并没有自启动ssh的功能.需要利用脚本去实现.否则你win10开机后,不能直接用secureCRT去连接WSL,而需要登录ubuntu去开启ssh服务再连,很麻烦.
配置ubuntu的脚本

#创建init.wsl文件,保存并保存.注意#! /bin/sh这行不是注释,是sh解释器的指定方式.以下三行:第一行为创建文件,二三两行是编写的内容
vim /etc/init.wsl
#! /bin/sh
/etc/init.d/ssh $1

添加执行权限

chmod +x /etc/init.wsl

编辑sudoers,避免输入密码

root@SC-201905211111:~# vim /etc/sudoers
#添加以下这行到该文件
%sudo ALL=NOPASSWD: /etc/init.wsl

配置windos脚本
先在运行>命令(win+r)中输入shell:startup打开启动文件夹

再在该文件夹中创建文件ubuntu1804.vbs
将以下内容写入该文件并保存

Set ws = CreateObject("Wscript.Shell")
ws.run "ubuntu run sudo /etc/init.wsl start", vbhide

10.重启win10,过一会,就可以利用secureCRT直接连接刚才配置的127.0.0.1的WSL了

12.WSL子系统ubuntu与windows系统文件交互

WSL 系统可以通过 /mnt/<盘号>/ 目录(挂载点)来访问你计算机上的文件系统

#如访问C盘的KuGou文件夹
root@SC-201905211111:~# cd /mnt/c/KuGou
root@SC-201905211111:/mnt/c/KuGou# ls
test.txt

原文: https://www.dadclab.com/archives/7638.jiecao

1. 创建通过systemd配置docker服务的文件夹

mkdir /etc/systemd/system/docker.service.d

2. 创建服务配置文件

vim /etc/systemd/system/docker.service.d/http-proxy.conf

并将以下内容写入文件之中(根据你的实际情况,修改上述文件内容之中的代理信息)。

[Service]
 # NO_PROXY is optional and can be removed if not needed
 # Change proxy_url to your proxy IP or FQDN and proxy_port to your proxy port
 # For Proxy server which require username and password authentication, just add the proper username and password to the URL. (see example below)

 # Example without authentication
 Environment="HTTP_PROXY=http://proxy_url:proxy_port" "NO_PROXY=localhost,127.0.0.0/8"

 # Example with authentication
 Environment="HTTP_PROXY=http://username:password@proxy_url:proxy_port" "NO_PROXY=localhost,127.0.0.0/8"

3. 生效
使用如下命令重新加载systemctl, 验证服务环境变量并重启Docker服务。

# 重新加载systemctl 
systemctl daemon-reload
# 验证配置
systemctl show docker --property Environment
# 重启服务
system restart docker