Author Archives: fencatn

Linux 计划任务之crontab

转载自:https://blog.csdn.net/richerg85/article/details/23442411 cron 简介 cron 是 UNIX, SOLARIS,LINUX 下的一个十分有用的工具。通过 cron 脚本能使计划任务定期地在系统后台自动运行。 cron 命令 crontab -e – 编辑该用户的 crontab,当指定 crontab 不存在时新建。 crontab -l – 列出该用户的 crontab。 crontab -r – 删除该用户的 crontab。 crontab -u<用户名称> – 指定要设定 crontab 的用户名称。 Linux Crontab 格式 表格: Crontab 字段与允许的值 (Linux Crontab) 字段 描述 允许的值 分钟 … Continue reading

Posted in LinuxBasic | Tagged | Leave a comment

centos安装python3

本文转载自 https://towait.com/blog/how-to-install-python3-on-centos/ 感谢原作者 Centos7默认自带了Python2.7版本,但是因为项目需要使用Python3.x你可以按照此文的三个方法进行安装. 注:本文示例安装版本为Python3.5, 一、Python源代码编译安装 安装必要工具 yum-utils ,它的功能是管理repository及扩展包的工具 (主要是针对repository) $ sudo yum install yum-utils 使用yum-builddep为Python3构建环境,安装缺失的软件依赖,使用下面的命令会自动处理. $ sudo yum-builddep python 完成后下载Python3的源码包(笔者以Python3.5为例),Python源码包目录: https://www.python.org/ftp/python/ ,截至发博当日Python3的最新版本为 3.7.0 $ curl -O https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz 最后一步,编译安装Python3,默认的安装目录是 /usr/local 如果你要改成其他目录可以在编译(make)前使用 configure 命令后面追加参数 “–prefix=/alternative/path” 来完成修改。 $ tar xf Python-3.5.0.tgz $ … Continue reading

Posted in python | Tagged | Leave a comment

git提交时报错Updates were rejected because the tip of your current branch is behind

今天我向mirror仓库备份代码的时候出现点问题 [root@XXX YYY]# git push mirror qc Username for ‘http://10.196.12.247’: root Password for ‘http://[email protected]’: To http://10.196.12.247/root/XXX.git ! [rejected] qc -> qc (non-fast-forward) error: failed to push some refs to ‘http://10.196.12.247/root/XXX.git’ hint: Updates were rejected because the tip of your current … Continue reading

Posted in gitlab | Tagged , | Leave a comment

gitlab启用自带的docker registry

gitlab启用自带的docker registry gitlab安装后默认不开启自带的docker registry。 需要修改/etc/gitlab/gitlab.rb文件,修改以下配置 … registry_external_url ‘http://X.X.X.X:4567’ 注意,请不要使用5000端口,因为被gitlab所带的nginx默认占用了。配置前查一遍自己的端口占用情况 … 这里配置不带ssl证书认证的docker registry。修改后执行以下命令重启 sudo gitlab-ctl stop sudo gitlab-ctl reconfigure sudo gitlab-ctl start 安装后随便找个项目都能看到packages-container registry,还能看到各种提示信息,比如登录 docker login X.X.X.X:1234 这个内置的registry的用户名和密码账户与gitlab一致,可以和gitlab-runner 配合,在.gitlab-ci.yaml里使用 我们随便找个镜像nginx来演示推送过程 先把nginx拖下来 [root@gitlab-runner ~]# docker pull nginx Using default tag: latest latest: … Continue reading

Posted in Docker, gitlab | Tagged , | Leave a comment

HTTP/Insecure repository: http: server gave HTTP response to HTTPS client

docker push 报错 HTTP/Insecure repository 很简单,去daemon.json里面把 insecure-registries 加上 /etc/docker/daemon.json { “insecure-registries”: [“10.0.0.15:5000”] } 对于RHEL/CENTOS系列使用systemd的就按如上方法解决 包括自定义私有仓库也是相同的文件: { “insecure-registries”: [ “X.X.X.X:1234” ] } //有多个仓库就用逗号隔开 { “insecure-registries”: [ “X.X.X.X:1234”, “Y.Y.Y.Y:1234” ] }

Posted in Docker | Tagged | Leave a comment

Gitlab报错503

