How do I use custom binary in my dokku host? - dokku

Part of my code requires me to run pdftotext directly. I'm not sure how to install it from my dokku installation, any help would be great.
Thanks in advance

You can install custom packages via apt using the dokku-apt plugin. Install that plugin and add a file called apt-packages to the base of your code repository. This file should have the following as it's contents:
poppler-utils
The poppler-utils package includes pdftotext, so on your next deploy, this file will be picked up and the plugin will automatically install the package for you.

Related

RuntimeError: Ninja is required to load C++ extensions

I've downloaded an implementation of stylegan2 from the following github:
I added the path to my PYTHONPATH variable and now when importing their models I get the following error:
RuntimeError: Ninja is required to load C++ extensions
I'm working on our University computers, it seems that cpp_extension.py is only looking for an installation of ninja that is local under /usr/local/bin however I don't have the permissions to install anything there.
I was able to use pip to install Ninja on my virtual environment. Is there any possible way of having this piece of code use ninja from there?
Thanks
try
pip install ninja
it works for me
https://github.com/NVlabs/stylegan2-ada-pytorch/issues/39#issuecomment-900970462

WP-CLI installation over composer

I'm working on a wordpress skeleton for practice. I've got a Composer project and installed the wp-cli/wp-cli dependency.
I want to create and run custom tasks with this wp-cli, for example to download the core of WordPress into this project. This because I'm not putting the core of wordpress into my git repository.
Because I have installed the wp-cli/wp-cli dependency only in my project and not globally over my local machine, I can't run the wp ... commands a normal terminal.
For my own research, I found out that I can use the Command Line Tool Support plugin in my IntelliJ IDE. With this plugin I can use the composer dependency to run commands with the wp-cli. I don't think this is the right solution, because everyone might have a different IDE and/or operating system.
How can I run wp-cli commands over the installation over Composer?
Instead of running commands with /vendor/bin/wp ..... I found out I have to replace the / with a \.
To run commands from this binary, this syntax should be used like:
vendor\bin\wp ...

Using WP-CLI on Windows to Manage Remote WordPress Installation?

I'm trying to manage my remote shared hosting WordPress installation via WP-CLI installed on my local Windows machine. So far I have managed to install WP-CLI (The "WP" command is available to run).
But when I try and connect to a remote URL with "wp --http", I get the following messsage:
RESTful WP-CLI needs to be installed. Try 'wp package install wp-cli/restful'
So I run the suggested command and I get:
Composer directory for packages couldn't be created.
I hadn't installed via composer. Instead, I manually instaled PHP and then downloaded the "wp-cli.phar" file. So I tried to install composer on Windows, but couldn't make head or tail of what downloads where. I "think" I managed to install wp-cli, but couldn't see where it had installed the files...and it just didn't work out.
Do you guys know of a more straightforward way to do this?
Concerning the error: Composer directory for packages couldn't be created.
If you did not set the environment variable WP_CLI_PACKAGES_DIR the default is ~/.wp-cli/packages/ which works for Linux but not for Windows.
I set this variable and the command 'wp package install wp-cli/restful' now successfully creates the directory for packages and the composer.json file but still doesn't install wp-cli/restful.
So I used composer directly and it successfully installs wp-cli/restful.
If I use the parameter --http=me.local.com (which matches example in the documentation) I get the error "Couldn't auto-discover WP REST API endpoint from me.local.com.' However, if I change this to --http=me.local.com/wp-json it works. The actual command I used is:
wp --http=me.local.com/wp-json rest post list

Wordpress plugin install fail

Today I am starting a new project and I am stuck on wordpress plugins installation
Downloading install package from
https://downloads.wordpress.org/plugin/types.1.8.11.zip…
Unpacking the package…
Installing the plugin…
The package could not be installed. No valid plugins were found.
Plugin install failed.`
I ve tried different plugins and all of them produce this error! any ideas?
you can use class-tgm-plugin-activation to install your plugin automatically at your theme
visit and download, https://github.com/TGMPA/TGM-Plugin-Activation
include at your functions
I managed to sucessfully install and activate it, right now. I used wp-cli, but that should not make much difference. I can recommend it though, as it is more verbose, which helps tracking down errors
What is the result of
ls -l .../path/to/wordpress/wp-content/plugins
Assuming you are on Linux/Unix. Do the other plugins have different permissions/users?

Develop and Debug Atom Package

I have just began working on Atom.io Package development, and based on this tutorial, have learnt from how to create package development skelton file to how to publish your package.
However, I do not know how to check/debug/develop your package. I know I can use Jasmine via alt-cmd-I or Developer Console (for Atom is based on Chromium), still if you want to check the behavior of your package, do I have to re-publish or install your package manually every time?
When working on packages locally, here's the recommended workflow:
Clone your package from GitHub using apm develop <package-name>. This will clone the package's repo to your local ~/.atom/dev/packages/<package-name>
cd into this directory
Start Atom in this directory using atom -d .
Now you can work on the package, make changes, etc. Once you're ready to reload, you can use View > Developer > Reload Window to restart Atom with the changed package.
If you have your package sources locally on your machine, you can skip the first step (apm develop) and simply create a symbolic link from your sources to ~/.atom/dev/packages/<package-name.
Already have a local repo of the package?
To add to nwinkler's answer, if you already have a repo of the package locally, you can use
apm link --dev
to automatically create a symbolic link to the ~/.atom/dev/packages/ directory.
Make sure to completely restart atom in developer mode with
atom -d
or in View > Developer > Open In Dev Mode...
If you just want to use a local package (not in dev mode), you can use apm link directly. And apm unlink to remove the symbolic link to ~/.atom/packages.

Resources