I want to scan a text file such as how much line in a .sh file. In sonarqube6.7 unknown files = true option is missing. I was in sonar-project.properties file to configure sonar.import_unknown_files = true also was not used. Does a higher version support unknown files?
The property sonar.import_unknown_files has no effect with SQ 6.7. By default, all the files are indexed (SONAR-8623). Then SQ keeps only the files on which a given Sensor (a plugin) saved something on it (SONAR-8631).
For your case, you need a custom plugin that:
declares a new language dealing with .sh files (similar to: https://github.com/SonarSource/sonar-custom-plugin-example/blob/master/src/main/java/org/sonarsource/plugins/example/languages/FooLanguage.java)
implements a Sensor implementing some logic to raise issues/metrics on your .sh files
Related
Is there a command or some tools that can help you get the corresponding CONFIG_XXX options to enable a module. For example, if I want to enable module nvme, which CONFIG_XXX should be y or m?
I know there are some documents which may states the config of nvme. But I want to know if there is a command or tool which can help you get the CONFIG——XXX only if you type a command.
Thanks.
if I want to enable module nvme, which CONFIG_XXX should be y or m?
As far as I know, there is no documentation or single-purpose command that would report the specific configuration symbol that builds a module.
However the Makefile that actually specifies the building of the module in question is the sole authoritative source for this information.
Typically the relevant Makefile would be in the subdirectory (or the parent directory) as the source module.
If you're not sure where the source module resides, then you could search all the Makefile files in the kernel source for the conditional build of the .o object file:
$ find . -name Makefile | xargs grep nvme.o
./drivers/nvme/host/Makefile:obj-$(CONFIG_BLK_DEV_NVME) += nvme.o
... <irrelevant search results>
$
So the answer would be CONFIG_BLK_DEV_NVME.
Note that the subdirectory that has the relevant Makefile will also have the Kconfig file that describes the configuration symbol you just identified.
Rather than manually edit the .config file, use the make menuconfig command.
Using the menuconfig assures you that your configuration will meet all dependencies and trigger all auto-selections properly.
You can use the search feature (simply type the slash character, /, and the config name) to retrieve help text to guide you to the location of the configuration prompt.
The help text and status of CONFIG_BLK_DEV_NVME could look like:
Symbol: BLK_DEV_NVME [=n]
Type : tristate
Prompt: NVM Express block device
Location:
-> Device Drivers
(1) -> NVME Support
Defined at drivers/nvme/host/Kconfig:4
Depends on: PCI [=n] && BLOCK [=y]
Selects: NVME_CORE [=n]
Selected by [n]:
- NVM [=n] && BLOCK [=y] && PCI [=n]
The current configuration state/status of each configuration entry mentioned is displayed within square brackets and an equals sign.
The Depends on: line indicates that both CONFIG_PCI and CONFIG_BLOCK have to be enabled in order for the CONFIG_BLK_DEV_NVME prompt to be even visible.
You may have to use the search capability to convert these other CONFIG_xxx names to their menu prompts and locations.
The Selects: line indicates the other configuration entries that will be automatically enabled if this config item is selected.
The Selected by [x]: line(s) indicates the other configuration entries that could automatically enable this config item. In this case the logical expression indicates that when three other config entries are enabled, this config is also enabled automatically.
You can search the options in the interactive kernel configuration menu but you have to build the menu first via make menuconfig, then type / followed by the term you're looking for. Each Symbol: in the search results is followed by the option name without CONFIG_ prefix. It also shows location of the option in the menu tree.
Some of the options are tristate: y - the feature is going to be built into the kernel image, m - the feature should reside in a loadable module, n - the feature is disabled.
You need to add CONFIG_BLK_DEV_NVME=m (either edit .config or use make menuconfig) to enable support of nvmeNnM block devices as a loadable module.
I am trying to configure NXlog to work with AlienVault based on the guide here
I installed the custom config file from AlienVault and modified the destination IP only. When I did this I could not get the NXlog service to start - Then I reinstalled the default config but I still cannot get it to open.
I edited the file in notepad which I thing should be safe, however I have read here that it is possibly the UTF-8 BOM - I am not sure how to check if there is one but I do not believe there is because I only used notepad.
The first line in the config file looks like so:
define ROOT C:\Program Files (x86)\nxlog
The NXlog Log file with the errors is only displaying this error:
nxlog failed to start: Invalid keyword: define at C:\Program Files (x86)\nxlog\conf\nxlog.conf:1
Not very helpful - Seems to be choking on the very first word - Anyone seen this before???
I'm pretty sure that's caused by the UTF-8 BOM in your config file. I suggest using and checking with an editor that can handle this. In HEX mode you can confirm whether the file has a BOM or not.
The NXLog EE v4.0 can cope with the BOM properly BTW.
As B0ti mentioned, my problem was caused by the BOM - I couldn't figure out how to fix this on windows so I downloaded the file into a Linux environment and fixed it there. To do so follow these steps -
First I verified there was a BOM in place with the file command:
ex: file filename.txt -This will print information about the file - if there is a BOM you will see that.
Next I followed the answer here for removing the BOM:
Basically just do this in the Linux box - sed '1s/^\xEF\xBB\xBF//' < orig.txt > new.txt
Then I transferred the new file back to the Windows box and all was right with the world!
I want to run my project through Cmdenv. In the project's omnetpp.ini file I specialized ned-path as: ned-path = /omnetpp-4.6/samples/VDLM4net;/omnetpp-4.6/samples/MiXiM/src/base;/omnetpp-4.6/samples/MiXiM/src/modules
And when I'm trying to use Cmdenv there is an error:error in console
I'm using omnetpp-4.6 on Windows with standalone project referenced to MiXiM-2.3
I solved my problem. At first, in .ini file I specified all possible ned paths than potentially can be used in project. In my case it is look like this: ned-path = .;../MiXiM/examples;../MiXiM/src/base;../MiXiM/src/inet_stub;../MiXiM/src/modules . After it, in command line I wrote: ./VDLM4net -u Cmdenv -l ../MiXiM/src/mixim So, additionally, I specified the MiXiM shared liabrary. All works fine now.
I would like to delete a file after all the rows in the file have been processed.
My streams look like
source (file --fixedDelay=0 --outputType=text/plain --dir=XXX) |
splitter --expression=payload.split('\\n') |
transform -> filter -> sink
My files are stored in a directory, that is being watched by the file module. I would like that each file is deleted after it has been processed.
Thanks.
Indeed it is surprising that the file source does not have an option for deleting the file after processing, which can be confirmed by looking at the configuration file in xd/modules/source/file/config/file.xml (as of version 1.1.0).
While the file source does not have this option, the sftp source does have it. Hence you could use the sftp source. This will require an ssh server on the machine where spring xd is installed. Does this help?
You may also want to add your own custom source module by configuring a file transformer. File transformers support a delete-files="true" option:
http://docs.spring.io/spring-integration/reference/html/files.html
I've been trying to configure SublimeLinter to use different JSHint settings, but my settings are being totally ignored. Mostly I just want to be able to use double quotes without getting a linting error. Here's what I have in my 'User' SublimeLinter.sublime-settings
{
"jshint_options":
{
"evil": true,
"regexdash": true,
"browser": true,
"wsh": true,
"sub": true,
"quotmark" : true
}
}
The file is definitely being parsed, as it throws an error whenever it's not properly formatted (amusingly this includes whenever the strings are wrapped in single quotes). It's also ignoring more than just the quote preference- I can set "evil" to false and it'll still give me eval warnings.
Any ideas? This is on OSX.
Thanks in advance.
FYI just in case: jshint_options is no longer available on SublimeLinter-jshint and settings are now set with .jshintrc files. See this and this.
I had the exact same problem. The default .jshintrc in "sublime/preferences/package settings/js hint/set linting preferences" did absolutely nothing for me either.
In order to fix it, I created a .jshintrc file in the root folder of the web project I was working on. I then opened the folder through sublime text and sublinter/jshint picked up my settings.
Maybe your Jshint options are overridden by a .jshinrc file. According to SublimeLinter README file :
SublimeLinter supports .jshintrc files. If using JSHint, SublimeLinter will recursively search the directory tree (from the file location to the file-system root directory). This functionality is specified in the JSHint README.
and
The jshint follows convention set by node-jshint (though node is not required) and will attempt to locate the configuration file for you starting in pwd. (or "present working directory") If this does not yield a .jshintrc file, it will move one level up (..) the directory tree all the way up to the filesystem root. If a file is found, it stops immediately and uses that set of configuration instead of "jshint_options".