Alternative to wkhtmltopdf - wkhtmltopdf

I need to convert html text to pdf.
Most answers here recommend to use pdfkit and wkhtmltopdf (https://wkhtmltopdf.org/).
However, me company doesn't allow me to install wkhtmltopdf (it is also blocked by admin). There was an option to build from source but it seems like google blocks it due to security reason (https://github.com/wkhtmltopdf/wkhtmltopdf).
Is there an alternative or workaround?
I'm very new to python and don't have programming background, appreciate every detailed explanation.

Yes you can just download it and run it directly.
I used that for a shared host (WebFaction) where I have SSH but not root access nor installation option.
cd /tmp
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
cd wkhtmltox/
./bin/wkhtmltopdf
You should be good.
Note that version 0.12.5 is out but has no linux-generic version. Therefore you may want to stick to 0.12.4 for now.

For Python, WeasyPrint would be the obvious replacement for wkhtmltopdf. Don't have a lot of experience, personally, however.

I recomend you to create a PDF on user browser with pdfmake.
Good luck!

Related

Wget raw file from bitbucket and get the latest version without Commit-SHA number in the wget link

I try to download an installscript shell file which I host on BitBucket.
currently im using following command:
wget https://bitbucket.org/projectname/reponame/raw/commit-sha-num/installscript.sh
Later I want to have the possibility to modify my installscript.sh and want that the latest version is downloaded instead of a specific checkout with the commit-sha-number.
Im aware that it could be possible with git clone, but wget would be here more convenient for me if it was possible.
Is there a way to download everytime the latest version of this file from my master branch?
Thanks in advance
Yes. You can use the 'HEAD' keyword in the URL instead of the 'commit-sha-num' part.
wget https://bitbucket.org/projectname/reponame/raw/HEAD/installscript.sh
The "common" (and horribly insecure) approach to that is nowadays to pipe the downloaded content directly into the shell:
wget -O - https://bitbucket.org/projectname/reponame/master/installscript.sh | /bin/sh
See also
https://bitbucket.org/site/master/issues/9358/permalink-to-the-head-revision-of-a
Actually this is documented, see https://confluence.atlassian.com/bitbucket/hyperlinking-to-source-code-in-bitbucket-824476709.html.

plutil: command not found

Ultimate Goal:
I'm trying to convert a binary plist file to an xml format so that I can put it in an array and grab values from it. What I'm finding via web search on this is that the command for Linux comes from libplist.
Problem: I ran "yum install libplist" and it told me libplist is already installed and latest version. I've read that if I enter the following command:
plutil -i /mypath/file.plist > /mypath/file.xml.plist
That this will help accomplish my ultimate goal. However, when I do this only a blank file called file.xml.plist is created. Further, with this command and any other command involving plutil, I get a "bash: plutil: command not found. . ." error. Is libplist seemingly not installed (even though it says it is) or why would I repeatedly get this error? Thanks for your help.
You can use yum to look for a package knowing the binary you want. For instance, if I want to install the package that provides plutil, I simply run this command:
$> yum provides plutil
Unfortunately, the result is No matches found... But you say you read that the libplist package provides this tool. Maybe it was renamed ? Let's use repoquery for this (if you don't have it, yum provides repoquery tells you that you need to install yum-utils).
$> repoquery --list libplist
/usr/bin/plistutil
/usr/lib/libplist++.so.3
/usr/lib/libplist++.so.3.0.0
/usr/lib/libplist.so.3
/usr/lib/libplist.so.3.0.0
/usr/share/doc/libplist
/usr/share/doc/libplist/AUTHORS
/usr/share/doc/libplist/COPYING.LESSER
/usr/share/doc/libplist/README
And what I see is that a program called plistutil was installed with this package !
I've never used plutil, so I can't tell you for sure plistutil is the program you want (but it probably is). What I wanted to do instead with this post is to show how you can use yum to install the packages you need !
I ran across this thread while Googling for the same thing myself. After looking at a few solutions for my own company (Screenplay) I decided to fork and iterate on a open-source, cross-platform, drop-in replacement for plutil:
https://github.com/screenplaydev/plutil
It's forked from Facebook's xcbuild (a tool developed by them to build xcode projects on Linux), but stripped down to just provide plist-editting functionality. That way you won't need to maintain separate code-paths for Mac and Linux environments.
Hope that's helpful!

