Learn
未读镜像搜索镜像1docker search nginx
这里会列出官方和非官方的镜像列表
拉取/下载镜像123456789# 直接拉取docker pull nginx# 拉取最新版本docker pull nginx:latest# 拉取指定版本镜像docker pull nginx:1.15.8
查看本地镜像1docker images
删除本地镜像12# <id>为镜像的iddocker image rm <id>
备份和恢复镜像123456# 将运行中的容器(修改后)保存为一个镜像docker commit <容器id> <镜像名称># 将镜像存储为一个tar格式的文件(备份)docker save <镜像id> > 1.tar# 读取恢复docker load < 1.tar
运行镜像1234# 运行镜像 -d 为后台运行# -p 指定内外端口映射(外面机器端口:里面机器端口)# 这里的image_name包含了TAG,比如 jira/jira:v7.12.0docke ...
这里是以CentOS 7为例
系统配置目录123/usr/lib/firewalld//usr/lib/firewalld/services/usr/lib/firewalld/zones
用户配置目录123/etc/firewalld//etc/firewalld/services/etc/firewalld/zones
firewall常用命令123456789101112# 启动 停止 重启 状态systemctl start firewalld / service firewalld startsystemctl stop firewalld / service firewalld stopsystemctl restart firewalld / service firewalld restartsystemctl status firewalld / service firewalld status / firewall-cmd --state# 开启/关闭开机自启动systemctl enable firewalldsystemctl disable firewa ...
设置自己的用户和名称12git config --global user.email "lingyunfx@88.com"git config --global user.name "lingyunfx"
查看历史版本1git log
查看当前版本和之前一个版本的差异1git diff <hash>
还原到某个版本还原后默认会直接commit
1git revert <hash>
查看绑定的远程库1git remote -v
绑定远程库1git remote add origin https://github.com/lingyunfx/mytest.git
取消绑定的远程库1git remote rm origin
重命名远程库12# 将origin 改为 destinationgit remote rename origin destination
push到主分支1git push origin main
查看有哪些分支123456# 查看本地分支git branch# 查看远程分支git bran ...
Learn
未读
这里安装的是GitLab社区版(CE),使用的是Centos7系统。
对主机的性能要求:
至少4GB内存
2个CPU内核
5GB以上的存储空间
开始安装安装依赖1curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
安装gitlab软件包1sudo yum install gitlab-ce
开启防火墙需要开启“80”和“443”端口。我这边租用的是腾讯云主机,防火墙策略在前端进行配置,所以跳过这一步。
123sudo firewall-cmd --permanent --zone=public --add-service=httpsudo firewall-cmd --permanent --zone=public --add-service=httpssudo firewall-cmd --reload
配置gitlab打开配置文件
1vim /etc/gitlab/gitlab.rb
先要配置你的url(在此之前完成域名解析) ...
通用命令查看文件大小1du -h /usr/src/xxx.tar
杀死进程1234567killall nginx# 安装yum install psmisc# 在不知道包名称的情况下搜索yum search killall
ssh连接1ssh root@192.168.12.100
添加用户1useradd www
持续输出(用于日志)1tailf access.log
上传文件到远程主机1scp a.jpg index.html root@192.168.10.41:/var/www/html
网络相关常用操作12345678# 查看ipcat /etc/hosts# DNS配置 文件/etc/resolv.conf# 每个网络接口的配置文件/etc/sysconfig/network-script/ifcfg-<interface-name>
设置静态ip1234567891011121314151617# 修改 /etc/sysconfig/network-script/ifcfg-<interface-name># 字符串用引号BOOT ...
注释12# 单行注释:> 多行注释
变量局部变量:在脚本中定义,只在shell实例中生效
环境变量:也就是当前环境变量
变量操作12345678910111213141516# 创建变量(等号两边不能有空格)name="test"# 创建局部变量(只在函数体中使用)local name="test"# 使用变量echo $nameecho ${name}# 创建只读变量(不可被修改)name="only_read"readonly name# 删除变量unset name
字符串变量1234567891011121314# 单引号(保持原字符输出,不支持转义,格式化,单引号中不能出现单独单引号)var='test'# 双引号(可以转义)var="my name is ${name}"# 获取字符串长度,使用#符号name="test"echo ${#name}# 提取字符串(类似于python字符串 ...
这是一份Rez中文文档,供大家学习讨论。作者能力有限,翻译也许有不当的地方,如果发现问题还望指出,感激不尽。原项目地址:https://github.com/nerdvegas/rez
入门主页 (Home)
介绍安装 (Installation)入门 (Getting Started)基础概念 (Basic Concepts)配置 (Configuring Rez)
软件包软件包命令 (Package Commands)软件包定义指南 (Package Definition Guide)变体 (Variants)临时包 (Ephemeral Packages)
RezContextsBundlesSuitesBuilding PackagesCopying PackagesPackage CachingEnvironment Variables
如果文档有所帮助,可以关注这个公众号支持下作者thx!
什么是RezRez是一个跨平台程序包管理器,它可以给程序配置独立的环境。与其它程序包环境管理不同的是,所有的程序包的安装都在一个中央统一的位置,每个独立环境只是引用了这些包。所以它的环境配置是轻量级的,尽管有几百个包,通常也只需要几秒就可以进行配置。
基本原理Rez获取一个包的请求列表,然后构建目标环境,并解决所有包的依赖问题。支持任何软件包。(包括Python)每个软件包都有一个简洁的定义文件(package.py),这个文件用于定义其依赖项,命令,以及其它meatadata信息。
一个python的软件包定义文件:
123456789101112name = "requests"version = "2.8.1"authors = ["Kenneth Reitz"]requires = [ "python-2.7+"]def commands(): env.PYTHONPATH.append("{root}/python")
上述文件所表达的含 ...
下载Source code,然后打开终端进入rez-2.75.0目录中:python ./install.py
默认会安装到 /opt/rez 中,如果需要安装到其它位置,使用install.py -h查看如何安装。
安装成功提示:
12345SUCCESS! To activate Rez, add the following path to $PATH:/opt/rez/bin/rezYou may also want to source the completion script (for bash):source /opt/rez/completion/complete.sh
然后添加环境变量,将/opt/rez/bin/rez 添加到$PATH。对于linux系统,可以运行这个脚本使命令能自动补全:source /opt/rez/completion/complete.sh
文档中也提到可以用pip进行安装:pip install rez
不过这样的安装方式并不能很好的用在生产环境中,因为rez并不只是一个普通的python包。使用install脚本安装 ...
基本软件包安装完成后,需要创建一些基本的Rez软件包。使用rez-bind工具进行创建,这些软件包会引用系统上已经安装的软件。(—quickstart是以标准创建)
12345678910111213141516171819202122]$ rez-bind --quickstartBinding platform into /home/ajohns/packages...Binding arch into /home/ajohns/packages...Binding os into /home/ajohns/packages...Binding python into /home/ajohns/packages...Binding rez into /home/ajohns/packages...Binding rezgui into /home/ajohns/packages...Binding setuptools into /home/ajohns/packages...Binding pip into /home/ajohns/packages...Successfully ...