public folder on redmine doesn't recognize binary files - ruby

I have put a binary file (.apk) on redmine/public folder but when I try to download that file I only get the text version of that file as text.
How to change that behavior to direct download?

You need to navigate to the httputils.rb file (it's wherever webrick is installed) and add this line to the list of MIME types:
application/vnd.android.package-archive apk
If that seems like a lot of trouble and you're not trying to do anything fancy with this download (e.g. download it directly from an android phone and install it), you can always wrap it in a .zip and call it a day. Zip files will download automatically.

Related

How to how to install poppler from the .tar file downloaded from poppler official site

There is no useful information on the site describing how to install the file .I have tried extracting the .tar file, installing through command prompt . there is no information available on the web.OS used is windows 11. Its for a project to extract data from images, using OCR. Poppler is used for getting page numbers of the pdf file which will be converted to an image file later in the process."https://poppler.freedesktop.org/" is the site from which I downloaded the file.Is this the right site.Any answer is helpful.Thank you
Poppler source is constantly updated, and thus common for Linux and Mac users to build or brew on demand. It is not much different when using Programming Suites like Python, Ruby etc.
Windows users expect one exe, but the poppler utils were built as a spin off from non-commercial licensed xpdf and for personal 32 bit users that is often simpler.
I have given examples for how simple that xpdf unpacking can be for one exe in several posts such as https://stackoverflow.com/a/68697144/10802527 (how to scan a file list, not used here) and https://stackoverflow.com/a/73123537/10802527 (how to use to run a single file) and
https://stackoverflow.com/a/73437398/10802527 (running one exe on demand)
Poppler prebuilt binaries are available as 64bit only so the first step after making a work directory is download latest version from https://github.com/oschwartz10612/poppler-windows using most current
https://github.com/oschwartz10612/poppler-windows/releases/download/v22.04.0-0/Release-22.04.0-0.zip and save to the working folder, then you can use right click Extract All... OR
tar -m -xf Release-22.04.0-0.zip to unpack in that folder so it should look like in the binary folder
Now the exe files are in a subdirectory and when using those it is best if that folder is included on the path environment.
RESIST any means to add using set or worse setx simply add folder via system gui, note in some cases after saving the setting it may need log off and log on to stick and in very rare cases even a reboot/restart.

Unable to extract bz2 reddit monthly comments file Mac

Am not able to extract monthly redit comment files downloaded in bz2 format on my computer.
For example, When i extract RC_2005-12.bz2 using The Unarchiver, there is a RC_2005-12 file extracted without any extension. I am not able to open that RC_2005-12 file .
Am using Mac with Sierra. Am downloading files from here http://files.pushshift.io/reddit/comments/
Any help appreciated. Thanks
I just downloaded the RC_2005-12.bz2 file from http://files.pushshift.io/reddit/comments/, and then in my Download folder in Finder, double-click it.
It extracted using the macOS default Archive Utility.
The extracted file, RC_2005-12, is a plan text document and when doubling-clicking it, it open in TextEdit.
If that doesn't work for you, I'd try downloading the file again.

Firefox Extensions and XPI installer not working

Hello Im attempting to build a Firefox extension but have run into an issue creating the XPI file,
This tutorial says that the XPI is simply a zip folder renamed, Ive taken a previously installed extension (pinterest) renamed to .zip and it will extract - I can see the plugin files no problem.
If I try and zip then rename my extension to .xpi the plugin will not install - Ive tested this with the pinterest plugin mentioned above and if I rename to zip, extract then rezip and rename back to zpi - the same code will not install. I think there is an issue with the zipping method im using (Windows 7 > Sendto > Compressed .zip)
Just to be clear - I'm not sure my plugin works properly yet, still getting a grip on the files required and naming conventions - however a working package will not work with the same zip process.
Can anyone help with this?
Was zipping from the parent location /folder/contents
Instead of from the contents location
Wokring now.

How to autolaunch installer from dmg

I want to deploy my program on Macintosh and I have a working installer but the installer and the files are packed into a zip file. I would like to make a DMG file and place them into it. This is easy to do but I would like the installer to start automatically when the user opens the DMG file. Is there any way to do that?
No, you cannot do this. What you need to do is convert your installer package to a flat package (these are now the default anyway). A flat package installer is a single file, so there's no need to bundle it into a zip or DMG.

How to create ZIP files with specific encoding

On my Linux server I have some files with accented names (test-éàïù.zip).
When I add them to a new ZIP file using 7zip command-line tool, the charset/encoding information is not saved and when opened on a Windows computer, the archive does not correctly display filenames.
I know that 7zip creates Zip V1.0 archives, not 2.0. Maybe the charset is limited to MSDos charset ?
How could I specify an encoding using 7zip or another zip tool, in order to get portable archives?
This is a superuser question, BUT...
ZIP uses a default codepage of IBM437. There is the possibility to use UTF-8, but not all zip tools and libraries support that. Some zip tools will do arbitrary code pages, even though the zip spec allows only IBM437 or UTF-8. I think WinRar is one such tool.
DotNetZip does encoding. It will do UTF-8 or an arbitrary code page. if you're writing an app, there is a .NET library. If you are running from a script, there are command line tools. Either way, DotNetZip requires .NET. You will need Mono to run it on Linux.
example for the command line:
zipit.exe Olivier.zip -cp 860 test-éàïù.txt
(to use the 860 codepage) I'm not sure that Windows Explorer correctly handles zipfiles with alternate encoding for the filenames within the zips.
See How to zip specified folders with Command Line for more info on that zipit.exe tool.
Create a ZIP file using specified code page:
7z a -mcp=<code_page> -tzip <archive_name> <file_names>...
Extract files from a ZIP file using specified code page:
7z x -mcp=<code_page> <archive_name>
I know that 7zip creates Zip V1.0 archives, not 2.0.
I couldn't work out how to use 7zip to create a zip v1.0 archive.
You can create version 1 ZIP archives using Info-Zip’s zip 1.1, which is still available (download from the FTP http://infozip.sourceforge.net/Zip.html#Downloads). You’ll need to build it from source (make sysv on a Linux system); then you’ll be able to use the newly-built zip to create old-format archives:
]# ./zip filename.zip file1 file2 file3
]# file filename.zip
]# filename.zip: Zip archive data, at least v1.0 to extract

Resources