md5sum - No properly formatted md5 checksum lines found - md5

I created a checksum file on a windows machine to verify on a linux machine.
Before I transferred the file over I ran dos2unix on windows to get rid of the nasty windows features.
The content of the file currently looks like this:
79ac8d043dc8739f661c45cc33fc07ac ReadMe.txt
This gave me the first error of wrong format. I then looked up the format and found I needed two spaces for md5sum to work so I transformed it on the linux machine using sed 's_ _ _g'.
This gave me an md5 content that looks like this:
79ac8d043dc8739f661c45cc33fc07ac ReadMe.txt
This still gives me the wrong format error. What am I doing wrong?
If this is any help, this is the exact error I get:
md5sum -c output2.md5
md5sum: output2.md5: no properly formatted MD5 checksum lines found
Please send help.
Julian

It turned out to be the dos encoding, dos2unix on windows apearently did not work properly.
using dos2unix on the linux machine solved the problem.

Related

PuTTY PSFTP returning error: unknown command "´╗┐cd"

HI I am running below command from my Windows server. I have got private key added so authentication wise it is fine. But when ever I am running the command getting a weird issue
psftp user#host -b FTPfile.txt
The file FTPfile.txt has only two lines.
cd /apps/scripts/batch/sln/input
put Test.txt
But I am getting error psftp: unknown command "´╗┐cd"
And I noticed any command given in the first line of the file returns a similar error.
The problem is that FTPfile.txt starts with a Unicode byte order mark (U+FEFF) encoded in UTF-8, which corresponds to the bytes 0xEF 0xBB 0xBF. psftp thinks those bytes are part of the command name. When it prints those bytes to the console as part of the error message, they're interpreted according to code page 850, which makes it look like ´╗┐.
To fix this, you need to get rid of the BOM. How did you create FTPfile.txt? Windows text editors usually have a setting to change the encoding of a file to "ANSI" (plain ASCII would also work).

Trying to use the Yajl example code, don't know how to give the input to the program

I've compiled the code provided by YAJL library in C. Don't know why the compiled program not parsing my file or is my file format is wrong?
I'm quite new in parsing JSON file.
This is where C code example located at https://lloyd.github.io/yajl/
Don't know do I need to paste the entire code or link is fine?
Myfile.
cat input_file.json
helllooooooooooo
When I ran the program ./a.out json_reformat input_file.json, it doesn't do anything. ./a.out -m json_reformat input_file.json this also didnt work.
I tried with -u and -m option nothing worked.
It print out the usage in STDOUT like this.
usage: json_reformat [options]
-m minimize json rather than beautify (default)
-u allow invalid UTF8 inside strings during parsing

Trouble with running words through text files and counting them

Python 3+
This is the error i get
This is my code
I want the user to input some words, then the program should run each word through my two textfiles, if the word exists in any of them, I want the program to add +1 to the positive/negative count list.
Thank you for your help :)
Seems like you have stumbled upon a Decoding error when trying to open one of the input files in the wordlist function. it is usually hard to determine the encoding used for a particular file. so you could :
1.Try opening the file with a different encoding such as ISO-8859-15,etc.
def OpenFile():
try:
with open("My File.txt",mode="r",encoding="IS0-8859-15")
#do process My File
except UnicodeDecodeError:
print("Something went Wrong Try a different file encoding")
else:
#everything was okay, return the required
finally:
# clean up here
2. Look it modules that try and determine the correct encoding for the file such as the chardet module
Install the
chardet module :
sudo pip3 install chardet
you can run it at the command line with your file as the Argument to determine the encoding
cd /path/to/File/
chardetect My\ File.txt
this should return the likely encoding for the given file
3.You can use the chardet module inside your python code however this is recommended in a case where you will be opening a file you do not have access to e.g at a clients computer whom wants to open another specified file
and reopening the same file and redetecting the encoding will cause your program to be slow.
First of all positive_count and negative_count should be integers and not lists. If you wish to count, adding 1 to the list isn't really what you're trying to accomplish.
Second of all, the UnicodeDecodeError is there because the encoding of the underlying file is not utf-8. Did you try utf-16 or utf-16-le? In case you're using Windows, utf-16-le is probably the encoding used unless you're using code-points in which case guessing will be a nightmare.

C input and output redirection error?

I am encountering this weird message at the moment with my file.
I have a very basic C file that reads from a file and outputs upon request.
I am running the following command in Linux:
filename <filenametest.txt >filenameoutput
and it brings the following message:
filename: command not found
Any idea why it's not working?
Really frustrating.
Assuming that filename is the name of the executable generated on compiling your C code, maybe you should try using
./filename < filename.txt > filenameoutput.
Since filename is not in the search path by default.

Passing a URL to a specific piece of example code which extracts samples from a WAV file

I don't know if it is legal on SOF to access such a specific question, but here I go:
I've found this wonderful piece of code which takes all the samples from a WAV file and passes it into an array.
The code compiles, but I can't seem to figure out where to pass the argument of where the file is and what its name is.
Any help?
PS If this code does what it says it does, I think it could be useful to a lot of people.
Thanks!
If you look at the code it's reading from stdin (and it even says in the description above the code: "It reads from stdin"). Evidently it's designed to be used as a command line tool (or "filter") which can be piped with other tools, or standalone using I/O redirection.
You should be able to pipe output from wget or curl.
wget -O - http://www.whatever.com/somefile.wav | yourpieceofcode

Resources