Skip to main content

store and search command lines

Project description

store and search command lines

problem

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

The inspiration is user experience in opennssl command line tool. In one of my previous project I was working with openssl command line tool. In the examples below I will use openssl to show you how to use spellbook.

get started

The idea is to create ‘book’ for openssl.

install spellbook:

$ pip install spellbook

create your first spellbook, called openssl:

$ spellbook openssl create

then create spellbook for linux:

$ spellbook linux create

add

add some data to it, three ways are possible:

format:

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

add with command and 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

add with only command:

$ 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

add without command:

$ 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

add something to linux book:

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

list

list all spells:

$ 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

future work

  • builtin support for github repositories to store all spellbooks

  • some hack to end parse arguments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spellbook-1.0.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page