页面“Diff”与“Django google authenticator”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
(导入1个版本)
 
(导入1个版本)
 
第1行: 第1行:
 +
=google-authenticator client=
  
diff 命令是 linux上非常重要的工具,用于比较文件的内容,特别是比较两个版本不同的文件以找到改动的地方。diff在命令行中打印每一个行的改动。最新版本的diff还支持二进制文件。diff程序的输出被称为补丁 (patch),因为Linux系统中还有一个patch程序,可以根据diff的输出将a.c的文件内容更新为b.c。diff是svn、cvs、git等版本控制工具不可或缺的一部分。
+
==安装==
  
==命令格式==
+
这个不用说啦  play 商店中 找 google 身份验证器.我的手机是android 7
用法:diff [选项]... 文件们
 
逐行比较<文件们>。
 
  
  
==命令功能==
+
== config==
diff命令能比较单个文件或者目录内容。如果指定比较的是文件,则只有当输入为文本文件时才有效。以逐行的方式,比较文本文件的异同处。如果指定比较的是目录的的时候,diff 命令会比较两个目录下名字相同的文本文件。列出不同的二进制文件、公共子目录和只在一个目录出现的文件。
+
添加 ==> 输入提供的密钥  记得要保存好你的密钥哦
  
==常用命令参数 ==
 
<pre>
 
# 一般我常用的命令就这前面几个
 
-r或--recursive  比较子目录中的文件。
 
-b或--ignore-space-change  不检查空格字符的不同。
 
-a或--text  diff预设只会逐行比较文本文件。
 
-c  显示全部内文,并标出不同之处。
 
-x或--exclude  不比较选项中所指定的文件或目录。
 
  
 +
=google-authenticator server=
  
- 指定要显示多少行的文本。此参数必须与-c或-u参数一并使用。
+
=设想=
 +
可以加个不回显示的验证码,哈哈 笑死
  
-B或--ignore-blank-lines  不检查空白行。
+
=参考=
-C或--context  与执行"-c-"指令相同。
 
-d或--minimal  使用不同的演算法,以较小的单位来做比较。
 
-D或ifdef  此参数的输出格式可用于前置处理器巨集。
 
-e或--ed  此参数的输出格式可用于ed的script文件。
 
-f或-forward-ed  输出的格式类似ed的script文件,但按照原来文件的顺序来显示不同处。
 
-H或--speed-large-files  比较大文件时,可加快速度。
 
-l或--ignore-matching-lines  若两个文件在某几行有所不同,而这几行同时都包含了选项中指定的字符或字符串,则不显示这两个文件的差异。
 
-i或--ignore-case  不检查大小写的不同。
 
-l或--paginate  将结果交由pr程序来分页。
 
-n或--rcs  将比较结果以RCS的格式来显示。
 
-N或--new-file  在比较目录时,若文件A仅出现在某个目录中,预设会显示:Only in目录:文件A若使用-N参数,则diff会将文件A与一个空白的文件比较。
 
-p  若比较的文件为C语言的程序码文件时,显示差异所在的函数名称。
 
-P或--unidirectional-new-file  与-N类似,但只有当第二个目录包含了一个第一个目录所没有的文件时,才会将这个文件与空白的文件做比较。
 
