Skip to content

Commit

Permalink
Merge pull request #48 from wesleyleite/master
Browse files Browse the repository at this point in the history
issue #46 doc update
  • Loading branch information
merces authored May 10, 2022
2 parents dcd8961 + 0e85e53 commit c83169e
Show file tree
Hide file tree
Showing 12 changed files with 261 additions and 189 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Use the *make* command to generate a single file containing all functions and ad

## Documentation

A work-in-progress documentation maintained by [@wesleyleite](https://github.com/wesleyleite) is available [here](https://bashacks.readthedocs.io/).
Click [here](https://bashacks.readthedocs.io/).

## Usage

Expand Down
1 change: 1 addition & 0 deletions doc/source/crypto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bh_hashcrack

This is our old function ``bh_unmd5`` with many improvements, now can with several hashes, just update the name.

In this new version we cache the hash that have already been found, improving delivery speed.

.. note:: Usage

Expand Down
56 changes: 51 additions & 5 deletions doc/source/filesystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This section in general has funcions for file handling.
bh_bkp
------

Do quick backup of file using the current system date to add the file name
Do quick backup of file using the current system date posfixed to the filename

.. note::
Usage
Expand Down Expand Up @@ -58,7 +58,7 @@ Find file by mime type
bh_hashes
---------

Generate md5 message digest of file or list of files.
Generate message digest md5, sha1 and sha256 from file or list of file sent by parameters.

.. note::

Expand All @@ -69,13 +69,16 @@ Generate md5 message digest of file or list of files.

.. code-block:: bash
problema
$ $ bh_hashes bashacks.sh
5dab37cac730088fd959f8292636fc9b bashacks.sh
38be74a4e710a3eeb24b4fa2015cea990d4eda67 bashacks.sh
587b713bb31e3bf32de0b734805c3dd247f49a14cd9e9a5f35008e4f620d3f82 bashacks.sh
bh_md5rename
------------

Generate md5 message dgest to one or more files and rename it with result.
Convert filename to equivalent digest md5.

.. note::

Expand All @@ -86,14 +89,57 @@ Generate md5 message dgest to one or more files and rename it with result.

.. code-block:: bash
problema
$ touch ment.bin
$ bh_md5rename ment.bin
$ ls
d41d8cd98f00b204e9800998ecf8427e
.. sidebar:: TIP

It's easy compress a file and send it by mail later or protection you from yourself.


bh_secretfile
---------

A nice feature to any skill, use it to compress one or more files, automatically generating a password and upload to the file.io, in the end of process you'll get a URL and password to decompress file.

.. note::

Usage

``bh_secretfile`` [filename]


.. code-block:: bash
$ cat > ment.bin
Hi, I'm send this file.
$ bh_secretfile ment.bin
adding: ment.bin (stored 0%)
https://file.io/Raan5CUW8ZTW
NRvC_ZniiEtlwgcrBbI_
bh_sharefile
---------
Just as the bh_secretfile function uploads a file and returns the unique url to access it, this process will not have a password attached, anyone with the URL will be able to download it.
.. note::
Usage
``bh_sharefile`` [filename]
.. code-block:: bash
$ bh_sharefile texto.txt
https://file.io/EGQvRxqyagIY
bh_zipmal
---------
Expand Down
17 changes: 5 additions & 12 deletions doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ Requirements
* bc
* binutils
* coreutils
* curl
* file
* grep
* hexdump
* html2text
* objdump
* perl
* sed
* wget
* xxd
* zip
* make

Expand All @@ -35,9 +36,9 @@ Download

.. sidebar:: GIT

We recommend the version available on ``sourceforge``, however, if you want to use the development version skip the session that describe the steps of the GIT
We recommend the version available on ``MASTER REPOSITORY ON THE GITHUB``, however, if you want to use the development version skip the session that describe the steps of the GIT

Download the final version, download on the ``SourceForge``. `Download Bashacks`_
Download the final version, download on the ``GITHUB``. `Download Bashacks`_


GIT
Expand Down Expand Up @@ -67,14 +68,6 @@ Compile
clean : Just remove the file bashacks.sh
uninstall : remove reference the source of /etc/bash.bashrc and man page
.. sidebar:: Install all Requirements

You are free to try resolve the dependencies manually, however, we try to help with one command. ;)

.. code-block:: bash
$ bashacks_depinstall
.. code-block:: bash
Expand All @@ -86,6 +79,6 @@ Done that all functions can be used use ``bh`` ``TAB`` ``TAB`` and has a ``Sight



.. _`Download bashacks`: http://sourceforge.net/projects/hackfunctions/?source=directory
.. _`Download bashacks`: https://github.com/merces/bashacks/archive/refs/heads/master.zip


74 changes: 7 additions & 67 deletions doc/source/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ This function expects a binary and return its equivalent in decimal.
$ bh_bin2dec 1110
14
bh_charcalc
-----------

Think of a way to make operations with 'char', how to sum two positions for a 'char/string' and return letter c or sum of the other and multiply it by 10 and returns 10

.. note::

Usage
Expand All @@ -54,6 +56,7 @@ Think of a way to make operations with 'char', how to sum two positions for a 'c
$ bh_charcalc A \* 255
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.......
bh_dec2bin
----------

Expand Down Expand Up @@ -94,6 +97,7 @@ Opossed to ``bh_bin2dec`` this function expects a decimal for converting it into
5 = 101
6 = 110
bh_dec2hex
----------

Expand All @@ -116,6 +120,7 @@ The function expects a input a decimal number it performs the conversion to hex.
$ bh_dec2hex 255
ff
bh_hex2bin
----------

Expand All @@ -136,6 +141,7 @@ Capture all submitted arguments and convert to binary
$ bh_hex2bin 10
10000
bh_hex2dec
----------

Expand All @@ -156,6 +162,7 @@ This's a conversion function from hex digit to decimal digit
$ bh_hex2dec FF
255
bh_hexcalc
----------

Expand All @@ -176,70 +183,3 @@ In the same way as ``bh_charcalc``, however, work here with hexdigit.
$ bh_hex2bin FF + 1
0x100
bh_pow
------

This is a very simple operation in bash, but a little better "no bad".

.. note::

Usage

``bh_pow`` [number] [pow]


.. code-block:: bash
$ bh_pow 2 10
1024
$ bh_pow 9999 0
1
bh_shl
------

Push bits to the left by a number.

.. note::

Usage

``bh_shl`` [number] [displaces]
number : number to displaces
displaces : left shift

.. code-block:: bash
$ bh_shl 2 1
4
$ bh_shl 50 2
200
bh_shr
------

Push bits to the rigth by a number.

.. note::

Usage

``bh_shr`` [number] [displaces]
number : number to displaces
displaces : right shift.

.. code-block:: bash
$ bh_shr 4 1
4
$ bh_shr 50 2
12
bh_xor
------

Calculates the exclusive OR between two numbers, you can use hexdigit.

Loading

0 comments on commit c83169e

Please sign in to comment.