![个人头像照片](https://ucc.alicdn.com/avatar/img_5f88c6a7337543d2c7c753b8aef2b476.jpg)
国企运维
这篇文章主要介绍了Linux下实现免密码登录的相关资料,非常不错,具有参考借鉴价值,感兴趣的朋友一起看看吧 /etc/ssh/sshd_config要允许root远程登录:PermitRootLogin yes 1.
linux定时执行脚本 阅读目录 1. cron服务【Ubuntu环境】 2. crontab用法 3. 编辑crontab文件 4. 流程举例 5. 几个例子 Linux中,周期执行的任务一般由cron这个守护进程来处理。
版权声明:本文为博主原创文章,未经博主允许不得转载。 我就看了几天的python。这个作为练习,若有错误,望指出。 就是基于socket,每个端口去连一下能返回信息就是开启的。
Clam AntiVirus(Clam AV)是一个免费而且开放源码的防毒软件,软件与病毒库的更新由开源社区免费发布,目前ClamdAV主要为Linux、Uinux系统提供病毒扫描查杀pyClamad是一个python的第三方模块,可让python直接使用ClamAV病毒扫描守护进程clamd来实现一个高效的病毒检测功能。
1.窃取Email认证 1.1创建一个简单的嗅探器,捕获一个数据包,packet.show()函数解析了其中的协议信息并输出了包的内容。 from scapy.
rrdtool(round robin database)工具为环状数据库的存储格式,round robin是一种处理定量数据以及当前元素指针的技术。rrdtool主要用来跟踪对象的变化情况,生成这些变化的走势图,比如业务的访问流量、系统性能、磁盘利用率等趋势图,很多流行监控平台都使用到rrdtool,比较有名的为Cacti、Ganglia、Monitorix等。
一、使用XlsxWriter模块生成Excel表格 安装XlsxWriter模块 pip2.7 install xlsxwriter 官网:http://xlsxwriter.
使用Python 2.7中pycurl模块编写探测多节点Web服务质量脚本 pycurl安装与说明 pycurl说明 PycURl是一个C语言写的libcurl的python绑定库。
coding: utf-8 import smtplib from email.mime.multipart import MIMEMultipart #导入MIMEMultipart类 from email.
coding: utf-8 import smtplib from email.mime.multipart import MIMEMultipart #导入MIMEMultipart类 from email.
coding: utf-8 import smtplib from email.mime.text import MIMEText #导入MIMEText类 HOST = "smtp.
ilecmp可以实现文件,目录,遍历子目录的差异对比功能。 自带filecmp模块,无需安装。 常用方法说明 filecmp提供3个操作方法,cmp(单文件对比),cmpfile(多文件对比),dircmp(目录对比). 单文件对比,filecmp.cmp(f1,f2[,shallow]) f1 f2为文件,相同True,不同False,shallow默认为True,只根据os.stat()方法返回的文件基本信息进行对比。
!/usr/bin/python import difflib import sys try: textfile1=sys.argv[1] #第一个配置文件路径参数 textfile2=sys.
!/usr/bin/python import difflib text1 = """text1: #定义字符串1 This module provides classes and functions for comparing sequences.
DNS处理模块dnspython 下载地址http://www.dnspython.org/kits/1.12.0/ dnspython提供一个DNS解析器类——resolver,使用它的query方法来实现域名的查询功能。
!/usr/bin/python * coding:utf-8 * Filename:dns5.py import dns.resolver import os import httplib iplist=[] appdomain="www.
安装 先下载源码,地址:ps://pypi.python.org/pypi/IPy/">https://pypi.python.org/pypi/IPy/ ,然后解压后使用命令python setup.py install安装。
一、psutil模块 1. psutil是一个跨平台库(http://code.google.com/p/psutil/),能够轻松实现获取系统运行的进程和系统利用率(包括CPU、内存、磁盘、网络等)信息。
CentOS release 6.8 (Final) 构建DNS主从服务器。 主服务器:192.168.18.42 从服务器:192.168.18.41 一般而言,DNS服务器配置流程主要分为3步: (1)建立主配置文件named.
vim /etc/named.conf options { directory "/var/named"; dump-file "/var/named/data/cache_dump.
/etc/nsswitch.conf 决定是先使用/etc/hosts 还是 /etc/resolv.conf
cp /etc/named.conf /etc/name.conf.raw vim /etc/named.conf options { listen-on port 53 { any; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.
1、firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disable firewalld 禁用: systemctl stop firewalld 2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
1、yum install -y bind bind-utils bind-chroot bind-libs; 2、其中:/etc/named.conf 为主配置文件;/var/named 为解析文件 3、客户端的dns查询时的配置文件 /etc/hosts 默认优先查询这个 /etc/resolv.
tail -50 /var/log/messages
Linux修改主机名,永久生效。 linux查看主机名: 查看主机命令: [root@linux_epm2 ~]# hostname localhost.localdomain localhost.localdomain即为默认的主机名。
!/bin/bash rest=fping $1 te="is alive" if [[ $rest =~ $te ]] then echo fping $1 -A -a else echo "0" fi
代码编辑器的展开和折叠代码确实很方便和实用。以下是展开代码和折叠代码所用到的快捷键,很常用: Ctrl + M + O: 折叠所有方法 Ctrl + M + M: 折叠或者展开当前方法 Ctrl + M + L: 展开所有方法 工具箱的的不见的问题:...
HtmlElement name = webBrowser1.Document.GetElementById("ctl00$content$loginname"); if (name != null) name.
比如我是 su apache的时候出现的问题 用vi看看 apache的帐号信息 cat /etc/passwd | grep apache 发现它的shell是“/sbin /nologin”,需要将起改成“/bin/bash” vipw /etc/...
通常情况下, 当出现失败时 Ansible 会停止在宿主机上执行.有时候,你会想要继续执行下去.为此 你需要像这样编写任务: name: this will not be counted as a failure command: /bin/fals...
1、vi changpass.yml hosts: lqtapi gather_facts: false tasks: name: chattr -i shell: chattr -i /etc/shadow name: copy ssh key...
第一种:/usr/bin/passwd 的权限中没有添加s即SUID特殊权限 即:-rwxr-xr-x. 1 root root 27000 8月 22 2010 /usr/bin/passwd 解决方案:chm...
1、Linux对应的密码策略模块有:pam_passwdqc 和 pam_pwquality 。其中pam_passwdqc模块对应的是/etc/login.
ansible 172.20.70.50 -m authorized_key -a "user=root state=present key"{{lookup('file','/root/.
ansible all -m raw -a "echo 'my_root_new_password' | passwd --stdin root"
wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate tar -xzvf pip-1.
1、控制机上执行:ssh-keygen 2、一路回车 3、vi rsync_key.yml hosts: all gather_facts: false tasks: name: copy ssh key authorized_key: user: root key: "{{ lookup('file', '/root/.
using System.Net; string clientIP = Request.UserHostAddress;//获取客户端的IP主机地址 IPHostEntry hostEntry = Dns.
添加引用System.Management using System; using System.Collections.Generic; using System.
public string StartService(string serviceName, bool serviceFlag) { try { using (System.
string str = Console.ReadLine(); System.Diagnostics.Process p = new System.
using …… using …… using System.Diagnostics; //启用进程 void process() { Process p;//实例化一个Process对象 p=Process.
一、安装服务: private void InstallService(IDictionary stateSaver, string filepath) { try { System.
#!/bin/bash # zabbix server 或 zabbix proxy IP,根据实际情况设置 SERVER_IP="172.20.50.
using System; using System.Collections.Generic; using System.Text; using System.
/// /// 输出指定信息到文本文件 /// ///文本文件路径 ///输出信息 public void WriteMessage(string path,string msg) ...
if (Directory.Exists(oldPath)) { Directory.Move(oldPath, path); if (OADBHelper.
static void CopyFile(string sources, string dest) { DirectoryInfo dinfo = new DirectoryInfo(sources); ...
1、添加应用程序清单:app.manifest 2、把requestedExecutionLevel改成: