Page 1 of 1

i v1.2 - get a lot of info about a file

Posted: Sat Sep 14, 2024 2:47 pm
by JakeSFR

A new toy.
This is a simple shell script to get a lot of info about files. But also dirs, why not.

i_cli.gif
i_cli.gif (518.18 KiB) Viewed 1895 times

i can utilize the following commands:

  • file

  • xdg-mime

  • rox

  • df

  • lsblk

  • mountpoint

  • findmnt

  • losetup

  • find

  • ls

  • du

  • stat

  • getfacl

  • chacl

  • getfattr

  • lsattr

  • fatattr

  • exfatattrib

  • ntfssecaudit

  • lsof

  • smartctl

  • udevadm

  • fdisk

  • cryptsetup

  • dumpe2fs

  • btrfs

  • dosfsck

  • dump.exfat

  • dumpexfat

  • ntfscluster

  • ntfsinfo

  • xfs_info

  • dump.f2fs

  • qemu-img

  • filefrag

  • wc

  • feh

  • rdjpgcom

  • exiv2

  • gifsicle

  • tiffinfo

  • webpng

  • webpinfo

  • xcfinfo

  • xcur2png

  • fc-scan

  • ftdump

  • ogginfo

  • metaflac

  • sndfile-info

  • ffprobe

  • ctorrent

  • pdfinfo

  • pdfimages

  • pdffonts

  • pdfdetach

  • unzip

  • isoinfo

  • udfinfo

  • dpkg-deb

  • rpm

  • unsquashfs

  • wiminfo

  • btrfs-compsize

  • upx

  • gzip

  • xz

  • zstd

  • zipinfo

  • sqlite3

  • pgpdump

  • modinfo

  • readelf

  • objdump

  • ldd

i was meant as a pure CLI utility, but, as a measure of convenience, it also installs itself as a ROX and/or Thunar (needs to be restarted with thunar -q) right-click option.
When invoked this way, it uses a simple YAD GUI; otherwise a terminal will be used, as a fallback:

i_gui.gif
i_gui.gif (143 KiB) Viewed 1895 times

Btw, the YAD GUI may freeze occasionally after clicking Close or X button.
In such a case, just give it 10 sec. or so, and it should go away eventually.

Program icon, as per usual, was created using @vovchik's excellent Pikona.
___________

Attached packages:

  • PET - for regular Puppies

  • XBPS - for Void-based Pups that use it (KLV, maybe others)

___________

Changelog

Version 1.2:
- added pgpdump (info about PGP signatures (.sig), keys (.asc, .pgp) and encrypted files (.gpg))
- added losetup (shows loop device(s) associated with a file)
- added udevadm (info about /dev devices)
- added qemu-img (info about QCOW(2)/VMDK/VDI images)
- added dumpe2fs (info about EXT partitions/images)
- added btrfs (info about BTRFS partitions/images)
- added dosfsck (info about FAT partitions/images)
- added dump.exfat and dumpexfat (info about EXFAT partitions/images)
- added ntfscluster and ntfsinfo (info about NTFS partitions/images - works only on unmounted devices!)
- added xfs_info (info about XFS partitions/images)
- added dump.f2fs (info about F2FS partitions/images)
- added smartclt (S.M.A.R.T. info from physical disks)
- bugfixes, improvements, refactoring

Version 1.1:
- added feh (basic info about images)
- added fdisk (info about disk images)
- added unzip (meta from ODF/OOXML documents)
- bugfixes, improvements, refactoring

Version 1.0:
- initial release

Have fun &
Greetings!


Re: i v1.0 - get a lot of info about a file

Posted: Sun Sep 15, 2024 12:14 pm
by Jasper

@JakeSFR

Thanks for this :thumbup:

I tried to install the Xbps offering on VoidPup64 but my OS only gave me the option to 'extract' the application, so had to use the supplied Pet instead.

I was wondering if could view checksums (not all of them!!) too in a future update?

testing.jpg
I.jpg

Re: i v1.0 - get a lot of info about a file

Posted: Sun Sep 15, 2024 1:40 pm
by JakeSFR
Jasper wrote: Sun Sep 15, 2024 12:14 pm

@JakeSFR

Thanks for this :thumbup:

Hey @Jasper, you're welcome!

I tried to install the Xbps offering on VoidPup64 but my OS only gave me the option to 'extract' the application, so had to use the supplied Pet instead.

Yeah, although VoidPup64 has xbps utilities pre-installed, apparently it doesn't use them for package management, unlike e.g. KLV-Airedale.

I was wondering if could view checksums (not all of them!!) too in a future update?

I was briefly considering checksums, but processing big files, like ISOs and videos, especially on HDD, would be painfully slow (times the number of checksums).
Besides, I'm not sure if it can be considered an info about a file, it's more like reductive scrambling of file's data.
So, it's not only for practical, but also philosophical reasons. ;)

Greetings!


Re: i v1.0 - get a lot of info about a file

Posted: Sun Sep 15, 2024 2:39 pm
by Jasper

No worries :lol: ........... already installed and in using it.

Another simple and effective tool :thumbup2:


Re: i v1.0 - get a lot of info about a file

Posted: Mon Sep 16, 2024 11:56 pm
by rockedge

@JakeSFR

Excellent work!

This is a good utility script so I will install i into KLV-Airedale and KLV-Spectr as a default utility during the next upgrade cycle. After short time of using it in KLV-Boxer, and after getting used it being available, I realized it is quite a handy tool to have onboard.

Thanks :thumbup:


Re: i v1.0 - get a lot of info about a file

Posted: Tue Sep 17, 2024 3:33 am
by wiak

Very nice utility

Wish my never-ending house build issues would finish so I could get back into all this in even partly focussed way. But been sick with fever for a week and was in middle of two back to back major tropical cyclones so landslides and floods all around and every roof leaking. Didnt help that I accidentally left car window open after driving through flood one rainy night... Clearly I need a wee Linux box in the car and another few on our property with sensors and detectors for all potential issues including security. So much to do that could be done using specially crafted forum distros... Yad makes great front ends. I also need to figure out how to connect everything up when plot is more than 100m long and sometimes 50m wide and is more like a lake with various small rivers running through it at the moment. Relying a lot on solar but no sun means lithium device batteries long discharged. Interesting project scenarios, but too busy just surviving the loss of municipal water supply, often whole day electricity brownouts, and the countless leaks and flooded access roads. Funnily enough the fibre internet strung on flimsy poles through trees continues to work with help of lead acid battery based UPS with AVR connected to the modem... Back now to my coffee - like an ostrich I am hiding my head in the sandy surrounds of a nearby beach resort cafe that has reliable facilities including diesel backup generators and Elon Musk Starlink...

I should get stemsee to help me build an Ark instead of the house.


Re: i v1.0 - get a lot of info about a file

Posted: Tue Sep 17, 2024 8:32 pm
by JakeSFR

Thanks guys, glad you like it!
I wasn't entirely sure myself if it's actually useful, or if it's just a gimmick, but as it turned out, I've also been using it quite often since the inception.

@wiak: oh man... Hope the bad streak is over soon, and good luck with your future endeavours. :thumbup:

Greetings!


Re: i v1.1 - get a lot of info about a file

Posted: Fri Sep 20, 2024 6:27 pm
by JakeSFR

Version 1.1:

- added feh (basic info about images)
- added fdisk (info about disk images)
- added unzip (meta from ODF/OOXML documents)
- bugfixes, improvements, refactoring

First post updated.

Greetings!


Re: i v1.1 - get a lot of info about a file

Posted: Fri Sep 20, 2024 7:22 pm
by rockedge
JakeSFR wrote: Fri Sep 20, 2024 6:27 pm

Version 1.1:

- added feh (basic info about images)
- added fdisk (info about disk images)
- added unzip (meta from ODF/OOXML documents)
- bugfixes, improvements, refactoring

First post updated.

Greetings!

After just assembling KLV-Airedale-sr15 I see these great additions so now I will add this in and repackage the entire distro. Good stuff..... :geek: :thumbup:


Re: i v1.2 - get a lot of info about a file

Posted: Wed Oct 16, 2024 6:51 pm
by JakeSFR

Thanks @rockedge. :)
___________

Version 1.2:

- added pgpdump (info about PGP signatures (.sig), keys (.asc, .pgp) and encrypted files (.gpg))
- added losetup (shows loop device(s) associated with a file)
- added udevadm (info about /dev devices)
- added qemu-img (info about QCOW(2)/VMDK/VDI images)
- added dumpe2fs (info about EXT partitions/images)
- added btrfs (info about BTRFS partitions/images)
- added dosfsck (info about FAT partitions/images)
- added dump.exfat and dumpexfat (info about EXFAT partitions/images)
- added ntfscluster and ntfsinfo (info about NTFS partitions/images - works only on unmounted devices!)
- added xfs_info (info about XFS partitions/images)
- added dump.f2fs (info about F2FS partitions/images)
- added smartclt (S.M.A.R.T. info from physical disks)
- bugfixes, improvements, refactoring

