解决crontab报错Authentication token is no longer valid

一、现象 一台主机大部分用户使用crontab是正常的,其中一个用户使用时报错,具体内容如下: 1[[email protected] ~]$ crontab -e 2Authentication token is no longer valid; new one required 3You (oracle) are not allowed to access to (crontab) because of pam configuration. 二、解决 由于上面报错中有提到pam,先看了这台的pam配置,未发现针对个别用户的配置,/etc/crontab.deny中也未指定不允许……

Continue reading

grub2下grub.cfg丢失修复

这里使用centos7/rhel7做测试,我们直接将/boot/grub2/grub.cfg文件删除或移到其他地方,重启后,主机的进入如下界面。 此时可以通过ls或ls -l指令查看磁盘相关信息。查看到的结果如下: 上面的输出中hd0代表第一块磁盘,msdos1和msdos2分表磁盘的……

Continue reading

将多条 COPY 指令合并为一条

在编写 Dockerfile 时,我们可能需要将多条指令合并成一行,这样语法简洁,并且可以减少镜像层数。 将多条 COPY 指令合并为一条 比如,我们的 Dockerfile 里面有这样的语句: 1FROM python:2.7-stretch 2WORKDIR /xdhuxc/ 3COPY dingtalk_callback.py /xdhuxc/ 4COPY requirements.txt /xdhuxc/ 5COPY settings.py /xdhuxc/ 6RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple 7ENTRYPOINT ["python", "-u", "/xdhuxc/dingtalk_callback.py"] 我们想把多个 COPY 指令合并成一条,可以改写该 Dockerfile 为如下形式: 1FROM python:2.7-stretch 2WORKDIR /xdhuxc/ 3COPY dingtalk_callback.py requirements.txt settings.py /xdhuxc/ 4RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple 5ENTRYPOINT ["python", "-u", "/xdhuxc/dingtalk_callback.py"] 或……

Continue reading

构建Redis Docker镜像

我们手写一枚Redis镜像Dockerfile,来理解与实践CMD与ENTRYPOINT。 1# Dockerfile - Redis 5.0.5 2# ================================ 3# Using Base OS -> CentOS 7 Latest 4# ================================ 5FROM centos:latest 6# ============================================= 7# LABEL following the standard set of labels by 8# The Open Containers Initiative (OCI) 9# ============================================= 10LABEL org.opencontainers.image.title="DockerImage - Redis" \ 11 org.opencontainers.image.version="1.0.0" \ 12 org.opencontainers.image.licenses="MIT" \ 13# ============================================================== 14RUN PKG_BASE_DEPS="epel-release \ 15 make \ 16 gcc \ 17 gcc-c++" && \ 18 REDIS_PKG_PATH="/root/redis-5.0.5.tar.gz" && \ 19 REDIS_PKG_ROOT="/root/redis-5.0.5/" && \ 20 REDIS_PKG_INSTALLED="/opt/redis_5.0.5/" && \ 21 REDIS_PKG_URL="http://download.redis.io/releases/redis-5.0.5.tar.gz" && \ 22 cp "/usr/share/zoneinfo/Asia/Shanghai" "/etc/localtime" && \ 23 echo "Asia/Shanghai" > "/etc/timezone" && \ 24 yum……

Continue reading

Docker小结(四)ENTRYPOINT和CMD

尽管ENTRYPOINT和CMD都是在docker image里执行一条命令, 但是他们有一些微妙的区别. 在绝大多数情况下, 你只要在这2者之间选择一个调用就可以. 但他们有更高级的应用, CMD和ENTRYPOINT组合起来使用, 完成更加丰富的功能. 从根本上说, ENTRYPOINT和CM……

Continue reading

Docker小结(三)配置mysql数据库

一、Dockerfile 1FROM centos:7.2.1511 2MAINTAINER yangbk 3ENV DATA_DIR /var/lib/mysql 4ENV http_proxy 10.212.186.250:3128 5# Install Mariadb 6RUN yum install -y mariadb mariadb-server && \ 7 yum clean all 8ADD mysqld_charset.cnf /etc/my.cnf.d/ 9COPY scripts /scripts 10RUN chmod +x /scripts/start 11EXPOSE 3306 12VOLUME ["/var/lib/mysql"] 13ENTRYPOINT ["/scripts/start"] 该代码使用文件已上传到:https://github.com/361way/docker/tree/master/mysql ,这里有注意下VOLUME命令,该命令的作用是映射……

Continue reading

利用Flask-Mail开发邮件API

之前也写过python smtplib发送邮件 ,其是基于smtpmlib模块写的应用,这里是想利用flask写一个简单的API ,具体的应用场景是,假如一个局域网环境中,只有一台主机可以上外网外发邮件。其他主机不可以上外网。该主机启动一个flask API邮件外发服务,其他主机需要发送……

Continue reading

selenium之webdriver页面元素定位

