存储和搜索命令行

spellbook的Python项目详细描述


存储和搜索命令行

问题

http://imgs.xkcd.com/comics/tar.png

灵感来自opennssl命令行工具的用户体验。 在我以前的一个项目中,我使用openssl命令行工具。 在下面的例子中,我将使用openssl来演示如何使用拼写本。

最快的开始

安装拼写手册:

$ pip install spellbook

创建第一个名为aux:

$ spellbook aux create

将拼写添加到您的拼写本:

$ spellbook aux add "tar -xvzf file.tar.gz" "extract tar.gz archive"

搜索:

$ spellbook aux search tar
tar -xvzf file.tar.gz

文件

我们的想法是为openssl创建“book”。

创建第一个名为openssl的魔法书:

$ spellbook openssl create

然后为Linux创建拼写手册:

$ spellbook linux create

添加

向其中添加一些数据,有三种方法:

格式:

$ spellbook <book_name> add [command [description]]

添加命令和说明:

$ spellbook openssl add "openssl rand 16 -hex" "generate random 16 bytes and encode as hex"
openssl rand 16 -hex::generate random 16 bytes and encode as hex

仅使用命令添加:

$ spellbook openssl add "openssl asn1parse -in 3msg.enc.der -inform der"
provide description>> show asn1 encoded file
openssl asn1parse -in 3msg.enc.der -inform der::show asn1 encoded file

不带命令添加:

$ spellbook openssl add
provide command>> openssl des3 -d -in 3msg.enc.msg -K `xxd -p 3msg.dec.key` -iv `xxd -p 3msg.iv`
provide description>> decode file using des3 with key and iv
openssl des3 -d -in 3msg.enc.msg -K `xxd -p 3msg.dec.key` -iv `xxd -p 3msg.iv`::decode file using des3 with key and iv

在Linux手册中添加一些内容:

$ spellbook linux add "tar -xvzf file.tar.gz" "extract tar.gz archive"
tar -xvzf file.tar.gz::extract tar.gz archive

列表

列出所有咒语:

$ spellbook openssl list
openssl rand 16 -hex    ::>>    generate random 16 bytes and encode as hex
openssl asn1parse -in 3msg.enc.der -inform der  ::>>    show asn1 encoded file
openssl des3 -d -in 3msg.enc.msg -K `xxd -p 3msg.dec.key` -iv `xxd -p 3msg.iv`  ::>>    decode file using des3 with key and iv

Dropbox支持

只需安装Dropbox或使用Dropbox安装咒语书即可

$ pip install spellbook[with_dropbox]
or
$ pip install spellbook dropbox

连接到Dropbox
$ spellbook - connectdb
1. Go to: https://www.dropbox.com/1/oauth2/authorize?response_type=code&client_id=ow3gosk8pb9bhkr
2. Click "Allow" (you might have to log in first)
3. Copy the authorization code.
provide the authorization code here>> oh4dTc9F_fgAAAAAAAAC3fovgKZ7cPL65mS5Ajxevug
successfully linked account:  DonPiekarz

使用Dropbox同步魔法书

所有魔法书将与您的Dropbox帐户同步

$ spellbook - sync

未来工作

  • 一些结束解析参数的技巧
  • 重构

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
由于测试失败,java testcontainers maven构建失败   java实现jacobi算法实现laplace方程   java中的多线程:如何在不等待所有线程使用ExecutorService完成任务的情况下终止所有线程的执行?   java Hello World不在Android Studio 3中工作   ubuntu Tomcat7的Java版本不正确   java Javafx内存泄漏   对于手动实现的Spring数据存储库方法,我应该使用Java8默认方法吗?   googleappengine中的java添加过滤查询   html当使用JSOUP库在Java中读取标签时,如何保留标签(如<br>、<ul>、<li>、<p>等)的含义?   编码为什么jasper生成的报告在Java中不显示西里尔语(保加利亚语)?   java有没有办法隐藏当前位置和jdk动作?   java找出编译原型文件的版本   有没有办法在运行时更改java方法的访问修饰符?   语法字符串。。。Java中的参数   java数组元素在添加其他元素时会相互覆盖   eclipse中的java GWT项目   java如何为spring rest模板请求将动态json属性名映射到jackson   java无法在Windows 10上找到特定的JDK   在xml字符串和java字符串之间提取正则表达式子字符串