First post updated.

Greetings!


Re: i v1.2 - get a lot of info about a file

Posted: Thu Oct 17, 2024 3:28 am
by MochiMoppel

@JakeSFR Maybe OT here but I ask anyway because I'm curious about your comment in line 260:
# BB tr doesn't support [[:array:]], but (BB) sed does (needs LANG=C to also weed out Unicode, though)

Yes, BB tr doesn't support character classes but it supports range expressions within bracket expressions, so instead of
magic="$(head -c 12 -- "$1" 2>/dev/null | tr '\0' ' ' | LANG=C sed 's/[^[:print:]]/ /g')"

this also seems to work:
magic="$(head -c 12 -- "$1" 2>/dev/null | tr -c '[^ -~]' ' ')"
May even work without setting the locale to C (as the Bash manual recommends) because tr might use C as default
As in your code in case of Unicode each byte is replaced by a space.


Re: i v1.2 - get a lot of info about a file

Posted: Thu Oct 17, 2024 10:04 am
by JakeSFR

@MochiMoppel:

Code: Select all

# for i in {0..1023}; do printf "\U$(printf %x $i)" | tr '\0' ' ' | LANG=C sed 's/[^[:print:]]/ /g'; done | hd
00000000  20 20 20 20 20 20 20 20  20 20 0a 20 20 20 20 20  |          .     |
00000010  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 20  |pqrstuvwxyz{|}~ |
00000080  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000780

Code: Select all

# for i in {0..1023}; do printf "\U$(printf %x $i)" |  tr -c '[^ -~]' ' '; done | hd
00000000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 20  |pqrstuvwxyz{|}~ |
00000080  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000780

Yep, seems to work identical, except that it also weeds out newlines, which is good.

Nice find, I'll use it in next version, thanks!

Greetings!


Re: i v1.2 - get a lot of info about a file

Posted: Sun Dec 22, 2024 7:31 am
by greengeek
JakeSFR wrote: Sat Sep 14, 2024 2:47 pm

Program icon, as per usual, was created using @vovchik's excellent Pikona.
__

I just tried looking for the Pikona utility you mentioned but could not find an active link.
Do you have any idea where the pet is available please?
Cheers!


Re: i v1.2 - get a lot of info about a file

Posted: Sun Dec 22, 2024 10:51 am
by JakeSFR
greengeek wrote: Sun Dec 22, 2024 7:31 am
JakeSFR wrote: Sat Sep 14, 2024 2:47 pm

Program icon, as per usual, was created using @vovchik's excellent Pikona.
__

I just tried looking for the Pikona utility you mentioned but could not find an active link.
Do you have any idea where the pet is available please?
Cheers!

I also can't find it. I suspect it got removed due to its size (2M+) when John Murga restricted the size of an attachment to 256K, IIRC.
Fortunately, I have the source code, so you can build it yourself, given that you have BaCon in your devx or otherwise.

0. Download and unpack the archive: https://filetransfer.io/data-package/j3CkomgQ#link (MD5: 4b02be65e37d8d3eb172f653eaf1f9c1 pikona4.tar.gz).
1. Go to pikona4/data/src.
2. Execute bacon pikona.bac in terminal.
3. Move the executable to the main pikona4 directory and run it.

Greetings!


Re: i v1.2 - get a lot of info about a file

Posted: Sun Dec 22, 2024 1:46 pm
by BarryK

Love it!

"i" will be in the next release of EasyOS, see blog post:

https://bkhome.org/news/202412/file-inf ... n-app.html

I modified the pet, as EasyOS automatically rebuilds the right-click menu when a package is installed or removed -- so pinstall.sh and puninstall.sh aren't needed.

Also, added translations to 'i.desktop'


Re: i v1.2 - get a lot of info about a file

Posted: Sun Dec 22, 2024 6:13 pm
by vektor_alian

I like all of the letters of the alphabet equally, but a really cool name is deserved imo. Something with "mega" or "ultra".

I am going to add it to my right click context menu.

Thanks for the cool app!

Vektor