You are Here:
Download Linux Lite 5.6 Final today - See Release Announcements



X Close Ad
X Close Ad
A simple way to check MD5sum

Author (Read 19996 times)

0 Members and 3 Guests are viewing this topic.

A simple way to check MD5sum
« on: August 19, 2014, 08:59:49 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
1. Open the Thunar file manager
2. Click on Edit and then on Configure custom actions
3. Add A new custom action by clicking on a '+' button
4. Enter this in the text boxes:
Name: Check MD5
Description: Computes MD5 checksum for the selected file.
Command:
Code: [Select]
zenity --info --title="Check MD5 for %n" --text="$(md5sum %f)"Icon: You can skip this or choose your the icon of your choice. I've setup a calculator icon.
5. Click on Appearance Conditions tab
6. In the File pattern enter:
Code: [Select]
*.iso;*.ISO;*.img;*.IMG7. Check all boxes except Directories and confirm by clicking on OK
If you have an .iso or .img file on the Desktop you will have to log out and back in to be able to use this.
Now you can right-click on .iso or .img file and Check MD5.
Last Edit: January 25, 2015, 12:21:28 AM by Scott(0)
 


Re: A simple way to check MD5sum
« Reply #1 on: August 19, 2014, 09:07:48 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8129
    Posts
  • Country: nz
  • Reputation: 759
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Another beauty, I might even add this to the next Linux Lite :)
 

Re: A simple way to check MD5sum
« Reply #2 on: August 19, 2014, 10:30:12 PM »
 

rokytnji

  • Friganeer
  • Platinum Level Poster
  • **********
  • 1255
    Posts
  • Country: us
  • Reputation: 138

  • Linux Lite: 3.6 64bit

  • CPU: Intel Core2 Duo U9600

  • MEMORY: 4Gb

  • VIDEO CARD: Intel Mobile 4
Code: [Select]
$ apt-cache policy zenity
zenity:
  Installed: 3.8.0-1ubuntu1
  Candidate: 3.8.0-1ubuntu1
  Version table:
 *** 3.8.0-1ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
        100 /var/lib/dpkg/status

Looks like I will do this since zenity comes with the install already.

Nice How to. Thanks. Edit: Done and Done. You might want to edit "Description: Cumputes MD5 checksum for the selected file." to Description: Computes MD5 checksum for the selected file.

Code: [Select]
~$ ls
Comics   Documents  Icons   Isos   Pictures  Screeny  Templates  Wallpapers
Desktop  Downloads  Images  Music  Public    Scripts  Videos

PS. I appreciate work like this because I have myself done work like this.

http://antix.freeforums.org/antix-11-eeepc-900-install-finished-t3104.html

So when I say thanks. It comes from a compadre.
Last Edit: August 19, 2014, 10:44:01 PM by rokytnji
LL 3.6,2.8
Dell XT2 > Touchscreen Laptop
Dell 755 > Desktop
Acer 150 > Desktop
I am who I am. Your approval is not needed.
 

Re: A simple way to check MD5sum
« Reply #3 on: August 20, 2014, 05:11:14 AM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Another beauty, I might even add this to the next Linux Lite :)
Thanks Valtam. I wasn't sure should I post this as a tutorial or a suggestion. It would be great to see that in the next LL.  :)
Nice How to. Thanks. Edit: Done and Done. You might want to edit "Description: Cumputes MD5 checksum for the selected file." to Description: Computes MD5 checksum for the selected file.
I mistyped that one, thank you. :)
PS. I appreciate work like this because I have myself done work like this.

http://antix.freeforums.org/antix-11-eeepc-900-install-finished-t3104.html

So when I say thanks. It comes from a compadre.

Thanks compadre. :)
Last Edit: August 20, 2014, 05:14:34 AM by misko_2083
 

Re: A simple way to check MD5sum
« Reply #4 on: October 10, 2014, 09:42:25 AM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
I've improved this.
save this script to /usr/scripts
name it md5
Code: [Select]
#!/bin/bash

md5_file="$1"

# Start MD5sum of a selected file
md5sum $md5_file | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="MD5sum" --text="Calculating md5sum for:\n${md5_file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

# Display calculated md5sum
sum=`cat /tmp/sum`
zenity --info --title="MD5sum" --text="MD5sum : $sum\nFile :          ${md5_file##*/}"
rm /tmp/sum

Name: Check MD5
Description: Computes MD5 checksum for the selected file.
Command:
Code: [Select]
/usr/scripts/md5 %f--------------------------------------------------------------
File pattern:
Code: [Select]
*.iso;*.ISO;*.img;*.IMGCheck all boxes except Directories
 

Re: A simple way to check MD5sum
« Reply #5 on: October 10, 2014, 10:54:30 AM »
 

