How to make an MD5 file on a Mac - macos

I'm sending a source code package to someone via email. I have sent them an .svdump which contains the files. They have now asked me to send an MD5 file for the source dump. How do I create this on a Mac?

Open up a terminal and invoke the md5 program with the filename that you want to create a hash for:
md5 some_app > md5.txt
The command above stores the resulting hash in a file named md5.txt.

In your terminal, just use the command "md5" and the file name. It's in /sbin/md5 i think.
> md5 -r myfile.txt

Related

Getting full name of file after scp - batch script

Hello I'm trying to make a simple .bat file, I'm trying to modify a file after downloading it from another machine.
The problem is the python script needs the full name of the file, so filename* won't work so is there a way to download a file via scp and then somehow assign the downloaded file a variable so the script can find the full name
scp user#192.168.1.X:"C:\Users\user\Downloads\filename*" ./
pythonscript.py filename*
pythonscript.py "%cd%\filename"

Reading and redirecting zip file by Less

Im trying to copy a zip file located on a server by a ssh2 library.
the way i'm about to do is using less command and write it down on client side.
Less -r -L -f zipfile
but the output file is bigger than the original.
i know this not a good practice but i have to.
so how can i handle this to have my zip file on the client machine?
Is Less an mandatory command to do that ?
You can simply use scp to achieve that by providing user and host and then typing the directory, where to copy the file from the server to local host, like on the example below:
scp your_username#remotehost.edu:foobar.txt /some/local/directory

How to read file from PuTTY

I have a mission to read information from some file with PuTTY.
please login to: 'somewhere' there you will find a file named 'INSTUCTIONS' with instructions on how to proceed.
How i do it?
Thanks.
Assuming you're SSHing onto a unix box of some kind, use "ls" to browse the file structure. Find the file, then use "cat". e.g.:
cat INSTRUCTIONS.txt

Linux / Windows Shell Scripting to Unlock PGP File

I have a sequence of scripts which downloads PGP files from a FTP server. I then unzip these files with a private key using PGPKeys. The unzipped files are then picked up by a SQL Server job which appends the data onto our database. I'd like to automate the entire process. Is there anyway to unzip a PGP locked file using shell scripting (either Linux or Windows)?
That's a perfect task to automize, I can help you in Linux.
First you can use wget to download a file
wget ftp://website.com/yourpgparchive.zip
If your ftp website requires authenticated access use
wget --ftp-user=USER --ftp-password=PASSWORD ftp://ftp.site/archive.zip.pgp
Then you need gpg (the open source PGP implementation) to decrypt the file
gpg -o file.zip -d file.zip.gpg
(If you need some suggestion on how to import keys and get started with gpg check here)
Then you can just unzip the file with
unzip file.zip
You may need to install gnupg and unzip from your package manager.
Yes, GPG. In your case, it's just gpg -d filename (or just gpg -d to read from stdin).
And, what you probably wanted to say is decrypt instead of unzip and encrypted instead of locked.

Use terminal in Mac for file transfer

I am using terminal in Mac for SSH access and it is great. But is there any way for me to do file transfer with the remote server that I SSH into in Mac?
Thanks
scp is your friend, enough said :)
(I realize this is a late reply, but I just stumbled upon this question and thought I'd contribute a tip...)
A quick & dirty way of transferring files over Terminal is:
On the remote side:
cat $file | openssl enc -base64
This will output a bunch of uppercase/lowercase/digits which represent Base64-encoded binary data. Select & copy this block text.
Then, in a separate Terminal window on your local machine:
pbpaste | openssl enc -base64 -d > $file
This will pipe the contents of the clipboard (the Base64-encoded data) to the openssl program (which is set to decode via the -d flag), and save the results in $file.
This works best for small files, and isn't terribly fast. I use it when I'm too lazy to construct a command line for scp or sftp. For larger/multiple files, you'll definitely want to use the latter two.

Resources