md5sum

MD5和GPG

|▌冷眼眸甩不掉的悲伤 提交于 2020-04-29 22:11:59
信息摘要 MD5 [root@node-0001 ~]# echo dongxia > oschina1.txt [root@node-0001 ~]# md5sum oschina1.txt #查看校验值 c36d69f447d005e04a962e7f626146be oschina1.txt [root@node-0001 ~]# cp oschina1.txt oschina2.txt [root@node-0001 ~]# md5sum oschina* #查看两个文件 c36d69f447d005e04a962e7f626146be oschina1.txt c36d69f447d005e04a962e7f626146be oschina2.txt #复制的文件和原文件校验值相同 [root@node-0001 ~]# echo linux >> oschina1.txt #更改文件 [root@node-0001 ~]# md5sum oschina* c08075609fa5c6fdfe85c0e81e82e9f8 oschina1.txt #校验值改变 c36d69f447d005e04a962e7f626146be oschina2.txt GnuGP 最流行的数据加密 数据签名工具 官网 http://gnupg.org [root@node-0001 ~]#

linux手动安装配置 mysql5.7

北城余情 提交于 2020-04-29 18:55:50
本文原出处地址 https://www.cnblogs.com/mujingyu/p/7689116.html 一、安装前的检查    1.1 检查 linux 系统版本     [root@localhost ~]# cat /etc/system-release       说明:小生的版本为 linux 64位:CentOS Linux release 7.4.1708 (Core)    1.2 检查是否安装了 mysql     [root@localhost ~]# rpm -qa | grep mysql       若存在 mysql 安装文件,则会显示 mysql安装的版本信息         如:mysql-connector-odbc-5.2.5-6.el7.x86_64       卸载已安装的MySQL,卸载mysql命令,如下:         [root@localhost ~]# rpm -e --nodeps mysql-connector-odbc-5.2.5-6.el7.x86_64       将/var/lib/mysql文件夹下的所有文件都删除干净。      细节注意:       检查一下系统是否存在 mariadb 数据库,如果有,一定要卸载掉,否则可能与 mysql 产生冲突。       小生的系统安装模式的是最小安装

Python3之hashlib