gitlab报错503的情况很多,我记录一下这一次我的排错经历 首先,常规查看gitlab是哪个进程出错了 [root@gitlab ~]# gitlab-ctl status run: alertmanager: (pid 1424) 3121s; run: log: (pid 1423) 3121s down: gitaly: 0s, normally up, want up; run: log: (pid 1392) 3121s run: gitlab-exporter: (pid 1410) 3121s; run: log: (pid 1409) 3121s run: gitlab-workhorse: … Continue reading

Posted in gitlab | Tagged | Leave a comment

GIT命令大全

CREAT(创建) git init 在当前目录下创建一个本(Create a new local repository) git clone  ssh://[email protected]/repo.git 在远程库克隆一个本地库(Clone an existing repository) Configuration(配置) git config [–global] user.name 设置提交时附带的名字(Set the name attached to all your commits) git config [–global] user.email 设置提交时附带的email(Set the email attached to all your commits) … Continue reading

Posted in gitlab | Tagged , | Leave a comment

windows关闭Hyper-v

关闭Hyper-v 我之前在win上面安装了docker,然后发现docker和vmware不能共存,所以卸载了docker,但是又发现安装docker时开启了hyper-v缺没关闭,vmware不能正常启动,按照以下方法可以解决这个问题: 运行命令(以管理员身份来运行) bcdedit /set hypervisorlaunchtype off 完成后检查一下 Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS C:\Windows\system32> bcdedit /enum Windows Boot Manager ——————– identifier {bootmgr} device partition=\Device\HarddiskVolume2 path \EFI\Microsoft\Boot\bootmgfw.efi description Windows Boot Manager locale en-US inherit {globalsettings} default … Continue reading

Posted in 通用 | Tagged , | Leave a comment

AWS的SQS和SNS有什么区别

SNS是分布式发布 – 订阅系统。 当发布者将消息发送给SNS时,消息将被推送给订阅者。 SQS是分布式排队系统。 消息不会被推送到接收者。 接收方必须轮询SQS以接收消息。 多个接收器不能同时接收消息。 任何一个接收器都可以接收消息,处理并删除它。 其他接收器稍后不会收到相同的消息。 与SNS不同,轮询固有地在SQS中引入了一些消息传递延迟,其中消息被立即推送给订户。 SNS支持多个端点,如电子邮件,短信,http端点和SQS。 如果您想要未知的订户数量和类型来接收消息,则需要SNS。 您不必总是将SNS和SQS结合在一起。 除了SQS,您可以让SNS向电子邮件,短信或http端点发送消息。 将SNS与SQS耦合具有优势。 您可能不希望外部服务与主机建立连接(防火墙可能会阻止从外部到主机的所有传入连接)。 你的终点可能会因为大量的消息而死亡。 电子邮件和短信可能不是您快速处理邮件的选择。 通过将SNS与SQS耦合,您可以按照自己的节奏接收消息。 它允许客户端脱机,容忍网络和主机故障。 您也可以保证交货。 如果将SNS配置为将消息发送到http端点或电子邮件或SMS,则若干发送消息失败可能会导致消息被丢弃。 SQS主要用于解耦应用程序或集成应用程序。 消息可以在SQS中存储很短的时间(最多14天)。 SNS向几个订户分发了几个消息副本。 例如,假设您要将应用程序生成的数据复制到多个存储系统。 您可以使用SNS并将此数据发送给多个订阅者,每个订阅者将收到的消息复制到不同的存储系统(s3,主机上的硬盘,数据库等)。 What is the difference between Amazon SNS and Amazon SQS? – Stack … Continue reading

Posted in aws | Tagged , , | Leave a comment

KVM迁移报错the CPU is incompatible with host CPU: Host CPU does not provide required features

KVM启动虚拟机CPU报错,之前已经写过日志,这里说的是如果你实在找不到对应的CPU架构,那就直接选择”host-model” 比如,我之前的配置文件,cpu对应的配置如下: <cpu mode=’custom’ match=’exact’ check=’partial’> <model fallback=’allow’>Skylake-Client</model> <feature policy=’require’ name=’md-clear’/> <feature policy=’require’ name=’spec-ctrl’/> <feature policy=’require’ name=’ssbd’/> </cpu> 这个配置是我创建模板机默认的,现在我把其中一台虚拟机迁移到另外一台主机就报错了 the CPU is incompatible with host CPU: Host CPU does not provide required features: x2apic, hle, rtm, mpx, rdseed, adx, smap, … Continue reading

Posted in kvm | Tagged | Leave a comment