rokytnji

  • Friganeer
  • Platinum Level Poster
  • **********
  • 1255
    Posts
  • Country: us
  • Reputation: 138

  • Linux Lite: 3.6 64bit

  • CPU: Intel Core2 Duo U9600

  • MEMORY: 4Gb

  • VIDEO CARD: Intel Mobile 4
Hey Bro. Trying it out. I am missing a step for sure. I get check md5 on right click but nothing happens.
You know. Problem between keyboard and user. As usual.

Code: [Select]
[email protected]:~$ cat /usr/scripts/md5

md5_file="$1"

# Start MD5sum of a selected file
md5sum $md5_file | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="MD5sum" --text="Calculating md5sum for:\n${md5_file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

# Display calculated md5sum
sum=`cat /tmp/sum`
zenity --info --title="MD5sum" --text="MD5sum : $sum\nFile :          ${md5_file##*/}"
rm /tmp/sum
[email protected]:~$



While in "gksu thunar" /( root thunar file manager). I made the md5 sum text file executable via right click. I also logged in and out a few times.
But no joy bro. I can md5sum through terminal just fine as always. Just playing with your stuff to test out.
Maybe a permissions issue?
LL 3.6,2.8
Dell XT2 > Touchscreen Laptop
Dell 755 > Desktop
Acer 150 > Desktop
I am who I am. Your approval is not needed.
 

Re: A simple way to check MD5sum
« Reply #6 on: October 10, 2014, 11:36:18 AM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Hi rokytnji, you must make the script executable
I missed to mention that step. :)
Oh I see. :)
You made the owner root
switch it to harry
Code: [Select]
sudo chown -R harry /usr/scripts/md5
Last Edit: October 10, 2014, 11:51:36 AM by misko_2083
 

Re: A simple way to check MD5sum
« Reply #7 on: October 10, 2014, 01:00:33 PM »
 

rokytnji

  • Friganeer
  • Platinum Level Poster
  • **********
  • 1255
    Posts
  • Country: us
  • Reputation: 138

  • Linux Lite: 3.6 64bit

  • CPU: Intel Core2 Duo U9600

  • MEMORY: 4Gb

  • VIDEO CARD: Intel Mobile 4
Ok. Did That. Though I wonder if maybe it should be

Code: [Select]
sudo chown -R harry:harry /usr/scripts/md5
Because she still won't open . Let me check something. I do not feel like rebooting yet. I might be screwing up because of 2 Linux-Lite 2.0 installs on 2 different laptops.

Code: [Select]
~$ apt-cache policy zenity
zenity:
  Installed: 3.8.0-1ubuntu1
  Candidate: 3.8.0-1ubuntu1
  Version table:
 *** 3.8.0-1ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
        100 /var/lib/dpkg/status

No. That aint it. Here is relevant info

Code: [Select]
[email protected]:~$ ls -l /usr/scripts/md5
-rwxrwxr-x 1 harry root 479 Oct 10 09:16 /usr/scripts/md5

and for double check before I posted. I did
Code: [Select]
[email protected]:~$ sudo chmod +x /usr/scripts/md5
[sudo] password for harry:
[email protected]:~$

and logged in and out again to be double sure also.
But nothing opens on my md5 right click thunar custom action on ~/isos/puppy/what ever iso I right click on.
Maybe I am in a bad spot of the universe? :o

Edit: Just in the off chance

Code: [Select]
sudo chmod a+x /usr/scripts/md5
plus a reboot gave no positive results either. At least one cannot say I aint trying.  :D
Last Edit: October 10, 2014, 01:16:00 PM by rokytnji
LL 3.6,2.8
Dell XT2 > Touchscreen Laptop
Dell 755 > Desktop
Acer 150 > Desktop
I am who I am. Your approval is not needed.
 

Re: A simple way to check MD5sum
« Reply #8 on: October 11, 2014, 01:19:25 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
It's woking here :)
https://www.youtube.com/watch?v=m9oTyvhE-MY&feature=youtu.be
I made this other script, but it's not for thunar custom action.
This script opens a dialog and then you choose a file.
Code: [Select]
#!/bin/bash

# Set the default directory for the file selection dialog
cd $HOME/Downloads

# Select a file
md5_file=(`zenity --title="MD5sum" --file-selection --file-filter="*.iso *.ISO *.img *.IMG"`)

# If Cancel is clicked then exit
if [ "${PIPESTATUS[0]}" -ne "0" ]; then
exit 0
fi

# Start MD5sum of a selected file
md5sum $md5_file | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="MD5sum" --text="Calculating md5sum for:\n${md5_file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

# Display calculated md5sum
sum=`cat /tmp/sum`
zenity --info --title="MD5sum" --text="MD5sum : $sum\nFile :          ${md5_file##*/}"
# If you want to make  an md5sum file, uncheck the next line
# echo $sum > "$md5_file".md5sum
rm /tmp/sum
Last Edit: October 11, 2014, 01:26:47 PM by misko_2083
 

