A command-line tool collection to assist development written in RUST

Related tags

Utilities dtool
Overview

dtool

Build Status Crates.io

dtool is a command-line tool collection to assist development

Table of Contents

Description

Now dtool supports:

Usage

dtool does different works by different sub commands:

Sub command Desc Example
h2s Convert hex to UTF-8 string
v0.1.0
$ dtool h2s 0x61626364
abcd
s2h Convert UTF-8 string to hex
v0.1.0
$ dtool s2h abcd
0x61626364
h2b Convert hex to binary
v0.1.0
$ dtool h2b 0x61626364
abcd
b2h Convert binary to hex
v0.1.0
$ dtool b2h abcd
0x61626364
...

View full usage document

  • Besides the sub command help, dtool provides a sub command usage to show examples:
$ dtool usage
Usage
----------------------------------------------------------
 h2s  Convert hex to UTF-8 string  $ dtool h2s 0x61626364 
      v0.1.0                       abcd 
----------------------------------------------------------
...
  • You can search usage with a keyword:
$ dtool usage -s md5
Usage
-------------------------------------------------------
 hash  Hex to hash  $ dtool hash -a md5 0x616263 
       MD5          0x900150983cd24fb0d6963f7d28e17f72 
       v0.2.0        
-------------------------------------------------------

Tips

pipe

convert a string to base64

$ echo -n abc | dtool s2h | dtool h2b64
YWJj

convert a encoded timestamp to date

$ echo -n 2c28e75d | dtool nd -tu32 | dtool ts2d
2019-12-04 11:29:48

convert a jpeg to base64

$ cat pic.jpg | dtool b2h | dtool h2b64
/9j/4AAQSkZJR...

calculate file md5

$ cat pic.jpg | dtool b2h | dtool hash -a md5
0x1884b72e23b0c93320bac6b050478ff4

Installation

Homebrew

$ brew install guoxbin/guoxbin/dtool

Recommend! Homebrew will install shell completion for bash, fish, and zsh along with dtool

Arch Linux

There is an AUR package for dtool that includes shell completion for bash, fish, and zsh.

git clone https://aur.archlinux.org/dtool.git
cd dtool
makepkg -si

Cargo

$ cargo install dtool
Comments
  • Cannot compiled due to transitive dependency on zeroize

    Cannot compiled due to transitive dependency on zeroize

    Last version of dtool depends on schnorrkel 0.8.5 which depends on zeroize 0.9.x, it seems all zeroize packages < 1.0 have been purged.

    error: failed to compile `dtool v0.10.1`, intermediate artifacts can be found at `C:\Users\gim91\AppData\Local\Temp\cargo-installjjerSE`
    
    Caused by:
      failed to select a version for the requirement `zeroize = "^0.9.3"`
      candidate versions found which didn't match: 1.3.0, 1.2.0, 1.1.1, ...
      location searched: crates.io index
      required by package `schnorrkel v0.8.5`
          ... which is depended on by `dtool v0.10.1`
    
    opened by gim913 6
  • can't compile on apple silicon M1

    can't compile on apple silicon M1

    Compilation fails because of crate ring-fork-dtool with

    error[E0308]: mismatched types
       --> /Users/thomvil/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-fork-dtool-0.16.13/src/cpu.rs:187:56
        |
    187 |         pub fn available(&self, _: super::Features) -> bool {
        |                ---------                               ^^^^ expected `bool`, found `()`
        |                |
        |                implicitly returns `()` as its body has no tail or `return` expression
    

    Could it be possible you need to explicitly support aarch64-apple-darwin? I think the original crate ring could already have a solution that would suffice? See this commit

    opened by thomvil 3
  • v0.10.0 release does not build

    v0.10.0 release does not build

    rustc version: rustc 1.45.2 (d3fb005a3 2020-07-31)

    error[E0405]: cannot find trait `PrehashSignature` in crate `signature`
      --> /Users/lusheng.lls/.cargo/registry/src/github.com-1ecc6299db9ec823/signatory-secp256k1-0.17.0/src/lib.rs:25:10
       |
    25 | #[derive(Signer)]
       |          ^^^^^^ not found in `signature`
       |
       = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0405]: cannot find trait `PrehashSignature` in crate `signature`
      --> /Users/lusheng.lls/.cargo/registry/src/github.com-1ecc6299db9ec823/signatory-secp256k1-0.17.0/src/lib.rs:80:39
       |
    80 | #[derive(Clone, Debug, Eq, PartialEq, Verifier)]
       |                                       ^^^^^^^^ not found in `signature`
       |
       = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error: aborting due to 2 previous errors
    
    For more information about this error, try `rustc --explain E0405`.
    error: could not compile `signatory-secp256k1`.
    
    To learn more, run the command again with --verbose.
    warning: build failed, waiting for other jobs to finish...
    error: failed to compile `dtool v0.10.0`, intermediate artifacts can be found at `/var/folders/8d/h3lyjgz14296j_lw7chgf5hc0000gp/T/cargo-installyB8mOX`
    

    Maybe it needs to update lockfile for signatory-secp256k1?

    bug 
    opened by messense 3
  • Add Windows Support

    Add Windows Support

    For now, the latest version (v0.8.0) can not be built succesfully on Windows. Is there any plan to support Windows? Thanks! Versions:

    • rustc 1.43.0-nightly (8aa9d2014 2020-02-21)
    • cargo 1.43.0-nightly (e02974078 2020-02-18)
    >_ cargo install dtool
        Updating crates.io index
      Downloaded dtool v0.8.0
      Downloaded 1 crate (59.8 KB) in 2.37s
      Installing dtool v0.8.0
      Downloaded ring-fork-dtool v0.16.12
      Downloaded zeroize_derive v1.0.0
      Downloaded schnorrkel v0.8.5
      Downloaded merlin v1.3.0
      Downloaded curve25519-dalek v1.2.3
      Downloaded zeroize v0.9.3
       Compiling winapi v0.3.8
       Compiling byteorder v1.3.4
       Compiling proc-macro2 v1.0.8
       Compiling typenum v1.11.2
       Compiling rand_core v0.4.2
       Compiling unicode-xid v0.2.0
       Compiling syn v1.0.15
       Compiling cc v1.0.41
       Compiling autocfg v0.1.7
       Compiling autocfg v1.0.0
       Compiling serde v1.0.104
       Compiling byte-tools v0.3.1
       Compiling memchr v2.3.3
       Compiling subtle v2.2.2
       Compiling opaque-debug v0.2.3
       Compiling lazy_static v1.4.0
       Compiling getrandom v0.1.14
       Compiling libc v0.2.67
       Compiling fake-simd v0.1.2
       Compiling cfg-if v0.1.10
       Compiling ryu v1.0.2
       Compiling arrayvec v0.4.12
       Compiling keccak v0.1.0
       Compiling bitflags v1.2.1
       Compiling build_const v0.2.1
       Compiling gcc v0.3.55
       Compiling unicode-width v0.1.7
       Compiling itoa v0.4.5
       Compiling regex-syntax v0.6.14
       Compiling nodrop v0.1.14
       Compiling dtoa v0.4.5
       Compiling strsim v0.8.0
       Compiling unicode-segmentation v1.6.0
       Compiling spin v0.5.2
       Compiling entities v1.0.1
       Compiling failure v0.1.6
       Compiling zeroize v0.9.3
       Compiling encode_unicode v0.3.6
       Compiling rustc-serialize v0.3.24
       Compiling untrusted v0.7.0
       Compiling vec_map v0.8.1
       Compiling base64 v0.11.0
       Compiling md5 v0.7.0
       Compiling urlencoding v1.0.0
       Compiling hex v0.4.2
       Compiling rand_core v0.3.1
       Compiling block-padding v0.1.5
       Compiling thread_local v1.0.1
       Compiling rand_pcg v0.1.2
       Compiling rand_chacha v0.1.1
       Compiling rand v0.6.5
       Compiling num-traits v0.2.11
       Compiling num-integer v0.1.42
       Compiling indexmap v1.3.2
       Compiling textwrap v0.11.0
       Compiling crc v1.8.1
       Compiling escaper v0.1.0
       Compiling heck v0.3.1
       Compiling rand_hc v0.1.0
       Compiling rand_xorshift v0.1.1
       Compiling rand_isaac v0.1.1
       Compiling regex-automata v0.1.8
       Compiling quote v1.0.2
       Compiling rust-crypto v0.2.36
       Compiling csv-core v0.1.10
       Compiling aho-corasick v0.7.8
       Compiling generic-array v0.12.3
       Compiling clear_on_drop v0.2.3
       Compiling secp256k1 v0.15.5
       Compiling ring-fork-dtool v0.16.12
       Compiling digest v0.8.1
       Compiling block-buffer v0.7.3
       Compiling regex v1.3.4
       Compiling rand_os v0.1.3
       Compiling rand_jitter v0.1.4
       Compiling time v0.1.42
       Compiling atty v0.2.14
       Compiling rand v0.4.6
       Compiling dirs v1.0.5
       Compiling rand v0.5.6
       Compiling sha2 v0.8.1
       Compiling ripemd160 v0.8.0
       Compiling sha3 v0.8.2
       Compiling serde_test v1.0.104
       Compiling bstr v0.2.11
       Compiling parity-codec v3.5.4
       Compiling clap v2.33.0
       Compiling term v0.5.2
       Compiling rand v0.3.23
       Compiling chrono v0.4.10
       Compiling yogcrypt v0.0.0
    error: failed to run custom build command for `ring-fork-dtool v0.16.12`
    
    Caused by:
      process didn't exit successfully: `C:\Users\WINTER~1\AppData\Local\Temp\cargo-installd2xAdG\release\build\ring-fork-dtool-ad22c67c879656d3\build-script-build` (exit code: 101)
    --- stderr
    thread 'main' panicked at '"C:\\Users\\Winterreise\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\ring-fork-dtool-0.16.12\\pregenerated\\aes-x86_64-elf.obj": Os { code: 2, kind: NotFound, message: "系统找不到指定的文件。" }', C:\Users\Winterreise\.cargo\registry\src\github.com-1ecc6299db9ec823\ring-fork-dtool-0.16.12\build.rs:753:5
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    warning: build failed, waiting for other jobs to finish...
    error: failed to compile `dtool v0.8.0`, intermediate artifacts can be found at `C:\Users\WINTER~1\AppData\Local\Temp\cargo-installd2xAdG`
    
    Caused by:
      build failed
    
    enhancement help wanted 
    opened by tan-wei 3
  • 0.7.0 does not build with --locked

    0.7.0 does not build with --locked

    Attempting to build the 0.7.0 release with cargo build --release --locked results in an error:

        Updating crates.io index
    error: the lock file /home/wmoore/Projects/aur/dtool/src/dtool-0.7.0/Cargo.lock needs to be updated but --locked was passed to prevent this
    

    I use --locked when building the AUR package to ensure that the build is reproducible. It appears that you have not committed the Cargo.lock file. This is recommended for binary packages.

    opened by wezm 2
  • Tag releases for easier packaging

    Tag releases for easier packaging

    This looks like a really useful tool. I actually started building a very similar tool in Rust for doing hex conversion that other day but dtool does that and more! I'd like to create an AUR package for it. It's best to build OS packages like this from downloadable tar archives so that the source code can be checked against a hash digest like SHA256. Would it be possible to create a git tag for releases? GitHub will then make tarballs available for each tagged release at: https://github.com/guoxbin/dtool/releases which I can use to build the package.

    opened by wezm 2
  • Bump zeroize_derive from 1.0.0 to 1.3.2

    Bump zeroize_derive from 1.0.0 to 1.3.2

    Bumps zeroize_derive from 1.0.0 to 1.3.2.

    Changelog

    Sourced from zeroize_derive's changelog.

    Changelog

    All notable changes to this project will be documented in this file.

    The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

    1.5.7 (2022-07-20)

    Added

    • Optional serde support (#780)

    #780: RustCrypto/utils#780

    1.5.6 (2022-06-29)

    Added

    • #[inline(always)] annotations (#772)
    • #[ignore] attribute on flaky CString test (#776)

    Changed

    • Factor integration tests into tests/ (#771)

    #771: RustCrypto/utils#771 #772: RustCrypto/utils#772 #776: RustCrypto/utils#776

    1.5.5 (2022-04-30)

    Added

    • Impl Zeroize for std::ffi::CString (#759)
    • AsRef<T> and AsMut<T> impls for Zeroizing (#761)

    #759: RustCrypto/utils#759 #761: RustCrypto/utils#761

    1.5.4 (2022-03-16)

    Added

    • Nightly-only upport for zeroizing ARM64 SIMD registers (#749)

    #749: RustCrypto/utils#749

    1.5.3 (2022-02-25)

    Fixed

    • Deriving ZeroizeOnDrop on DerefMut (#739)

    #739: RustCrypto/utils#739

    1.5.2 (2022-01-31) [YANKED]

    Fixed

    • Ambiguous method for AssertZeroizeOnDrop (#725)

    #725: RustCrypto/utils#725

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump linked hashmap to 0.5.3

    Bump linked hashmap to 0.5.3

    Linked hashmap 0.5.2 is unsound. Bumping this to 0.5.3 so that dependents are ensured a sound version.

    Advisory: https://github.com/RustSec/advisory-db/issues/298

    opened by Dylan-DPC-zz 0
  • Conversion between different format

    Conversion between different format

    I built a similar tool but targeting conversion between different format in https://github.com/pickfire/babelfish. Do you think it is worth adding to dtool? If it's added probably I will deprecate it.

    enhancement 
    opened by pickfire 1
  • Suggestion: allow endianess to be supplied to ne command

    Suggestion: allow endianess to be supplied to ne command

    Currently it appears that ne always uses little endian encoding. I deal in big endian values a fair bit (fonts) so it would be useful to be able to encode/decode to big endian as well.

    enhancement 
    opened by wezm 0
  • Suggestion: flatter API

    Suggestion: flatter API

    I would love to be able to type:

    echo "Hello World" | dtool snake_case
    cat file.txt | dtool md5
    

    This would make it much easier to remember the available commands.

    For A2B style commands, it would be nice to have a long form available. For example

    dtool hex to utf8
    

    The short forms like h2s are probably good for typing quickly, but unfortunately it still ends up slower if I have to look up the command. I think I would be able to remember hex more easily than I am able to remember h.

    enhancement 
    opened by nicoburns 5
Releases(v0.12.0)
Owner
GB
GB
Artifact collection tool for *nix systems

fennec is an artifact collection tool written in Rust to be used during incident response on *nix based systems. fennec allows you to write a configuration file that contains how to collect artifacts.

AbdulRhman Alfaifi 147 Dec 19, 2022
A collection of functions written in Triton VM assembly (tasm)

tasm-lib This repository contains a collection of functions written in Triton VM assembly (tasm). There are two big projects to be written in tasm: Th

Triton VM 2 Dec 20, 2022
Command line interface to manage clipboard

cb Command line interface to manage clipboard How to install Pre-Compiled you can download a pre-compiled executable, then you should copy that execut

Navid 74 Dec 18, 2022
A Command Line OTP Authenticator application.

cloak A Command Line OTP (One Time Password) Authenticator application written in Rust that generates time-based and counter-based OTP codes. Motivati

Evans Murithi 205 Jan 5, 2023
Rs.aws-login - A command line utility to simplify logging into AWS services.

aws-login A command line utility to simplify logging into AWS accounts and services. $ aws-login use ? Please select a profile to use: › ❯ dev-read

Kevin Herrera 11 Oct 30, 2022
Transfer data with the LCU in the command-line interface! 🖥

llux llux (short for LCU Lux) is an open-source CLI tool to easily transfer data with the LCU without any script or code setup, hehe! Preview Download

Blossomi Shymae 5 Jul 30, 2023
Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps.

rust-yew-axum-tauri-desktop template Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps. Crates frontend: Yew frontend app for de

Jet Li 54 Dec 23, 2022
KERI implementation in RUST, current development lead by DIF

KERIOX Introduction Features Introduction KERIOX is an open source Rust implementation of the Key Event Receipt Infrastructure (KERI) , a system desig

WebOfTrust 3 Nov 11, 2022
Simple fake AWS Cognito User Pool API server for development.

Fakey Cognito ?? Homepage Simple fake AWS Cognito API server for development. ✅ Implemented features AdminXxx on User Pools API. Get Started # run wit

naokirin 4 Aug 30, 2022
Docgen - a fork of Doctave intending to continue the development.

Docgen Docgen is a fork of Doctave intending to continue the development. All credit goes to the original Docgen authors. Docgen is an opinionated doc

Abdullah Atta 3 Oct 22, 2022
Risc-V hypervisor for TEE development

A micro hypervisor for RISC-V systems. Quick Start Building (using Bazel) git submodule update --init bazel build //:salus-all Running Prerequisites S

Rivos Inc. 68 Jul 3, 2023
mollusc is a collection of pure-Rust libraries for parsing, interpreting, and analyzing LLVM.

mollusc is a collection of pure-Rust libraries for parsing, interpreting, and analyzing LLVM.

William Woodruff 50 Dec 2, 2022
A Rust library containing a collection of small well-tested primitives.

Gazebo - a library of Rust utilities This library contains a collection of well-tested utilities. Most modules stand alone, but taking a few represent

Meta Incubator 168 Dec 29, 2022
Rust Util Collection, a simple and friendly error-chain

RUC Rust Util Collection, a simple and friendly error-chain, with many useful utils as an addition. The painful experience of using error-chain gave b

漢 8 Dec 8, 2022
Rust Util Collection, a simple and friendly error-chain, with many useful utils as an addition.

RUC Rust Util Collection, a simple and friendly error-chain, with many useful utils as an addition. The painful experience of using error-chain gave b

漢 6 Mar 27, 2022
Crate of GitHub’s collection of gitignores, embedded, automatically updated

Gitignores GitHub’s collection of gitignores, embedded, automatically updated. API documentation. Public Domain via CC0-1.0 (same as source data). MSR

null 3 May 3, 2022
A fast, multi-threaded line counting utility written in Rust.

xloc A fast, multi-threaded line counting utility written in Rust. What is xloc A drop in replacement for bash's wc -l. Your project has x lines of co

null 1 Nov 15, 2021
The tool like Browserslist, but written in Rust.

browserslist-rs The tool like Browserslist, but written in Rust. Try it out Before trying this crate, you're required to get Rust installed. Then, clo

Pig Fang 76 Nov 29, 2022
Fast, compact and all-around subdomain enumeration tool written in Rust

Fast, compact and all-around subdomain enumeration tool written in Rust, which uses dns bruteforce, internet search and recursive http content search.

foreseon 16 Dec 10, 2022