When trying to generate a binary file removing two text sections I end up with a huge binary file of 265M.
arm-none-eabi-objcopy -v -O binary --remove-section=.text_F3 --remove-section=.text_F4 file.axf out_file.bin
Has anybody has a clue why this would happen?
Thanks in advance.
I have solved this, one of the sections I was trying to remove was "allocable" and that was the whole issue objcopy doesn't deal well with "allocable" sections.
Related
In an exam I took I found myself in front of this question:
What's the result following this command?
gcc file1.o file2.o file3.o
A)Nothing, it's using the wrong syntax
B)Links the file objects but won't produce any result unless specified an output
C)An executable file a.out
I thought it was A) the wrong syntax, but I was wrong, could you guys help me figure out which is the correct answer? (I suspect the third one, but I also know that gcc won't always create an executable if ran)
p.s.
If you could give me a thorough explanation I would be very greatful
tldr: How can I convert a folder of pdfs into a list of CMYK values (or RGB or any kind of colour scale values), preferably in python.
I have a folder with around ~100,000 documents in it. To make sampling these documents easier I want to run data analysis on the documents (clustering and anomaly detection), and one metric I want to have is the CMYK coverage. Is there any method or package in (preferably) python that will calculate the CMYK coverage of the PDF?
****edit****
After some research I have found out that GhostScript should provide the functionality I require, if anyone could help me with the implementation I would still really appreciate it.
./gs -sDEVICE=inkcov -sOutputFile=out.txt input.pdf should give you each page CMYK coverage in a file.
You could use -dQUIET -o - instead of -sOutputFile to send the output to stdout.
You then need some batch scripting which will depend on your Operating System. On Windows something like:
for %s in (folder/*.pdf) do gswin64c -dQUIET -sDEVICE=inkcov -o - "%s" >> coverage.txt
ought to take every file from the folder, run it through the inkcov device and send the output to stdout, which we redirect to a file and use >> so that each execution appends to the file instead of overwriting the previous output.
You will need to delete the output file after each run of course.
I need to convert the GitHub README.md file to pdf. I tried many modules, those are not working fine. Is there any new tool to get the exact pdf format. In this website is providing good conversion format of pdf. http://www.markdowntopdf.com/
I need command line tool like this format.
Try this software:
https://github.com/BlueHatbRit/mdpdf
Or explain what tools you've tried and why those are not working fine.
Also check this question on superuser:
https://superuser.com/questions/689056/how-can-i-convert-github-flavored-markdown-to-a-pdf
Pandoc
I've personally liked using pandoc as it support a wide range of input and output formats.
Installation
Pandoc is available in most repositories: sudo apt install pandoc
Usage
Sometimes, pandoc can tell the formats to use which makes converting easy. However, I find that this often interprets the input format as plain text which might not be what you want:
pandoc README.md -o README.pdf
Instead, you might want to be explicit about the input/output formats to ensure a better conversion. In the below case, I'm specifically claiming the README.md is in Github-Flavored Markdown:
pandoc --from=gfm --to=pdf -o README.pdf README.md
Again, there are quite a few different formats and options to choose from but to be honest, the basics suffice for the majority of my needs.
I found md-to-pdf very useful.
Examples:
– Convert ./file.md and save to ./file.pdf
$ md-to-pdf file.md
– Convert all markdown files in current directory
$ md-to-pdf ./*.md
– Convert all markdown files in current directory recursively
$ md-to-pdf ./**/*.md
– Convert and enable watch mode
$ md-to-pdf ./*.md -w
And many more options.
This is an example image src. I want to save this image using wget. How to do that?
http://lp.hm.com/hmprod?set=key[source],value[/environment/2013/2BV_0002_007R.jpg]&set=key[rotate],value[-0.1]&set=key[width],value[3694]&set=key[height],value[4319]&set=key[x],value[248]&set=key[y],value[354]&set=key[type],value[FASHION_FRONT]&hmver=0&call=url[file:/product/large]
wget -L "http://lp.hm.com/hmprod?set=key[source],value[/environment/2013/2BV_0002_007R.jpg]&set=key[rotate],value[-0.1]&set=key[width],value[3694]&set=key[height],value[4319]&set=key[x],value[248]&set=key[y],value[354]&set=key[type],value[FASHION_FRONT]&hmver=0&call=url[file:/product/large]" -O zz.jpg
Providing quotes to your link to be downloaded is very essential. This link in particular has many special character capable of screwing things up.
Which contents have the header of an executable .bin file in Linux?
I found information for .exe files in Windows but I can't find any information for .bin files.
TIA
Just to be clear, in Linux, executable files may be called "binary" but don't have an explicit ".bin"
Linux generally uses the ELF format. The first byte is 0x7F followed by ascii for E, L, F - this is easily visible if you can load the binary into a text editor or print it at the command line using 'cat' or 'less'. After that... well I'm rusty but details are easily found on the web.
Try http://www.thegeekstuff.com/2012/07/elf-object-file-format/ and http://www.acsu.buffalo.edu/~charngda/elf.html for a starter. (I found these with a superficial quick search, and do not claim these are the best. Happy hunting!)
I'm not 100% sure what you are asking. But most Linux executables use the ELF format.
The readelf utility can read metadata from ELF executables.
ELF on wikipedia