Re: A simple way to check MD5sum
« Reply #9 on: October 11, 2014, 01:39:53 PM »
 

rokytnji

  • Friganeer
  • Platinum Level Poster
  • **********
  • 1255
    Posts
  • Country: us
  • Reputation: 138

  • Linux Lite: 3.6 64bit

  • CPU: Intel Core2 Duo U9600

  • MEMORY: 4Gb

  • VIDEO CARD: Intel Mobile 4
Cool. I am compiling urbanlightscape-1.3.3 at the moment.

Then try checkinstall instead of makeinstall like you mentioned before in the vlc thread.
I don't know where I screwed up using your instructions but I know the problem is with me.
No biggy as I md5sum check through terminal anyways.
As you see from my previous posts.
I am a loosy goosy, not afeared, linux user.
I am always experimenting. customising myself.

For anyone reading this. Tintii does about the same thing as urban lightscape does and it is in Linux-Lite synaptic package manager.

Code: [Select]
[email protected]:~$ apt-cache policy tintii
tintii:
  Installed: 2.8.2-1
  Candidate: 2.8.2-1
  Version table:
 *** 2.8.2-1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe i386 Packages
        100 /var/lib/dpkg/status

I am just doing the urban lightscape for practice and grins.

Edit: At least checkinstall worked out for me. My description was short and sweet . Photo editor like in photoshop. I did not create a installed doc. file though since it said generic and this .deb is only for me/myself/and I.

Code: [Select]
[email protected]:~/Downloads/urbanlightscape-1.3.3$ ls
aclocal.m4     configure.ac     install-sh   src
autogen.sh     COPYING          Makefile     urbanlightscape
autotools      depcomp          Makefile.am  urbanlightscape_1.3.3-1_i386.deb
config.log     description-pak  Makefile.in
config.status  help             missing
configure      images           README
[email protected]:~/Downloads/urbanlightscape-1.3.3$ apt-cache policy urbanlightscape
urbanlightscape:
  Installed: 1.3.3-1
  Candidate: 1.3.3-1
  Version table:
 *** 1.3.3-1 0
        100 /var/lib/dpkg/status

Last Edit: October 11, 2014, 11:29:47 PM by rokytnji
LL 3.6,2.8
Dell XT2 > Touchscreen Laptop
Dell 755 > Desktop
Acer 150 > Desktop
I am who I am. Your approval is not needed.
 

Re: A simple way to check MD5sum
« Reply #10 on: December 05, 2014, 10:25:46 PM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Country: us
  • Reputation: 26
  • Linux Lite Enthusiast

  • Linux Lite: 3.6 64bit
This is great misko! Would it be possible to add the ability to choose MD5 or Sha1?
 

Re: A simple way to check MD5sum
« Reply #11 on: December 06, 2014, 01:25:32 AM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Possible, but I keep it in the right-click menu

Name: SHA1
Description: Calculates SHA1 sum.
Command: /usr/scripts/sha1 %f
Pattern: *
Files: Check all the boxes except Directories
save the script as sha1
make executable
copy the file to /usr/scripts

Code: [Select]
#!/bin/bash

sha1_file="[email protected]"

# Start sha1sum of a selected file
sha1sum "$sha1_file" | tee >(cut -d ' ' -f1 > /tmp/sumsh1) |zenity --progress --title="SHA1" --text="Calculating sha1sum for:\n${sha1_file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sumsh1
exit 0
fi

# Display calculated md5sum
sum=`cat /tmp/sumsh1`
zenity --info --title="SHA1" --text="SHA1sum : $sum\nFile :          ${sha1_file##*/}"
rm /tmp/sumsh1

And md5sum

Name: MD5
Description: Calculates MD5 sum.
Command: /usr/scripts/md5 %f
Pattern: *
Files: Check all the boxes except Directories
save the script as md5
make executable
copy the file to /usr/scripts
Code: [Select]
#!/bin/bash

md5_file="[email protected]"

# Start MD5sum of a selected file
md5sum "$md5_file" | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="MD5sum" --text="Calculating md5sum for:\n${md5_file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

# Display calculated md5sum
sum=`cat /tmp/sum`
zenity --info --title="MD5sum" --text="MD5sum : $sum\nFile :          ${md5_file##*/}"
# echo $sum > "$md5_file".md5sum
rm /tmp/sum
It's better to use * as a pattern because that way you can calculate the sum of any file.

P.S. I hope this version works for rokytnji. :)
Last Edit: December 07, 2014, 04:24:31 AM by misko_2083
 

