Tex4ebook tidy command missing - latex

I'm converting a Latex document with Tex4ebook (built on tex4ht) and I get the following warning: exec_epub: tidy command seems missing, you should install it in order to make a valid epub file.
But where do I install it and what does it do?
Thanks in advance.

tex4ebook uses HTML Tidy for clean-up of the generated XML files that can contain some issues resulting from the conversion process. If tex4ebook cannot find Tidy, it will use regular expressions for the clean-up. It is usually enough for production of the valid Epub file, so you don't really need to worry about the warning, as long as the generated file is valid.

Related

Identify old dos system file type and decode it into text file

I have pick up an old dos system from my friend, and I need to import the data into SQL, but before importing the data, i need to decode it into a readable text file, but I failed to do so. I have try several stuff:
file command in ubuntu terminal, it said "data"
Use online trid and it said macbin(MacBinary 1)
Tried bin2hex, but couldn't unhex it
Tried some online macbin to hex, no luck as well
Tried to open in macOS, but it keep extracting files
bin2hex said, nothing here
stuffitexpander.... Doesn't recognize...
This is the file that i need to decode
https://gofile.io/?c=wdbs6A
Please let me know if you need the original program.
I think they are just some database files.
Use this site for explanations. they even have a file analyzer - showing you the data inside.
You will need to rename the files to .db extension instead of .ocm.

detect and remove all executable files in uploaded ZIP file

I am working on a web application using Rails which user can upload a zip file which contains its data/file/docs and etc. But I'm concerned with security right now, I want to scan the uploaded zip file and remove all kind of executable such exe, bash and etc how can I do this?
Edit: I am aware of clamav API for rails but it would only scan the file for malicious files not removing the executable, just imagine opening a wrong uploaded executable file in the server and the cost of this action server/business-wide!
First, it would be better and more robust to whitelist allowed file types, and not blacklist disallowed ones (eg. executables). So you should have a list of types you allow if that is possible in your application.
Then the question is how you determine the type of a file.
The trivial way is checking the file extension, but that's not very strong. It may still be good for a first check to avoid spending precious cpu time on further checks.
After that, you can use the filemagic database to quite reliably find the type of uploaded files. You have two options:
If your application runs on linux, you can call the file tool directly, something like filetype = `file -Ib #{filename}` to get the filetype. Note that filename in this example needs to be sanitized to avoid OS command injection!
If you want to support Windows too (or just want to avoid calling shell commands and have nicer code), you can use the ruby-filemagic gem:
require 'filemagic'
filename = 'yourfile.ext'
magic = FileMagic.new
filetype = magic.file(filename)
The problem with ruby-filemagic is that it's not maintained anymore, but it would probably still work fine to find executables.

How to use long strings in delphi xe4?

I want decode a large base64 code on my delphi project
When I paste it in my project I see the Long String error ..
for solve it I use to it syntax:
'samecode'+
'samecode'+
'samecode';
But if I manually using this syntax it's too large time ...
Is there the quick way for solve it ?
You have a few options:
Compile the text to a string resource and link that to your executable. Load the resource at runtime.
Place the text in a file that you deploy alongside your executable and load it at runtime.
Write a script to read the text and format it to a manner suitable for inclusion in your source code.
Since your text is actually a base64 encoded file, I doubt that you want to do any of this. What you really ought to be doing is decoding the base64 text to a binary file and linking that as a resource.
Given that the base64 encoded file is in fact a virus (MSIL/Bladabindi.AJ), I cannot imagine anybody wanting to help you. I'm disappointed that I've done as much as I have. You should be ashamed of yourself.

xcode run script on deployment

I have a game which has xml files in it. My game works on iPad and on iPhone, and i need to perform some changes in these xml files accordingly, but the xml files are original and i do not want them changed, so what i want is have my xml files changed automatically at compile time. For this purpose i have a ruby script which does what i need.
Let's say this script is level_converter.rb
which i can execute(in terminal) as follows:
for f in Resources/*.xml; do ruby level_converter.rb "$f"; done
So i added this code to Build Phases to Run Script this way and this does work as expected, it does change all the xml files properly, BUT ofcourse it changes the original xml files in the resources foler. So say if i run twice - i'll have these files changed twice. What i want is these files stay not changed but only those deployed should change. So i need some kind of $(PROJECT_DISTRIBUTION_AND_DEVELOPEMENT_TEMP_FOLDER) or something like that instead of simply Resorces/*.xml eg.
for f in $(PROJ_DISTRIB_AND_DEV_TMP_FLDE)/*.xml; do ruby level_converter.rb "$f"; done
edit: must be im not that clear with the question, so i've rephrased it
Regards,
Igor
i was able to achieve what i wanted, here is the script:
PROJ_DIR=${PWD}
echo "Converting xml files..."
for f in "${CODESIGNING_FOLDER_PATH}/"*.xml
do
cp $PROJ_DIR/Resources/"${f##*/}" "$f"
ruby level_converter.rb "$f" $PROJ_DIR/key_hash;
done
exit 0;
So i used this ${CODESIGNING_FOLDER_PATH} variable.
explanation:
the for iterates the *.xml files in the destination directory
cp $PROJ_DIR/Resources/"${f##*/}" "$f": as far as xcode only copies resources only if they were changed i have to manually copy the xml files to prevent them being converted more then once - so the converter is executed each build and so it should have original files in place to convert
ruby level_converter.rb "$f" $PROJ_DIR/key_hash; : this simply executes the script
this does what i wan't but there are drawbacks/doubts:
from time to time i get a warning that the signed resources where changed or removed (well that doesn't surprise me though). Maybe there is a way to supress this? It does stop the app being sandboxed and i have to build again and hope there will be no warning next time. Lucky me it does not appear often
building takes much longer, it would still be nice to figure if the original files where changed and only execute the script if necessary
i still think there should be some "proper" way to achieve what i wanted
i am not sure i've picked up the variable CODESIGNING_FOLDER_PATH correctly, maybe i should use another one
edit: i moved the run script to be run before compiling source code, and didn't get any warnings about signed resources changed since then. Wandering if that's the cause

Upload file type verification with Rails and Javascript

I'm currently working on a project where users can upload datasets in CSV format.
Is there a good way with Ruby other than checking file extension to determine if they're really uploading a CSV and not some executable or some other file type?
You can't do this in javascript that's for sure. If you're in a UNIX environment, you can check the documentation about this.
I don't think there is any SURE way of checking this. Usually checking the file extension is fine. Plus you said you're getting CSVs, couldn't you try to parse them? If it fails, then either the document is not at the right format or it's not a csv.
Anyways, make sure that you're storing your files in a directory that has no execute access right.

Resources