进行Web页面自动化测试,对页面上的元素进行定位,继而再进行click操作或数据提交。可以跟据页面上有各种属性进行定位,比如元素名字,元素id,元素属性(class属性,name属性)等等。webdriver就是利用元素的这些属性来进行定位的。可以用于定位的常用的元素属性: id、……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI Alpine Android Anpic Ansible Apache Apm Apparmor Appfog Apr Apt-Get Aria2 Array Atlassian Atop Audit Awk AWS Awstats Axel Azure Backdoor Backup Bamboo Bash Bat Benchmark Bigdata Bin Bind Bitwise Blockchain BMC Book Bootstrap Brocade Bsd C1000 Cache Capistrano Catlog CDH5 Centos Centos7 Chatops Chattr Check_mk Checkinstall Cisco CL210 Clickhouse Cloud Cloud-Desktop Cmdb Cms Cobbler Collectd Comm Compress Confd Conver Corosync Cpu Crontab Crunchbang Css Curl C语言 Date DDOS Decode Dell Desktop Devops Df Dhcp Diff Diskpart DISTINCT Django DNS Docker Dos2unix Dpkg Drupal Duckdb EKS ELK Etcd Excel Fail2ban Fastcgi Fdisk Fiddler Find Firewalld Flask Flvtool Ftp Function Fuser GCP Geek Ghost Gin Git Github Gitlab Glances Glusterfs Go Godaddy Golang Google Gooupadd Grafana Graphviz Gravatra Grep Grub2 Hadoop Haproxy Hardware HBA HCIE Heartbeat Helm Hexdump Hhvm History Hotspot Html Http/Html/Web Http/Html/Web Httplogs Https HttpWatch Huawei Huaweicloud Hugo IBM Icmp Iconv Ifconfig IIS InfluxDB Ingress InnoDB Inotify Iopp IOS Ipmitool Iptables Iredmail Iscsi Isito It-News Java JavaScript Jdk Jenkins Jinja2 Jira Join Joomla K3s K8s Kdump Keepalived Kernel Kingate KVM Lamp Last Leetcode Lib Linux Linux高级篇 Ln Ls Lsi Lsof Lvm Lvs Mac Mail Man Mark Markdown Matplotlib Maven Memcached Microservice Mimikatz Mkdocs Mkpasswd Mmonit Mod_jk Mongodb Monit Monitor Mono Moodle Mosh Mount Mplayer Mpm Mrtg Mtr My.cnf Mysql Mysqlbinlog Mysqld_multi MySQLdb Mysqldump Mysqlhotcopy Nagios Nc Nethogs Netlify Nexus Nfs Nginx Nmon Nocatlog Node.js Nrpe Ntfs Ntop Ntp Obs Ocr Open-Falcon Openbox Opencv Openldap OpenResty Openssl Openstack Oracle Oswatch Paas Pacemaker Pam Pandas Parted Pcp Pcre Pdf Percona Perl Pexpect Pgrep Php Php-Fpm Ping Plsql Develope PM Postfix PostgreSQL Powershell Prettify Proc Prometheus Puppeteer Pushd Pwgen Pxe Pyecharts Python Python模块 QoS Radmin Raid Rdesktop Read Redhat Redis Redmine Regex Rh134 RH318 RH442 RHCA RHCE Rhel7 Rhel8 RHEV Rm Rman Rootkit Route Rpm Rpmforge Rrdtool RSA Rsync Rsyslog Safe Saltstack Samba Scapy Screen SecureCRT Sed Selenium Selinux Seo Seq Session Set Shc Sheepdog Shell Shopt Sitemap Skydns Smokeping Snffier Snmp Socket Soft Sort Spider Sql Sqlserver Squid SRE Ss Ssh Sshpass Statuscode Strace Strings Su SublimeText2 Sudo Suse Svn Sysbench Syslog-Ng Sysstat Systemd T Tar TC Tcpcopy Tcpdump Tech Telecom Telnet Tencentcloud Tengine Test Testlink Threads Time Tmux Tomcat Touch Tr Tsar Twisted Ubuntu Udev Ulimit Unix Unixbench User-Agent Useradd Varnish VBA Vbs Vercel Vi Vim Visudo Vmstat Vmware Vnc Voice Vpn Vscode Vsftp Vsftpd Vue Watchdog Web Webcam Webistrano Wget Wiki Windows Wol Wordpress Workshop Wsl X-Windows Xampp Xcache Xmllint Xtrabackup Yule Yum Zabbix Zeromq Zip Zonetime Zookeeper 下载工具 云主机 云原生 代理 加密 古意 吐槽 圈里圈外 娱乐 字符串函数 安全 平台架构 推理 提权 故事汇 故障案例 数据结构 每日看点 民国史 生活 科学记录 站长管理工具 算法 管理 网站架构 翻墙 股票 行业 诗韵 负载均衡 远程管理 面试题

Links

Meta