最新发布第7页
排序
Unknown collation: ‘utf8mb4_0900_ai_ci’的解决方法
今天在用Navicat往mysql(5.7版本)导入sql文件时,出现Unknown collation: 'utf8mb4_0900_ai_ci’错误。分析出现这样的问题是原sql文件是mysql(8.0版本),高级往低级(5.7版本)导入时出现版...
ubuntu添加虚拟内存
假设我们希望创建一个4GB的交换空间: sudo fallocate -l 4G /swapfile 设置权限: sudo chmod 600 /swapfile 配置交换空间: sudo mkswap /swapfile 验证交换空间: sudo swapon /swapfile 这...
剪贴板安装小记
需要安装以下模块djangorestframeworkDjangodjango-cors-headersnumpyjsonschema数据库migratepip install djangopython3 manage.py migratepip install djangorestframeworkpip install corshe...
vuepress组件
一src/.vuepress/components/MyComponent.vue<template> <link href='/css/codemirror.css' rel='stylesheet' /> <link href='/css/prolog.css' rel='stylesheet' /> <div...
内存不够打包失败 Reached heap limit Allocation failed – JavaScript heap out of memory
前端打包,内存不够,打包失败。解决办法:1、npm install -g increase-memory-limit2、npm install -g cross-env3、然后还需要把所有node_modules bin 下面的.cmd文件里的 “%_prog% ”改成 %_...
126天前0
你可以使用以下脚本来批量创建用户,并设置统一的初始密码 `123456`。这个脚本会从 `users.txt` 文件中读取用户名列表,并为每个用户创建账户。 ### 脚本内容: ```bash #!/bin/bash # 定义初始密码 PASSWORD="123456" # 检查 users.txt 文件是否存在 if [ ! -f "users.txt" ]; then echo "Error: users.txt file not found." exit 1 fi # 读取 users.txt 文件中的用户名并创建用户 while read -r USERNAME; do # 跳过空行 if [ -z "$USERNAME" ]; then continue fi # 创建用户 sudo adduser --gecos "" --disabled-password "$USERNAME" # 设置密码 echo "$USERNAME:$PASSWORD" | sudo chpasswd echo "User $USERNAME created with password $PASSWORD" done < "users.txt" ``` ### 使用步骤: 1. **创建 `users.txt` 文件**:在同一个目录下创建一个名为 `users.txt` 的文件,每行包含一个用户名。例如: ``` user1 user2 user3 ``` 2. **保存脚本**:将上述脚本保存为 `create_users.sh`。 3. **赋予执行权限**: ```bash chmod +x create_users.sh ``` 4. **运行脚本**: ```bash ./create_users.sh ``` ### 脚本说明: - `adduser --gecos "" --disabled-password "$USERNAME"`:创建用户时,不填写 GECOS 信息(即用户的全名、电话等),并且禁用密码登录。 - `echo "$USERNAME:$PASSWORD" | sudo chpasswd`:设置用户的初始密码。 - `users.txt` 文件中的每一行代表一个用户名,脚本会逐行读取并创建用户。 ### 注意事项: - 确保你有足够的权限来执行 `sudo` 命令。 - 如果你希望用户在首次登录时修改密码,可以在创建用户后使用 `passwd --expire $USERNAME` 命令强制用户在下次登录时更改密码。dadudu1个月前0
大佬16666666666666666666666zzb1个月前0
Could not launch VNC Serverᶻ༺ᴸ*ˣ*ᴶ༻ᴷ 1个月前0
谢谢分享月がきれい 4个月前0
xuexi2222222225个月前0
好haaohao用户19324442 6个月前0
xxxx用户82958605 10个月前0
大佬666