-q或--brief  仅显示有无差异,不显示详细的信息。
 
  
-s或--report-identical-files  若没有发现任何差异,仍然显示信息。
+
[http://jungor.me/?p=547  最好的可以直接代码之Django + Google Authenticator]
-S或--starting-file  在比较目录时,从指定的文件开始比较。
 
-t或--expand-tabs  在输出时,将tab字符展开。
 
-T或--initial-tab  在每行前面加上tab字符以便对齐。
 
-u,-U或--unified=  以合并的方式来显示文件内容的不同。
 
-v或--version  显示版本信息。
 
-w或--ignore-all-space  忽略全部的空格字符。
 
-W或--width  在使用-y参数时,指定栏宽。
 
  
-X或--exclude-from  您可以将文件或目录类型存成文本文件,然后在=中指定此文本文件。
+
[https://medium.com/@jainsahil1997/simple-google-authentication-in-django-58101a34736b Simple Google Authentication in Django]
-y或--side-by-side  以并列的方式显示文件的异同之处。
 
--help  显示帮助。
 
--left-column  在使用-y参数时,若两个文件某一行内容相同,则仅在左侧的栏位显示该行内容。
 
--suppress-common-lines  在使用-y参数时,仅显示不同之处。
 
</pre>
 
  
 +
[https://zh.wikipedia.org/wiki/Google%E8%BA%AB%E4%BB%BD%E9%AA%8C%E8%AF%81%E5%99%A8 Google身份验证器]
  
==举例==
+
https://pypi.python.org/pypi/django-google-authenticator
<pre>
 
#我的常用例子
 
diff -r  -c -a -b ad_admin/ /data4/ad_admin/
 
  
假如我要比较目录A和目录B,使用下面的命令
+
https://github.com/Bouke/django-two-factor-auth
diff -c -a -b -x *.bak -x *.log A B > AB.diff
 
gvim AB.diff
 
    这样就可以方便的查看不同了,目前我的vim的diff配色比较舒适。
 
    解释一下参数的意义
 
    -c 采用content的format输出different
 
    -a 强制使用text的模式
 
    -b 忽略空白的不同
 
    -x 过滤掉所比较目录中一些不想比较的文件类型,可以使用其他的pattern
 
    实际上如果需要过滤的文件类型比较多的时候,使用-x这个选项就有点麻烦了,查看了文档之后,diff提供了更加方便的参数过滤文件。 
 
    -X excludefile 忽略在excludefile中的文件类型,注意每种文件占一行
 
    这个参数实际上在使用dos的命令行xcopy的时候也是有用过的。
 
xcopy /E /C /Y /Exclude:file srcdir destdir
 
  
比较目录及目录的文件:
 
  
</pre>
 
  
 +
https://github.com/gnosis/django-google-authenticator
  
== 比较有意思的用法==
 
<pre>实例:比较两个文件不同,并生产补丁
 
命令:
 
diff -ruN log2013.log log2014.log >patch.log
 
输出:
 
[root@localhost test3]# diff -ruN log2013.log log2014.log >patch.log
 
[root@localhost test3]# ll
 
总计 12
 
-rw-r--r-- 2 root root  80 12-07 16:36 log2013.log
 
-rw-r--r-- 1 root root  96 12-07 18:01 log2014.log
 
-rw-r--r-- 1 root root 248 12-07 21:33 patch.log
 
[root@localhost test3]# cat patc.log
 
cat: patc.log: 没有那个文件或目录
 
[root@localhost test3]# cat patch.log
 
--- log2013.log 2012-12-07 16:36:26.000000000 +0800
 
+++ log2014.log 2012-12-07 18:01:54.000000000 +0800
 
@@ -1,10 +1,12 @@
 
2013-01
 
2013-02
 
-2013-03
 
+2014-03
 
2013-04
 
2013-05
 
2013-06
 
2013-07
 
-2013-08
 
+2013-07
 
2013-09
 
2013-10
 
+2013-11
 
+2013-12[root@localhost test3]#
 
说明:
 
实例7:打补丁
 
命令:
 
输出:
 
[root@localhost test3]# cat log2013.log
 
2013-01
 
2013-02
 
2013-03
 
2013-04
 
2013-05
 
2013-06
 
2013-07
 
2013-08
 
2013-09
 
2013-10[root@localhost test3]# patch log2013.log patch.log
 
patching file log2013.log
 
[root@localhost test3]#
 
[root@localhost test3]# cat log2013.log
 
2013-01
 
2013-02
 
2014-03
 
2013-04
 
2013-05
 
2013-06
 
2013-07
 
2013-07
 
2013-09
 
2013-10
 
2013-11
 
</pre>
 
  
  
== 其它常用命令==
 
cmp 比较两个文件,并指出它们是否不同及不同的字节。
 
  
diff 比较两个文件或目录,并指出哪些文件的哪些行不同。
+
[https://www.jianshu.com/p/6c751ddbbc7c 谷歌身份验证使用教程及失效详解]
  
diff3 逐行比较三个文件。
+
[https://help.aliyun.com/document_detail/28669.html 安卓版Google Authenticator安装及使用指导]
  
sdiff 合并两个文件,并以交互方式输出结果。
+
[https://gadgets.ndtv.com/apps/features/google-authenticator-app-gmail-account-two-factor-security-1684339 How to Use Google Authenticator App to Secure Your Gmail Account ]
 +
[https://www.jianshu.com/p/5806ff9c0cc5 在Django中定制身份验证]
  
vimdiff 使用vim同时编辑一个文档的2或3个版本并显示他们的区别使用。
+
[https://support.google.com/accounts/troubleshooter/4430955?hl=zh-Hans#ts=4430956 google使用新手机接收两步验证码]
  
comm 一行一行对两个已经排序的文件进行比较,在第三列中显示同一行是否相同。
+
[https://www.google.com/landing/2step/#tab=how-it-works 增强 Google 帐户的安全性]
  
==参考==
+
[https://www.howtoing.com/secure-ssh-with-google-authenticator-on-centos-7 CentOS 7上使用Google Authenticator双重身份验证保护SSH安全]
每天一个linux命令(36):diff 命令
 
http://www.cnblogs.com/peida/archive/2012/12/12/2814048.html
 
  
linux下文件对比工具详解(diff、diff3、sdiff、vimdiff和comm)
+
[https://www.freehao123.com/two-factor-authentication/ WordPress和VPS利用Google Authenticator两步验证]
http://blog.csdn.net/miltonzhong/article/details/9670771
 
  
Linux diff比较文件的差异命令详解
+
[https://django-two-factor-auth.readthedocs.io/en/stable/index.html Django Two-Factor Authentication Documentation]
https://www.centos.bz/2011/09/linux-diff/
 
  
vim比较目录diff
+
[https://teakki.com/p/5929371e6e5c97852743d7e7 在Django中自定义身份验证]
http://littlewhite.us/archives/290
 
  
[[category:shell]] [[category:ops]]
+
 
 +
 
 +
 
 +
== github上的GoogleAuthenticator ==
 +
 
 +
https://github.com/collective/collective.googleauthenticator
 +
 
 +
https://github.com/shinsaka/googleauthenticator_demo
 +
 
 +
https://github.com/cqf539/GoogleAuthenticator
 +
 
 +
https://github.com/gnosis/django-google-authenticator
 +
 
 +
==google 验证 ==
 +
 
 +
[http://www.williamlong.info/archives/2754.html Google两步验证安装使用方法]
 +
 
 +
[https://www.zhihu.com/question/20462696 谷歌验证 (Google Authenticator) 的实现原理]
 +
 
 +
[[category:django]]

2019年10月14日 (一) 13:48的最新版本

google-authenticator client

安装

这个不用说啦 play 商店中 找 google 身份验证器.我的手机是android 7


config

添加 ==> 输入提供的密钥  记得要保存好你的密钥哦


google-authenticator server

设想

可以加个不回显示的验证码,哈哈 笑死

参考

最好的可以直接代码之Django + Google Authenticator

Simple Google Authentication in Django

Google身份验证器

https://pypi.python.org/pypi/django-google-authenticator

https://github.com/Bouke/django-two-factor-auth


https://github.com/gnosis/django-google-authenticator



谷歌身份验证使用教程及失效详解

安卓版Google Authenticator安装及使用指导

How to Use Google Authenticator App to Secure Your Gmail Account 在Django中定制身份验证

google使用新手机接收两步验证码

增强 Google 帐户的安全性

CentOS 7上使用Google Authenticator双重身份验证保护SSH安全

WordPress和VPS利用Google Authenticator两步验证

Django Two-Factor Authentication Documentation

在Django中自定义身份验证



github上的GoogleAuthenticator

https://github.com/collective/collective.googleauthenticator

https://github.com/shinsaka/googleauthenticator_demo

https://github.com/cqf539/GoogleAuthenticator

https://github.com/gnosis/django-google-authenticator

google 验证

Google两步验证安装使用方法

谷歌验证 (Google Authenticator) 的实现原理