How to unable npm output color [duplicate] - node.js

When starting an Express webapp from Eclipse, output in console has strange characters:
[90mGET / [32m200 [90m310ms - 162b[0m
I guess they are "color" characters: when running express from a terminal, output is colorful.
How to disable color output from Express?

You can pass your own format instead of dev.
refer this:
http://www.senchalabs.org/connect/logger.html

I think the 'tiny' logging format is similar to the (colored) 'dev' format:
app.use(express.logger('tiny'));

Related

How to check if the environment variable "PROJ_LIB" is defined and how to unset it ? (PyQGIS Standalone Script Executer)

I just tried the standalone PyQGIS application by running the custom script "Proximity.py"* in a VS Code project without the need of a GUI (such as QGIS).
But, when I run the python-program I get the following message:
proj_create_from_database: C:\Program Files\PostgreSQL\14\share\contrib\postgis-3.2\proj\proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 0 whereas a number >= 2 is expected. It comes from another PROJ installation. (see also: Error Message after launching the configuration (launch.json) from VS Code (when pressing F5))
I'm trying this online example with the following installations:
PostgreSQL 14
Python39
.vscode\extensions\ms-python.python-2022.4.1\pythonFiles\lib\python\debugpy\launcher
osgeo4w-setup.exe (including QGIS LTR)
I read that there is a solution by undefining [PROJ_LIB] before importing pyproj or osgeo: del os.environ ['PROJ_LIB'] as described under this link. If this is also supposed to be the correct solution in this case, can someone help me with step-by-step instructions (for dummies)?
. * The "Proximity.py" script is a pyqgis standalone example from "https://github.com/MarByteBeep/pyqgis-standalone"
Finally, I got a solution to be able to run the "standalone PyQGIS"* example "Proximity" (provided by MarByteBeep).
This solution was possible without needing to launch the configuration file "launch.json" as above described. And so, avoiding the need to make any configuration to the environment variable "PROJ_LIB" by trying to circumvent the above issue.
I just first added the following two code-lines (see here line 2 and 3) in the python file "main.py" so as to be able to use the plugin "PROCESSING" (initially line 8 of the "main.py" file), then I store it and finally I ran it.
Line 1: from qgis.core import
Line 2: import sys
Line 3: sys.path.append('C:\Program Files\QGIS 3.24.1\apps\qgis\python\plugins')
Line 4: qgs = QgsApplication([], False)
Line 5: ...
The Proximity example is based on the answer of "Mar Tjin" to the following Question: "Looking for manual on how to properly setup standalone PyQGIS without GUI"
. * By "Standalone PyQGIS" I refer to code/scripts that can be run outside the QGIS-GUI (=> QGIS-Desktop/Server Application). In my case under the external Editor VS Code

"-m" not visible when using Git in Windows Terminal

I'm using Windows Terminal and I'm having trouble with Git, when I type -m it's invisible:
I've tried modifying the .gitconfig file but haven't managed to find the parameter to that specific thing. How can I change it?
This looks like a PowerShell theme issue - check the output of Get-PSReadLineOption - if you see any invisible colors:
PowerShell invisible colors
You can fix this by specifying your own colors - e.g: Set-PSReadLineOption -Colors #{ 'Number' = "blue"; 'Member' = "DarkGray"}

Linux pipe to text file shows unwanted special characters in text editor

my
symfony help >> ./symfonyBinConsole2copyQ.sh;
looks encrypted for me.
result looks in Kate editor like so:
[32mSymfony CLI[39m version [33mv4.25.4[39m (c) 2017-2021 Symfony SAS
...
expected the same formation like i know it from terminal:
Symfony CLI version v4.25.4 (c) 2017-2021 Symfony SAS
...
source i readet:
-https://stackoverflow.com/questions/41428967/linux-pipe-mysql-cli-show-variables-to-text-file
Pitest: How to redirect the log output to a file?
Various console apps either default to showing with Ansi terminal codes, or without. The Symfony console command has a --no-ansi option to turn it off.
An issue at https://github.com/symfony/cli/issues/222 also suggested the env var NO_COLOR, which does also work.
NO_COLOR=1 symfony list

Autoformatting failed, buffer not changed : Sublime text

While setting up Python Development Environment in Sublime text 3, I wanted Auto formatting on and hence I made the following settings in Preferences > Package settings > Anaconda > Settings User
{
"auto_formatting": true,
"autoformat_ignore":
[
],
"pep8_ignore":
[
"E501"
],
"anaconda_linter_underlines": false,
"anaconda_linter_mark_style": "none",
"display_signatures": false,
"disable_anaconda_completion": true,
"python_interpreter": "/usr/local/bin/python3"
}
The auto_formatting value is set to true in user settings and it is set to false in default settings .
The auto formatting does not work out and gives me Autoformatting failed, buffer not changed error . Also tried changing auto_formatting_timeout = 5 //seconds , but that didn't work out . It would be of great help if someone could help me out .
I had the exact same issue. The problem is the last line is pointing to the wrong path for your python interpreter
Preferences > Package Settings > Anaconda > Settings - User
Delete the last line
"python_interpreter": "/usr/local/bin/python3"
Replace it with
"python_interpreter": "C:\\Users\\YOUR_NAME\\AppData\\Local\\Programs\\Python\\Python38-32\\python.EXE"
IMPORTANT: Your python interpreter path might be different to mine so find out where it is. Remember you need to use TWO backslashes in the path not ONE
Sublime is looking for python in environmental variable when you build it, and it is not able to find it there. You can test it in cmd by typing python and if it opens Microsoft store then here is the fix you can do, it worked for me. Open setting -> search for manage app execution aliases -> turn off "python.exe" and "python3.exe". Now check if you can get python in cmd by typing python, if you do then sublime problem should be fixed. If you want to know why this works follow this stack overflow

Logstash 5 configure log4j logging for itself (not as plugin)

This is just for future reference since I solved it myself.
When I switched from logstash 2.x to 5.x, I was dealing with this warning (when I was runnig my logstash on this path D:\somepath\logstash-5.0.1):
Could not find log4j2 configuration at path /somepath/logstash-5.0.1/config/log4j2.properties. Using default config which logs to console
After some searching on internet and digging in ruby code (in the extracted logstash) I have found out this:
necessary to use path.settings (as mentioned many times) correctly
use correctly file or directory as URL path.
Finally I run my logstash as:
logstash.bat --path.settings=file://D:/somepath/logstash-5.0.1/config

Resources