You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



A simple way to check MD5sum

Author (Read 33650 times)

0 Members and 1 Guest are viewing this topic.

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

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • 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="$@"

# 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="$@"

# 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 #11 on: December 05, 2014, 10:25:46 PM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Reputation: 26
  • Linux Lite Enthusiast
    • View Profile
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 #10 on: October 11, 2014, 01:39:53 PM »
 

rokytnji

  • Friganeer
  • Platinum Level Poster
  • **********
  • 1255
    Posts
  • Reputation: 139
    • View Profile

  • 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]
harry@biker1:~$ 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]
harry@biker1:~/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
harry@biker1:~/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 #9 on: October 11, 2014, 01:19:25 PM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • 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 #8 on: October 10, 2014, 01:00:33 PM »
 

rokytnji

  • Friganeer
  • Platinum Level Poster
  • **********
  • 1255
    Posts
  • Reputation: 139
    • View Profile

  • 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]
harry@biker1:~$ 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]
harry@biker1:~$ sudo chmod +x /usr/scripts/md5
[sudo] password for harry:
harry@biker1:~$

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 #7 on: October 10, 2014, 11:36:18 AM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • 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 #6 on: October 10, 2014, 10:54:30 AM »
 

rokytnji

  • Friganeer
  • Platinum Level Poster
  • **********
  • 1255
    Posts
  • Reputation: 139
    • View Profile

  • 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]
harry@biker1:~$ 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
harry@biker1:~$



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 #5 on: October 10, 2014, 09:42:25 AM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • 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 #4 on: August 20, 2014, 05:11:14 AM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • 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 #3 on: August 19, 2014, 10:30:12 PM »
 

rokytnji

  • Friganeer
  • Platinum Level Poster
  • **********
  • 1255
    Posts
  • Reputation: 139
    • View Profile

  • 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 #2 on: August 19, 2014, 09:07:48 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • 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 :)
 

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

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • 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) »
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section