Windows10中使用Windows7的图片查看器
新建一个.reg文件,将下面的代码粘贴进去,保存运行即可。
Windows Registry Editor Version 5.00
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes\.jpg]
@="PhotoViewer.FileAssoc.Tiff"
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes\.jpeg]
@="PhotoViewer.FileAssoc.Tiff"
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes\.gif]
@="PhotoViewer.FileAssoc.Tiff"
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\ ...
Docker Compose安装MySQL
docker-compose.yml
version: '3.7'
services:
mysql:
image: mysql
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
ports:
- 3306:3306
volumes:
- ./mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: 123456
运行docker-compose up -d即可。
Debian开启cron日志
打开/etc/rsyslog.conf
去掉关于cron的注释
重启服务:/etc/init.d/rsyslog restart
PostgreSQL修改密码
进入PostgreSQL。psql -U <username>
alter user <username> with password 'new_pasword';
VSCode设置资源管理器缩进
原来是8个像素。
改为14个像素,即一个字的宽度。
路径:设置 -> 工作台 -> 外观 -> Tree: Indent
MySQL设置时区
MySQL的时区默认不是北京的,比北京时间少8小时。
1. 进入MySQL
能执行命令即可。使用可视化,或命令行都无所谓。
2. 查看当前时区
SHOW VARIABLES LIKE "%time_zone%";
可以看到time_zone是SYSTEM时区,而系统时区是UTC
3. 修改时区
修改时区为东八区,就是北京时间
SET GLOBAL time_zone = '+8:00';
FLUSH PRIVILEGES; #立即生效
4. 查看结果
SHOW VARIABLES LIKE "%time_zone%";
可以看到已经修改成+08:00了,这时候输入SELECT NOW()查看当前时间,是不是就和北京时间一致了
SpringBoot解决跨域问题
写一个配置类继承WebMvcConfigurerAdapter会提示这个类已经过期了,所以直接实现WebMvcConfigurerAdapter的父类WebMvcConfigurer 即可
代码如下:
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**&qu ...
npm换源
运行 npm config set registry https://registry.npm.taobao.org即可。
运行 npm config set registry https://registry.npmmirror.com即可。
在1月22日,淘宝原镜像域名(registry.npm.taobao.org)的HTTPS证书正式到期。如果想要继续使用,需要将npm源切换到新的源(registry.npmmirror.com),否则会报错。
MySQL绿色版安装
1. 创建配置文件
my.ini文件
[mysqld]
port=3306
basedir=C:\Program Files\mysql-8.0.16-winx64
datadir=D:\Files\MySQL Files
max_connections=200
max_connect_errors=10
character-set-server=utf8mb4
default-storage-engine=INNODB
default_authentication_plugin=mysql_native_password
[mysql]
default-character-set=utf8mb4
[client]
port=3306
default-character-set=utf8mb4
2. 配置环境变量
…
3. 安装
执行下面的命令。
mysqld –-initialize –-console
mysqld –install
修改密码
alter user 'root'@'locahost' identified by 'new password';
或者
...
pip换源
收集的几个国内镜像
来源
地址
阿里云
http://mirrors.aliyun.com/pypi/simple/
清华大学
https://pypi.tuna.tsinghua.edu.cn/simple/
中国科技大学
https://pypi.mirrors.ustc.edu.cn/simple/
可以任选一个替换下面代码的链接即可
代码
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Debian
复制代码到Debian中运行即可
mkdir -p ~/.pip
tee ~/.pip/pip.conf <<-'EOF'
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
EOF
Windows
在用户当前文件下创建一个pip文件夹,在文件夹下创建一个pip.ini文件。
例如我Windows上用户名叫admin,那么,首先进入C:\Users\ad ...
