Highlighting with Pygmentize in Phabricator not working - pygments

I installed Phabricator for working with Python projects. Everything is ok, but files view present them, as plain text. I want to some highlighting provided by Pygmentize utility.
I have installed Pygments
sudo pip install Pygments
Checked from all users, pygmentize script is available, and located at /usr/local/bin.
I changed
'pygments.enabled' => true,
settings in myconfig.conf.php file of phabricator.
But it's not working ?! I can't find any log crashes, or something else. Have you any ideas why it can happen?

I received answer from Github-Issues service. The reason was that httpd user can't call this function, here is sample which extends own $PATH enviroment. I added this to myconfig.conf.php file:
'environment.append-paths' => array('/usr/local/bin'),
It is strongly recommended to add path with pygmentize to your path.

config file located at:
phabricator/conf/local/local.json
I have add in my config
"environment.append-paths": ["\/bin","\/usr\/bin","\/usr\/local\/bin","\/usr\/local\/sbin","\/usr\/local\/bin","\/opt\/local\/sbin","\/opt\/local\/bin","\/usr\/sbin","\/usr\/bin","\/sbin"],
I am using SmartOS ($PATH locates in /usr/local/sbin:/usr/local/bin:/opt/local/sbin:/opt/local/bin:/usr/sbin:/usr/bin:/sbin)

Related

What is the correct way to set the Glsland Validator Path on the GLSL Lint extension for VSCode on Windows (using WSL)