Creating .deb to install bash script program

I was wondering if the following is possible.
I have a BASH script that I want to make available for some people but I wanted them to only have to "install" the program and not messing around with terminal, so I thought a .deb would be cool.
So what would the "install" do?
Simple. I want to move the script and an icon to a folder (any folder, but I was wondering some hidden folder in Home) and then run a script that creates a launcher in the Applications menu for the first script. It seems there isn't much to it, but for what I've searched, there doesn't seem to be a lot of info...
How can I accomplish this?
By the way, I'm using Ubuntu 11.04.
Basically (install and) run dh-make to set up the debian/ directory, edit the generated files (mainly remove the many you do not need, and fill in a package description and any dependencies in debian/control), then debuild-us -uc -b.
You may also have to set up a simple Makefile for debian/rules to call; it probably only needs an install target to copy the binary to $(DESTDIR)/usr/bin.
Binaries install into /usr/bin and you should not try to override that. The way to have a menu is to add a .desktop file.
Once you have a good .deb you will need to set up a repo for distributing it. The simplest solution is probably to set up a launchpad.net account and create a personal PPA there.
It's not hard to find more information on these topics, but of course, you need to know what to look for. The canonical documentation is the Debian New Maintainer's Guide.
Found this video on youtube that explains IN FULL the process of creating a *.deb for a script or program and even mentions how to do it for a C program.
Full guide in how to build simple *.deb package
Has one bug, btw, that the author, during the making of the *.deb, didn't notice. The path in the *.desktop file for the EXEC parameter is wrong in the example.

Installing RSense for VIM

I am trying to install RSense for vim in fedora. I read this manual. I downloaded the tar ball of rsense and extracted it. Then I copied it to the root/opt directory as given on that page. Then I made a directory vim/plugin in the opt directory and copied the rsense.vim in the plugin directory. But when I write :RSenseVersion in the vim editor,I get a message that the command is not recognized.What have I missed ?
Till now I have not installed vim-ruby plugin as staged on the documentation page. What is this plugin meant for ? Can't RSense alone solve my purpose of writing a neat ruby code with auto-completion,code hinting ?
No, you didn't read the manual.
Once all the dependancies are dealt with you must put the plugin in ~/.vim/plugin.
As for the differences between vim-ruby and RSense, I don't do Ruby so I don't know for sure. Looking quickly at their doc, it looks like they are very different in scope and have slightly overlapping features. I'd install both: vim-ruby for all the low-level Vim tuning and RSense for its supposed code intelligence.
But I have a feeling none of them will help you write "neat" ruby code. Only your programing/ruby skills will.

How do I install modperl under OS X Leopard's default Apache 2?

My attempts to install modperl under the default vanilla Leopard Apache 2 have failed and all I can find online are variations on this:
I would like if possible not to rely on MacPorts or Fink, though if they can be made to work with the default Apache 2 install that would probably be ok.
Macports has it (think apt-get and the likes on linux, but on OS X)
(you can see it listed here)
Haven't installed myself though....
Why not just give up and build/install your own or port versions of perl, apache2, and mod_perl2? Probably easier than fighting with it. (Worked for me.)
(as per comment)
Mmmkay! Sorry, I didn't intend that to be snarky or imply that it's not a valid question. I guess I'll delete this (if I can.) Would it be useful to edit the question to add your rational rationale for not having a separate installation?
Get the latest mod_perl and set the following var:
export ARCHFLAGS="-arch x86_64"
Compile/install as usual.
Taken from this post, "Building mod_perl2 on Leopard" which also links to further details on how to get Apache2::Request (libapreq) working as well.
-
(Not that I've been able to test it since I'm personally back on Tiger running Apache 1.3!)
(And let's see if stackoverflow manages to lift this answer to the top since it is the only "correct" answer)
I asked a very similar question a few days ago and got some good answers:
"How do I use a vendor Apache with a self-compiled Perl and mod_perl?"
The mc ports install of mod_perl tries to install apache 1.3 even if you specify just the mod perl, so thats not a good option.
Try this:
http://www.unibia.com/unibianet/node/32

Resources