首页
Search
1
Dockerfile常用模板
33 阅读
2
Python配置pip国内源
22 阅读
3
Exchange常用命令
18 阅读
4
Ubuntu更换国内apt源
14 阅读
5
Linux根目录inode占用过高处理解决方法
10 阅读
邮箱
开发
运维
登录
Search
Typecho
累计撰写
6
篇文章
累计收到
0
条评论
首页
栏目
邮箱
开发
运维
页面
搜索到
6
篇与
的结果
2024-10-30
Python配置pip国内源
国内源 https://pypi.douban.com/simple/ # 豆瓣源 https://pypi.tuna.tsinghua.edu.cn/simple # 清华源Windows1、文件管理器文件路径地址栏敲:`%APPDATA%` 回车,快速进入 C:\Users\电脑用户\AppData\Roaming 文件夹中 2、新建 pip 文件夹并在文件夹中新建 pip.ini 配置文件 3、新增 pip.ini 配置文件内容MacOS、Linux1、在用户根目录下~下创建 .pip 隐藏文件夹,如果已经有了可以跳过 -- mkdir ~/.pip 2、进入 .pip 隐藏文件夹并创建 pip.conf 配置文件 -- cd ~/.pip && touch pip.conf 3、启动 Finder(访达) 按 CMD+SHIFT+G 来的进入,输入 ~/.pip 回车进入 4、新增 pip.conf 配置文件内容 配置文件内容mkdir ~/.pip cat > ~/.pip/pip.conf <<EOF [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host = https://pypi.tuna.tsinghua.edu.cn EOF
2024年10月30日
22 阅读
0 评论
0 点赞
2024-10-30
Ubuntu更换国内apt源
图形界面配置使用图形界面配置:系统设置->软件和更新->选择下载服务器->mirrors.aliyun.com手动更改# 阿里云源 sed -i 's/https:\/\/mirrors.aliyun.com/http:\/\/archive.ubuntu.com/g' /etc/apt/sources.list 或者手动编辑/etc/apt/sources.list阿里云源ubuntu14.04 LTS (trusty) (EOL)配置如下deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse ## Not recommended # deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse ubuntu16.04 LTS (xenial) (EOL)配置如下deb https://mirrors.aliyun.com/ubuntu/ xenial main deb-src https://mirrors.aliyun.com/ubuntu/ xenial main deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main deb https://mirrors.aliyun.com/ubuntu/ xenial universe deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe deb https://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb https://mirrors.aliyun.com/ubuntu/ xenial-security main deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main deb https://mirrors.aliyun.com/ubuntu/ xenial-security universe deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security universeubuntu18.04 LTS (bionic)配置如下deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse # deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverseubuntu20.04 LTS (focal)配置如下deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse # deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverseubuntu22.04 LTS (jammy)配置如下deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse # deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverseubuntu23.04 (lunar)配置如下deb https://mirrors.aliyun.com/ubuntu/ lunar main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ lunar main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ lunar-security main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ lunar-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ lunar-updates main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ lunar-updates main restricted universe multiverse # deb https://mirrors.aliyun.com/ubuntu/ lunar-proposed main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ lunar-proposed main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ lunar-backports main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ lunar-backports main restricted universe multiverseubuntu24.04 (noble)配置如下deb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse # deb https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multivers
2024年10月30日
14 阅读
0 评论
0 点赞
2024-10-30
ProxmoxVE 虚拟机导入导出
环境平台:Proxmox Virtual Environment 6.2-4节点:pve01 pve02一、简介利用pve的备份恢复功能进行虚拟机的导入导出使用备份功能备份为vma文件使用WinSCP等软件复制vma备份文件至计算机使用WinSCP等软件上传vma备份文件至另一台pve使用恢复功能恢复虚拟机二、 备份虚拟机登录pve01选择要备份的虚拟机点击子菜单中的备份按钮点击立即备份按钮设置备份到的存储(local的备份路径为:/var/lib/vz/dump)设置模式:停止设置压缩:无等待备份完毕三、使用WinSCP下载备份WinSCP可以使用SFTP连接pve节点WinSCP下载地址:WinSCP官网登录pve01节点切换远程目录至备份目录(local存储的备份目录为:/var/lib/vz/dump)找到虚拟机备份文件右键点击下载使用二进制方式下载vma备份文件至本机目录等待下载完成四、上传备份使用WinSCP登录pve02节点本地目录切换至刚下载备份的目录右键点击vma备份文件选择上传输入上传路径/var/lib/vz/dump/.(local存储的备份目录为:/var/lib/vz/dump)并使用二进制方式上传等待上传完毕五、恢复虚拟机登录pve02节点切换至相应的上传存储(local)点击子菜单中的内容菜单选择刚上传的vma备份文件点击恢复按钮设置恢复到的存储和VM ID点击恢复按钮开始恢复等待恢复完毕六、测试启动导入的虚拟机
2024年10月30日
8 阅读
0 评论
0 点赞
2024-10-30
Linux根目录inode占用过高处理解决方法
近期发现一台运行时间1000+天的CentOS服务器,根目录Inode占用接近100%,经排查后发现是/var/spool/postfix/maildrop目录下临时邮件过多导致注:/var/spool/postfix/maildrop 是 Postfix 邮件服务器用来暂存因为各种原因无法立即传递给收件人的邮件的目录。当 Postfix 无法立即发送邮件时(比如对方的服务器不可达,或者是网络问题),邮件会被暂存在这个目录中。处理方法:# 查看inode数量 df -i # 统计inode数量 sudo du --inode /var/spool/postfix/maildrop # 执行删除命令,直接执行rm -rf无法删除 cd /var/spool/postfix/maildrop ls | xargs rm -f
2024年10月30日
10 阅读
0 评论
0 点赞
2024-10-30
Exchange常用命令
获取Exchange服务器所有命令# 查看exchange 服务器命令 get-exchangeserver邮件大小设置Exchange里有4处地方可以设置邮件大小,全局设置,SMTP虚拟服务器,连接器,用户属性,他们的应用范围都不相同,请根据需求设置# 查看全局设置会被用户属性设置覆盖 Get-TransportConfig | Format-List MaxReceiveSize,MaxSendSize,MaxRecipientEnvelopeLimit # 设置所有用户收发邮件最大36M Get-mailbox -resultsize unlimited | set-mailbox -maxsendsize 36MB -maxreceivesize 36MB # 设置某个用户收发邮件最大45M Set-Mailbox "zhanke.zhang" -MaxSendSize 45MB -MaxReceiveSize 45MB # 清除所有用户现有的发件限制 Get-mailbox -resultsize unlimited | set-mailbox -MaxSendSize unlimited -MaxReceiveSize unlimited删除邮件# 查询指定账户邮箱 主题test ,并删除 Search-Mailbox -Identity "zhangsan" -SearchQuery "Subject:'test'" -DeleteContent # 删除所有主题为test的邮件 Get-mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery "Subject:'test'" -DeleteContent 批量删除邮件# 批量删除需要三步命令 # 步骤1,新建一个搜索任务,搜索指定邮件内容 New-MailboxSearch "Discovery-CaseId012" -StartDate "01/01/2013" -EndDate "12/31/2015" -SourceMailboxes "DG-Finance" -TargetMailbox "Discovery Search Mailbox" -SearchQuery '"Contoso" AND "Project A"' -MessageTypes Email -IncludeUnsearchableItems -LogLevel Full -InPlaceHoldEnabled $true # 启动搜索任务 Start-MailboxSearch "Discovery-CaseId012" # 创建搜索 New-ComplianceSearch -Name "Remove Phishing Message" -ExchangeLocation all -ContentMatchQuery 'subject:"Update your account information"' # 启动搜索 Start-ComplianceSearch -Identity "Remove Phishing Message" # 删除搜索到的邮件 New-ComplianceSearchAction -SearchName "Remove Phishing Message" -Purge -PurgeType SoftDelete查看用户发送和接收邮件的记录# 查看单个人所有记录 get-messagetrackinglog -sender zhangsan@test.com # 查看单人指定日期内记录,开始日期和结束日期不能相同 get-messagetrackinglog -recipients zhangsan@test.com -start "2024-09-29" -end "2024-09-30" # 查看zhangsan发往lisi的邮件记录 get-messagetrackinglog -sender zhangsan@test.com -recipients zhangsan@test.com -start "2024-10-12" -end "2021-10-14"接收器并发连接数# 查看接收器并发连接数 get-receiveconnector * | ft Name,MaxInboundconnectionPersource # 设置接收连接器并发: Set-receiveconnector -MaxInboundconnectionPersource 500 (500个并发) 获取服务器组件状态Get-ServerComponentState -Identity ycs-vmail-01(服务器名称) Get-ServerComponentState ycs-vmail-01EXCHANGE状态测试命令1.获取所有test开头的测试命令:help test-*2.获取服务器组件状态get-servercomponentstate3.查看服务运行状态,此命令会根据CAS或者MAILBOX服务器自动进行相应服务筛选。test-servicehealth4.测试客户端连接到优先服务器时所使用的两个关键协议:MAPI\LDAP。并且会间接确认MAPI服务器、exchange存储、目录服务访问DSaccess是否正在工作。test-mapiconnectivity5.检查复制服务运行状态并提示发现的错误。test-replicationhealth6.验证复制服务后(第5个命令),可以使用Get-MailboxDatabaseCopyStatus检查数据库本身的复制状态。Get-MailboxDatabaseCopyStatus # contentindexstate即索引状态,确保保持healthy状态。 get-mailboxdatabasecopystatus | fl name,status,contentindexstate 7.查看服务器有哪些数据库Get-MailboxDatabase8.查询ycs-public-mailbox 数据库有哪些用户 并分页显示Get-Mailbox -Database ycs-public-mailbox | more9.查询ycs-vmail-01服务器上有哪些用户 并分页显示Get-Mailbox -Server ycs-vmail-01 | more10.按主题包含的关键字删除:Search-Mailbox -Identity lisi -SearchQuery "Subject:关键字" -DeleteContent # 例如: Search-Mailbox -Identity lisi -searchquery "Subject:关键字" -DeleteContent # 删除 YCS-Office Mailbox 数据库中 zhangsan 账户发送的主题 关于周末加班通知 的邮件 Get-Mailbox -Database YCS-Office Mailbox | Search-Mailbox -SearchQuery {from:"zhangsan@test.com" AND Subject:"关于周末加班通知"} -DeleteContent11.获取所有邮箱使用情况,按大小排序输出到磁盘Get-Mailbox | Get-Mailboxstatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(KB)";expression={$_.TotalItemSize.Value.ToKB()}},ItemCount > D:\1.csv
2024年10月30日
18 阅读
0 评论
0 点赞
1
2