Filesystem
This section in general has funcions for file handling.
bh_bkp
Do quick backup of file using the current system date posfixed to the filename
Note
Usage
bh_bkp
[filename]
$ bh_bkp bashacks.sh
$ ls -1
bashacks.sh
bashacks.sh.20160122
bh_findmime
Find file by mime type
Note
Usage
bh_findmime
-[type] [directory]
type : -exe, -msi, -txt or -zip
directory : path
$ bh_findmime -exe ~/Downloads
/home/bashacks/Downloads//binario.exe
$ bh_findmime -txt ~/Documents
/home/bashacks/Documents//01-text.txt
/home/bashacks/Documents//ha.log
$ bh_findmime -zip ~/
/home/bashacks//crm.zip
$ bh_findmime -msi ~/
/home/bashacks//install.msi
bh_hashes
Generate message digest md5, sha1 and sha256 from file or list of file sent by parameters.
Note
Usage
bh_hashes
[filename or list of files]
$ $ bh_hashes bashacks.sh
5dab37cac730088fd959f8292636fc9b bashacks.sh
38be74a4e710a3eeb24b4fa2015cea990d4eda67 bashacks.sh
587b713bb31e3bf32de0b734805c3dd247f49a14cd9e9a5f35008e4f620d3f82 bashacks.sh
bh_md5rename
Convert filename to equivalent digest md5.
Note
Usage
bh_md5rename
[filename or list of files]
$ touch ment.bin
$ bh_md5rename ment.bin
$ ls
d41d8cd98f00b204e9800998ecf8427e
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]
$ 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_zipmal
Copress file in zip format with password protection. the password is virus
Note
Usage
bh_zipmal
[filename]
$ bh_zipmal malware.cpl
adding: malware.cpl (deflated 69%)
-rw-r--r-- 1 bashacks users 30k Jan 21 23:57 malware.zip