Trying to play around with shaders on the browser and just installed the GLSL Lint extension for VSCode, which apparently needs to know the path to a glslangValidator binary before working properly.
Said binary can (I'm assuming) be found here: https://github.com/KhronosGroup/glslang/releases/tag/master-tot
However, I've already tried multiple combinations of installation paths, both within Linux and Windows, to no avail: the extension keeps spewing an ENOENT error as can be seen in the picture below:
Considering my setup (Using VS Code on Windows with WSL), where exactly should I place this binary file so that GLSL Lint can properly find it?
I tried, for example, both ~/glslang/bin/glslangValidator and C:\\Users\\{User}\\AppData\\Local\\Packages\\TheDebianProject.DebianGNULinux_31v5hhsz12ds6\\LocalState\\rootfs\\home\\glslang\\bin\\glslangValidator (among other installation paths), but so far none worked.
What am I missing?
I just figured it out--the problem is that using VSCode with WSL will change the file system that the path should be written in. Instead of downloading the windows binary glslangValidator.exe, you should download the linux binary glslangValidator. Check this link and copy the url of the latest release, then download it like so:
cd ~ # Or wherever you want it
wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
unzip glslang-master-linux-Release.zip -d glslang
Then, you need to set the glslangValidatorPath to the WSL path:
"glsllint.glslangValidatorPath": "/home/<username>/glslang/bin/glslangValidator"
*Of course, replace <username> with your username, and if you installed it in a different directory, use that path instead.
I'm using Windows and installed glslang in my root path. After that I set the path parameter like this and it worked:
"glsllint.glslangValidatorPath": "C:/glslang/bin/glslangValidator.exe"
Alternatively, you could add C:/glslang/bin to your PATH variable.
I am using Windows
The following helped me: change the extension of the vertex shader file to ".vert" and the extension of the fragment shader file to ".frag".

how to compile kdesvn from githib repo

I've downloaded the sources for kdesvn from the github repo as I'm thinking to look into working on an addition to the project. Now turns out, I'm not even able to properly compile the downloaded sources: I've created a directory kdesvn-build changed into it and launched cmake ../ (as described on https://github.com/KDE/kdesvn/blob/master/INSTALL-cmake) which does some stuff but then stops saying:
CMake Error: The following variables are used in this project, but
they are set to NOTFOUND. Please set them or make sure they are set
and tested correctly in the CMake files: SUBVERSION_INCLUDE_DIR
Now, I don't know what SUBVERSION_INCLUDE_DIR should be set to nor could I find it searching around the web. Anyone?
It is a directory containing svn_*.h files. If you are on Linux, you'd need to install something like subversion-dev package. On FreeBSD headers are installed with main package, and the directory is /usr/local/include/subversion-1/.

How to eliminate RubyMine false "No such file to load" errors

I've recently installed RubyMine on a second machine and cloned a GitHub repository there.
My application runs exactly the same as on the first machine, but the RM code inspection result is radically different: I get dozens of "No such file to load" errors.
This even though the application runs fine both from the command line and from RM.
In dialog Run/Debug Configurations, I have specified load paths (-I. -I..) in the Ruby arguments.
Does the code inspection not honor the configuration? Or perhaps it's using a different configuration?
A bit late, but you may need to mark the directories that are load path roots in your app within the Rubymine tree - right click and do "Mark Directory As/Load Path Root".
For me the other solutions did not work. However, the problem was that RubyMine detected the wrong ruby version - while rvm for the project was ruby 2.4.1, in RubyMine it defaulted to the last version it had (2.4.2). So going to RubyMine > Preferences > Ruby SDK & Gems and changing the version for the project to the correct one solved it.
If you use the "Mark Directory As/Load Path Root" action, this will apply for IDE autocompletion only. It will not be propagated onto the interpreter (as it would be in PyCharm with Python).
You have to either keep using the -I switch, or configure $LOAD_PATH in your code, or (preferably) set up a Gem project with bundler support. You can then configure the path in a gemspec file. See https://www.jetbrains.com/help/ruby/creating-gem-project.html.
Sources:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206741945-Load-Path-not-working-at-all-
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206727915-Building-RubyGems-lib-in-load-path-
You can try changing Project Path Mappings and set relative Local Path and Remote Path to get it to work.

how to run coffeescript with web storm

I'm having trouble running a coffeescript configuration with webstorm. If I enable the coffeescript plugin in the run configuration I get the following error
/usr/bin/coffee app.coffee
env: node: No such file or directory
I tried the solution in the support forums of adding my path variable to the environment variables but still no fix.
Because, the executable file is not found yet.
Goto Terminal and type: echo NODE_PATH or echo $NODE_PATH to see where is the file.
On windows, C:\Users[YOUR_USER_NAME]\AppData\Roaming\npm\node_modules\coffee-script\bin\coffee
So, use Spotlight search tool to have a look at /usr/local/npm ..... or somewhere else.
Try to pass absolute path to your app.js. Webstorm sometimes mess with relative paths.
On Windows, I had a lot of trouble with this, you must find your "coffee" file. BTW, this could help you too.
After you installed Node.js and installed the CoffeScript plugin:
Download the last version (or source) from CoffeeScript.org
Unzip it wherever you want. In my case I unzipped the jashkenas-coffeescript-1.10.0-0-gf26d33d.tar.gz on D:\tools\
Check 'Run with CoffeeScript plugin'
Target the coffee executable on menu 'Run > Edit Configurations...':

Zf Tool cannot find Zend Framework

Just started working with the Zend Framework Zf Tool and I've already come across a problem I've spent hours trying to figure out.
For some reason when I run the Zf show version command I get a ZF ERROR indicating it cant find the Zend Framework a to add it to my php.ini include_directory.
Here is my setup. I'm currently have WAMP installed on my local machine.
c:\wamp
I copied the zf.bat and zf.php files into the servers php directory. The path to the php directory has been added to the path environment variable. I'm pretty sure it works because I run the zf show version command in the console and get a ZF ERROR.
I keep my copy of the Zend Framework inside
c:\wamp\includes
So I added this to the php.ini include_path. include_path = ".;c:\wamp\includes"
I checked that this setting was set correctly by checking phpinfo() function. Which shows
include_path .;c:\wamp\includes .;c:\wamp\includes
So I think I have everything setup correctly. I can't work out what I'm missing.
I also tried setting the ZEND_TOOL_INCLUDE_PATH with no success.
Any help would be appreciated. PS I did check other posts here but none of the suggested
I have worked it out! Finally. The way I have my local wamp setup there is 2 php.ini files I have to edit.
The one that made the different is the php.ini inside the Apache2 directory.
Thanks everyone for their help. I appreciate it.
Well im not sure how you downloaded installed the framework but my guess is that you dont have enough of you include path based on the way Zend release packages are constructed. The Zend folder contained in the Zend Framework installation needs its parent folder to be on the include path so typically you would add something like:
c:\wamp\includes\ZF_BASE_DIR\library
This is because the zf package structure looks like:
ZendFramework-VERSION/
README.txt
INSTALL.txt
LICENSE.txt
bin/
library/
If you extracted ZF from the archive you will get a Zend-some_version folder, but the actual ZF is in
"include_path\Zend-some_version\library\Zend", so your include path should point include_path\Zend-some_version\library\
Just to add to what Tjorriemorrie said and to explain in detail how I got my installation on win 7 to work as simply as possible:
Download your preferred Zend package from "http://framework.zend.com/downloads/latest" to "C:\wamp\www\"
unzip your zip file so that you have the extracted Zend folder (with version name) under "C:\wamp\www\".
Rename your folder by removing the version so that you end up with "C:\wamp\www\ZendFramework"
Run a simple php file with phpinfo() in your browser. Note the entries for: "_SERVER["PATH"]" under PHP Variables
"Path" under Environment
"Loaded Configuration File" at the top
"include_path" under Core and
"extension_dir" under Core as well.
"_SERVER["PATH"]" and "Path" must be identical (no brainer)
There should be only one listing for your apache server and that should be the listing under "Loaded Configuration File" but without the "php.ini". So, if your "Loaded Configuration File" is "C:\wamp\bin\apache\apache2.2.22\bin\php.ini" you must have "C:\wamp\bin\apache\apache2.2.22\bin" in your path and that must be the ONLY reference to an apache server. If you have multiple references to apache servers Windows may pick the wrong one depending on your PATH order and use the wrong php.ini file.
Your "extension_dir" will tell you the version and location of php you are using. It is common to have different php folders lying around such as "C:\php", "C:\wamp\bin\php\php5.4.3", "C:\wamp\bin\php\php5.3....", etc. The extension directory will tell you which one of these php folders ZF will "reference" when it is looking for its library. For example, if your extension directory says "c:/wamp/bin/php/php5.4.3/ext/", you want to focus on "c:/wamp/bin/php/php5.4.3"
Go back to your PATH and a) add the string for this php version and b) remove all the other references to the other php folders
Now that you know your running and primary php and apache folders, shutdown (do not restart), shut down your computer and boot back up (restart does not always let the PATH completely reset.
Go to BOTH php.ini files at a) "C:\wamp\bin\apache\apache2.x.y\bin" and "C:\wamp\bin\php\php5.4.3" and find the include_path variable for Windows
Replace the default line, which looks like:
;include_path = ".;c:\php\includes;"
with
include_path = ".;c:\php\includes;C:\wamp\www\ZendFramework\library"
ON BOTH FILES just as Tjorriemorrie notes.
Restart All Services by clicking the wamp icon and selecting said option
At this point my zf tool was working. But, just to be safe, shut down and bootup
Smile and grab a beer!