蹲街弑〆低调 提交于 2020-04-27 18:40:41
Python3之hashlib 原文链接 简介:   用于加密相关的操作,代替了md5模块和sha模块,主要提供SHA1,SHA224,SHA256,SHA384,SHA512,MD5算法。 在python3中已经废弃了md5和sha模块,简单说明下md5和sha的使用。   什么是摘要算法呢?   摘要算法又称为哈希算法,散列算法。它通过一个函数,把任意长度的数据转换为一个长度固定的数据串(通常用16进制的字符串表示)用于加密相关的操作。 md5加密 hash = hashlib . md5 () hash . update ( 'admin' . encode ( 'utf-8' )) print ( hash . hexdigest ()) 21232 f297a57a5a743894a0e4a801fc3 sha1加密 hash = hashlib . sha1 () hash . update ( 'admin' . encode ( 'utf-8' )) print ( hash . hexdigest ()) d033e22ae348aeb5660fc2140aec35850c4da997 sha256加密 hash = hashlib . sha256 () hash . update ( 'admin' . encode ( 'utf-8' )) print (

linux中find命令的使用详解(转载)

岁酱吖の 提交于 2020-04-24 20:29:47
常用命令 find (目录) [-type d | f] (文件夹 | 文件) -name (名称,可使用正则表达式) find /root -name "*core" find /root -type d -name "*core" 文件夹 find /root -type f -name "*core" 文件 find /root -type f -path "*core" 路径 find /root -name "*core" -delete 查到后删除 find /root -size +20M (-20M) 大于20M(小于20M) find /root -name "*core" -exec ls {} \; 对查找后的文件执行ls操作 壹——主要内容 1. 用文件名查找文件 2.用文件名查找文件,忽略大小写 3. 使用mindepth和maxdepth限定搜索指定目录的深度 4. 在find命令查找到的文件上执行命令 5. 相反匹配 6. 使用inode编号查找文件 7. 根据文件权限查找文件 8. 找到home目录及子目录下所有的空文件(0字节文件) 9. 查找5个最大的文件 10. 查找5个最小的文件 11. 使用-type查找指定文件类型的文件 12. 通过和其他文件比较修改时间查找文件 13. 通过文件大小查找文件 14. 给常用find操作取别名 15.

day14:输入数字执行命令|批量创建用户|检测nginx 进程数大于500告警|web服务器日记访问高IP禁掉|找规律

给你一囗甜甜゛ 提交于 2020-02-29 22:33:22
1、写一个脚本, 输入数字后执行对应命令 : 1 date 2 ls 3 who 4 pwd 难点:在于用read -p 来采集用户的数据,然后用 case 循环来判断; [root@localhost_002 shell100]# cat 9.sh #!/bin/bash echo "cmd meau** 1 - date 2 - ls 3 - who 4 - pwd" read -p "please input a number1-4: " n if [ -z "$n" ] then echo "The value empty" exit fi n1=`echo $n|sed 's#[0-9]##g'` if [ -n "$n1" ] then echo "you is not number;" exit fi case $n in 1) date ;; 2) ls ;; 3) who ;; 4) pwd ;; *) echo "you is not 1-4;" ;; esac [root@localhost_002 shell100]# sh 9.sh cmd meau** 1 - date 2 - ls 3 - who 4 - pwd please input a number1-4: 2 1 1.txt 3.sh 4.sh 5.sh 6.sh 7.sh 8_1.sh 8

SELL脚本工具:linux下监听scp传输文件,传输成功后打印新上传文件名

孤者浪人 提交于 2020-01-07 00:21:51
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> #! /usr/bin/expect #!/bin/bash PROC_NAME="scp" ProcNumber=`ps -ef |grep $PROC_NAME|grep -v grep|wc -l` if [ $ProcNumber -le 0 ];then result=0 else result=1 fi #echo ${result} if [ $result -eq 1 ];then echo "has file in transit.." while true do ProcNumber=`ps -ef |grep $PROC_NAME|grep -v grep|wc -l` if [ $ProcNumber -le 0 ];then echo "download finish!" break else sleep 7 fi done else echo "no file in transit!" fi checkroot="/home/lxh/aa/" cp /dev/null rsync_file if [ ! -f file.md5 ];then find $checkroot -type f -exec md5sum {} \; >>file.md5 else for file in $

bash, md5sum behaves strange

本小妞迷上赌 提交于 2020-01-02 17:34:49
问题 Why is this different? text="tralala" echo -n $text | md5sum - result: def7d827536761c20f449f69262ff20f echo -n "tralala" | md5sum - result : 7e4ef92d1472fa1a2d41b2d3c1d2b77a what am I doing wrong? 回答1: I suspect you mistakenly did not provide the -n (output no newline) flag to echo. See sample from my machine below: $ echo tralala | md5sum def7d827536761c20f449f69262ff20f - $ echo -n tralala | md5sum 7e4ef92d1472fa1a2d41b2d3c1d2b77a - $ text="tralala" $ echo $text | md5sum

diff files comparing only first n characters of each line

折月煮酒 提交于 2020-01-01 07:52:48
问题 I have got 2 files. Let us call them md5s1.txt and md5s2.txt. Both contain the output of a find -type f -print0 | xargs -0 md5sum | sort > md5s.txt command in different directories. Many files were renamed, but the content stayed the same. Hence, they should have the same md5sum. I want to generate a diff like diff md5s1.txt md5s2.txt but it should compare only the first 32 characters of each line, i.e. only the md5sum, not the filename. Lines with equal md5sum should be considered equal. The

How could I write a Perl script to calculate the MD5 sum of every file in a directory? [closed]

穿精又带淫゛_ 提交于 2019-12-22 10:44:02
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Is there any way to write a Perl script to calculate the MD5sum of every file in a directory? If so, how could I do this? 回答1: Well there are many ways to do this but it comes down to two operations you need to preform. You will first need to locate a list of the files you would like to run the check and then