Re: A simple way to check MD5sum
« Reply #12 on: December 06, 2014, 10:38:11 AM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Country: us
  • Reputation: 26
  • Linux Lite Enthusiast

  • Linux Lite: 3.6 64bit
Thank you! Do you think it might be better as a single script where you select which Checksum to verify? I imagine a dialog pops up where the user can choose SHA1 or MD5.
 

Re: A simple way to check MD5sum
« Reply #13 on: December 06, 2014, 09:13:03 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Do you think it might be better as a single script where you select which Checksum to verify? I imagine a dialog pops up where the user can choose SHA1 or MD5.
Hmm, great idea. :)  Thank you. I'll set md5 as default one and add SHA256.
Once it's ready, I'll post here.
 

Re: A simple way to check MD5sum
« Reply #14 on: December 07, 2014, 04:33:53 AM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 687
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Here it is:


Name: Checksum
Description: Calculates  checksum.
Command: /usr/scripts/checksum %f
Pattern: *
Appearance: Check all the boxes except Directories

save the script as checksum
make executable
copy the file to /usr/scripts

Code: [Select]
#!/bin/bash
# Misko_2083

file="[email protected]"

MD5=(`echo "" | awk '{print "TRUE","MD5", $0}'`)
SHA1=(`echo "" | awk '{print "FALSE","SHA-1", $0}'`)
SHA224=(`echo "" | awk '{print "FALSE","SHA-224", $0}'`)
SHA256=(`echo "" | awk '{print "FALSE","SHA-256", $0}'`)
SHA384=(`echo "" | awk '{print "FALSE","SHA-384", $0}'`)
SHA512=(`echo "" | awk '{print "FALSE","SHA-512", $0}'`)

selection=$(zenity --list --radiolist --height=300 --title="Checksum" --text="File:  <b>${file##*/}</b>\nPick the hash algorithm." --column="Pick" --column="Hash" "${MD5[@]}" "${SHA1[@]}" "${SHA224[@]}" "${SHA256[@]}" "${SHA384[@]}" "${SHA512[@]}")

# If Quit is clicked then exit
if [ "${PIPESTATUS[0]}" -ne "0" ]; then
exit 0
fi

echo $selection | grep "MD5" > /dev/null
if [ $? = 0 ];then
md5sum "$file" | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="MD5sum" --text="Calculating MD5 for:\n${file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

sum=`cat /tmp/sum`
zenity --info --title="MD5sum" --text="MD5sum : $sum\nFile :          ${file##*/}"
rm /tmp/sum
exit 0
fi

echo $selection | grep "SHA-1" > /dev/null
if [ $? = 0 ];then
sha1sum "$file" | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="SHA-1" --text="Calculating SHA-1 for:\n${file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

sum=`cat /tmp/sum`
zenity --info --title="SHA-1" --text="SHA-1: $sum\nFile :    ${file##*/}"
rm /tmp/sum
exit 0
fi

echo $selection | grep "SHA-224" > /dev/null
if [ $? = 0 ];then
sha224sum "$file" | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="SHA-224" --text="Calculating SHA-224 for:\n${file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

sum=`cat /tmp/sum`
zenity --info --title="SHA-224" --text="SHA-224 : $sum\nFile :         ${file##*/}"
rm /tmp/sum
exit 0
fi

echo $selection | grep "SHA-256" > /dev/null
if [ $? = 0 ];then
sha256sum "$file" | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="SHA-256" --text="Calculating SHA-256 for:\n${file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

sum=`cat /tmp/sum`
zenity --info --title="SHA-256" --text="SHA-256 : $sum\nFile :         ${file##*/}"
rm /tmp/sum
exit 0
fi

echo $selection | grep "SHA-384" > /dev/null
if [ $? = 0 ];then
sha384sum "$file" | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="SHA-384" --text="Calculating SHA-384 for:\n${file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

sum=`cat /tmp/sum`
zenity --info --title="SHA-384" --text="SHA-384 : $sum\nFile :         ${file##*/}"
rm /tmp/sum
exit 0
fi

echo $selection | grep "SHA-512" > /dev/null
if [ $? = 0 ];then
sha512sum "$file" | tee >(cut -d ' ' -f1 > /tmp/sum) |zenity --progress --title="SHA-512" --text="Calculating SHA-512 for:\n${file##*/}" --pulsate --auto-close

# If Cancel is clicked then remove temporary file and exit
if [ "${PIPESTATUS[2]}" -ne "0" ]; then
rm /tmp/sum
exit 0
fi

sum=`cat /tmp/sum`
zenity --info --title="SHA-512" --text="SHA-512 : $sum\nFile :         ${file##*/}"
rm /tmp/sum
exit 0
fi

Last Edit: December 07, 2014, 06:23:01 AM by misko_2083
 


Tags:
 

X Close Ad
X Close Ad

Download Linux Lite 5.6 Final today - See Release Announcements