Paul Sutton

file

File integrity

If providing downloadable files, it is important to ensure that the downloaded file is the same as that provided on the host server, this ensures the file has not been tampered with in some way. The end user needs a way to check what they have downloaded is safe.

One way to do this is to create a file checksum with md5sum

let's say we have two files

-rw-rw-r-- 1 psutton psutton  67200 May  3 19:42 jcr.pdf
-rw-rw-r-- 1 psutton psutton 433231 Apr 28 17:50 southwest1.png

We want to create a checksum for both files. To do this we can run

md5sum southwest1.png 
502d4f9dacab9240f2622c032e6ea11f  southwest1.png
md5sum jcr.pdf 
b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf

This sends the checksum to stdout

So need a file to store this

md5sum jcr.pdf southwest1.png > md5sum2

We can then view the contents if this with

as previously discussed the > directs output to a specified file

cat md5sums
502d4f9dacab9240f2622c032e6ea11f  southwest1.png
b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf

In this example, we listed the files we want to create a checksum for.

If we were to add a 3rd file say tux.png then we can do this and append the new checksum with

md5sum tux.png >> md5sums

Then example our new md5sums file

cat md5sums
502d4f9dacab9240f2622c032e6ea11f  southwest1.png
b98edf4dd0afd0ede8ac6dabce66f522  jcr.pdf
d52cd5e7164eccd6da50e10d5a9c3dbf  tux.png

So now that we have 3 files and a md5sums file, we can check all the files listed

md5sum -c md5sums
southwest1.png: OK
jcr.pdf: OK
tux.png: OK

Chat

I am on the Devon and Cornwall Linux user group mailing list and also their matrix channel as zleap, it is better to ask there, that way others can answer too.

Tags

#Bash,#BashScripting,#Bashscripting,#md5sums,#md5sum,#file, #integrity,#check


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

Annotating pdf files PDF files are really useful for moving documents around when you 'need' the recipient to be able to open in a pdf reader and see what you intended.

Unless you have access to expensive software you are usually not able to edit these files easily. While LibreOffice draw can perhaps do this, it may not be ideal for the job.

Xournal [1] is a Debian application, that while mostly aimed at touch screens, is able to annotate pdf files as the video below demonstrates.

As mentioned in the video notes, Xournal will export as a .pdf.pdf file, so you may want to rename it when saving. This is not even an issue for me.

Happy to discuss further on Mastodon [2] or on IRC. Please see contact page for details.

References

1 Xournal 2 Mastodon 3 Alternatives

#xournal,#pdf,#file,#annotation,#editing,#demo,#video, #peertube.

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License PDF files are really useful to moving documents around when you 'need' the recipient to be able to open in a pdf reader and see what you intended.

Unless you have access to expensive software you are usually not able to edit these files easily. While LibreOffice draw can perhaps do this, it may not be ideal for the job.

Xournal [1] is a Debian application, that while mostly aimed at touch screens, is able to annotate pdf files as the video below demonstrates.

As mentioned in the video notes, Xournal will export as a .pdf.pdf file, so you may want to rename it when saving. This is not even an issue for me.

Happy to discuss further on Mastodon [2] or on IRC. Please see contact page for details.

References

1 Xournal 2 Mastodon 3 Alternatives

#xournal,#pdf,#file,#annotation,#editing,#demo,#video, #peertube.

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay

Console / terminal File viewer

One of the nice things about forums, IRC etc, is you get to find out about all sorts of software that is really useful. Sometimes this just seems to address fit what you want.

One such example is a program called view

manpage description is:-

mcview – Internal file viewer of GNU Midnight Commander.

You can use view to view pdf files, or rather the text content within, which is pretty good, very useful if compiling $\LaTeX$ with pdflatexfor example.

cc-by logo

You can also use view on a png graphics file, however this just displays information about the file, for example resolution. Again useful from the terminal / console at least.

Resources

#console, #file,#view,#pdf,#linux


cc-by logo

Licenced under Attribution 4.0 International (CC BY 4.0)


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay