Linux
CentOS 7 下安装并配置 Zsh
· ☕ 1 分钟
1. 安装 zsh 1 sudo yum install -y zsh 2. 安装 oh-my-zsh 1 sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 建议将 Zsh 设置为默认的 Shell。 3. 安装插件 3.1 安装 autojump 1 sudo yum install -y epel-release 1 sudo yum install -y autojump-zsh 3.2 安装 zsh-autosuggestions 1 git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions 3.3 安装 zsh-syntax-highlighting 1 git clone git://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting 4. 添加 .zshrc 配置 1 sed -i 's/^plugins=(\(.*\)/plugins=(autojump zsh-autosuggestions zsh-syntax-highlighting \1/' ~/.zshrc 退出 Terminal, 再次登录即可。

NFS 部署与挂载
· ☕ 2 分钟
NFS(Network File System)用于在网络上共享目录,客户端挂载后可像本地磁盘一样读写。本文介绍在 CentOS、Ubuntu 上部署 NFS 服务,以及在各系统下挂载远程 NFS 目录的方法。 1. exports 配置说明 CentOS 与 Ubuntu 服务端均通过 /etc/exports 配置共享目录。每行格式为:共

CentOS 服务器运维实践
· ☕ 2 分钟
整理自「开发 Tips」系列,汇总 CentOS 服务器运维中的常见问题与解决方法。 1. 升级 Docker 版本 卸载旧版本的 Docker 1 2 3 4 5 6 $yum remove docker \ docker-common \ container-selinux \ docker-selinux \ docker-engine \ docker-engine-selinux 保存在 /var/lib/docker/ 的镜像、容器、数据、网络都会被保留。 安装依赖 1 yum install -y yum-utils device-mapper-persistent-data lvm2 安装 Docker 1 2 3 yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo 1 yum makecache fast 1 yum install docker-ce 2. 新

安装 CentOS 之后,需要做的几件事
· ☕ 1 分钟
1. 更换镜像源 首先备份官方的源 1 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 下载新的源到 /etc/yum.repos.d/ CentOS 5 1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo CentOS 6 1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo CentOS 7 1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 生成元数据缓存 1 yum makecache 2. 访问 NTFS 文件系统 Linux 内核目前只支持对微软 NTFS 文件系统的读取。 ntfs-3g 是微软 NTFS 文件系统的一个开源实现,同时支持读和写。 ntfs-3g 在 epel-release 源中,执行命令查

SELinux 和 iptables
· ☕ 6 分钟
最近操作服务器时,遇到了一些不同清楚的概率,查找了一些资料,整理如下。 1. BLP 安全模型 该模型将信息系统中的实体分为两部分: 主体(Subject),实时操作的,如用户和进程 客体(Object),被操作的对象,如文件和数据库等。 对主体和客体来说,有