Configuration of max-len in eslint - eslintrc

I am trying to configure eslint and have this rule:
"max-len": [1, { "code": 120 }],
I know it's reading this file, because lint complains if I misconfigure this line.
Notice that this should warn at a length of 120. However when I lint my files I get this:
5:1 error This line has a length of 174. Maximum allowed is 140 max-len
I have know idea where the 140 is coming from. The docs say max-len has a default of 80. Also why the error? It seems like lint is disabling my max-len and adding some other random config.
What is going on?

Related

SwiftLint: how to configure rule severity for a rule with warning and error configurations

I would like to configure the Swiftlint cyclomatic_complexity rule to always have the severity level of warning.
Here are the approaches I have tried in the .swiftlint.yml.
cyclomatic_complexity: warning
cyclomatic_complexity:
severity: warning
Both of these yield the same result. Namely, upon running swiftlint, before linting it prints the following error.
Invalid configuration for 'cyclomatic_complexity'. Falling back to default.
How do you configure the severity of this rule for swiftlint, so that it only generates warnings and not errors?
# .swiftlint.yml
cyclomatic_complexity: 20
Try this in .swiftlint.yml, it works for me:
cyclomatic_complexity:
warning: 10
error: 20

Cloudformation root stack resources are not split properly with serverless-plugin-split-stacks

We use serverless-plugin-split-stacks to break resources into nested stacks and have set it up in serverless.yml as follows.
custom:
splitStacks:
perFunction: false
perType: true
perGroupFunction: false
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
Everything was going well until we were greeted with the following error
Error: The CloudFormation template is invalid: Template format error: Number of resources, 206, is > greater than maximum allowed, 200
When this error happens, the condition of the nested stacks is as follows.
Serverless: [serverless-plugin-split-stacks]: Resources per stack:
Serverless: [serverless-plugin-split-stacks]: - (root): 206
Serverless: [serverless-plugin-split-stacks]: - APINestedStack: 55
Serverless: [serverless-plugin-split-stacks]: - PermissionsNestedStack: 49
My problem is that even though we have set up split-stacks properly, why doesn't it split the resources in the root stack into new stacks?
If there's anything I have missed here, please educate me on this. Thanks for all helpful suggestions.
This npm package serverless-plugin-split-stacks not working. This package has been Deprecated - FAILED - BUG
For more information: https://www.npmjs.com/package/serverless-plugin-split-stacks
To resolve your problem (Serverless Workarounds for CloudFormation's 200 Resource Limit) read some tips:
https://www.serverless.com/blog/serverless-workaround-cloudformation-200-resource-limit

JPAM Configuration for Apache Drill

I'm trying to configure PLAIN authentification based on JPAM 1.1 and am going crazy since it doesnt work after x times checking my syntax and settings. When I start drill with cluster-id and zk-connect only, it works, but with both options of PLAIN authentification it fails. Since I started with pam4j and tried JPAM later on, I kept JPAM for this post. In general I don't have any preferences. I just want to get it done. I'm running Drill on CentOS in embedded mode.
I've done anything required due to the official documentation:
I downloaded JPAM 1.1, uncompressed it and put libjpam.so into a specific folder (/opt/pamfile/)
I've edited drill-env.sh with:
export DRILLBIT_JAVA_OPTS="-Djava.library.path=/opt/pamfile/"
I edited drill-override.conf with:
drill.exec: {
cluster-id: "drillbits1",
zk.connect: "local",
impersonation: {
enabled: true,
max_chained_user_hops: 3
},
security: {
auth.mechanisms: ["PLAIN"],
},
security.user.auth: {
enabled: true,
packages += "org.apache.drill.exec.rpc.user.security",
impl: "pam",
pam_profiles: [ "sudo", "login" ]
}
}
It throws the subsequent error:
Error: Failure in starting embedded Drillbit: org.apache.drill.exec.exception.DrillbitStartupException: Problem in finding the native library of JPAM (Pluggable Authenticator Module API). Make sure to set Drillbit JVM option 'java.library.path' to point to the directory where the native JPAM exists.:no jpam in java.library.path (state=,code=0)
I've run that *.sh file by hand to make sure that the necessary path is exported since I don't know if Drill is expecting that. The path to libjpam should be know known. I've started Sqlline with sudo et cetera. No chance. Documentation doesn't help. I don't get it why it's so bad and imo incomplete. Sadly there is 0 explanation how to troubleshoot or configure basic user authentification in detail.
Or do I have to do something which is not told but expected? Are there any Prerequsites concerning PLAIN authentification which aren't mentioned by Apache Drill itself?
Try change:
export DRILLBIT_JAVA_OPTS="-Djava.library.path=/opt/pamfile/"
to:
export DRILL_JAVA_OPTS="$DRILL_JAVA_OPTS -Djava.library.path=/opt/pamfile/"
It works for me.

Snort stream5 preprocessor configuration error

Whenever I use bind_to option along with stream5_tcp preprocessor, there
is a error saying "Stream not properly configured.. exiting". The code
stops with at line 617 of spp_stream6.c with if check that says
if(configNotValid). However other stream5 preprocessor options are
working fine. This happens only if I add bind_to. I followed the
ordering as well mentioned in the documentation. This is how my snort
config file looks like
preprocessor stream5_global:
preprocessor stream5_tcp: bind_to 192.168.1.3, policy linux, ports
both 5556 80
preprocessor strean5_udp: ignore_any_rules
I am using Snort 2.9.9.0.

in wordpress, a valid callback for cp_admin_init and _canonical_charset

I'm using WordPress 3.5 with child-theme of Twenty Eleven 1.5. Suddenly I'm getting following Warning,
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'cp_admin_init' was given in /home/templ/public_html/wp-includes/plugin.php on line 406
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '_canonical_charset' was given in /home/templ/public_html/wp-includes/plugin.php on line 173
I'm using following plugins:
download-manager 2.3.9
wordpress-seo 1.4.7
wp-pagenavi 2.83
Some more points:
1) If I'm giving mysite.com it's giving above 2 line warning. If I give www.mysite.com, the following line also include,
Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-includes/pluggable.php on line 876
2) If I give mysite.com/wp-admin/ or www.mysite.com/wp-admin/, It's giving 1st warning and 3rd warning.
3) If I goto www.mysite.com/wp-login.php, It's giving following 5 warning.
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'cp_admin_init' was given in /home/templ/public_html/wp-includes/plugin.php on line 406
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '_canonical_charset' was given in /home/templ/public_html/wp-includes/plugin.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-login.php on line 368
Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-login.php on line 380
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'wp_authenticate_spam_check' was given in /home/templ/public_html/wp-includes/plugin.php on line 173
4) If I give correct username and password, it's not going to login. giving following problem,
ERROR: Invalid username or incorrect password.
ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.
I'm trying to find solution. I can't. Can any-one help me?
This sounds like a corrupted install. So you have a few options to fix this:
Attempt to get logins operational again and doing an upgrade though the wp-admin: Explained Below.
Do a manual Update: http://codex.wordpress.org/Updating_WordPress#Manual_Update
But First: Make a Backup
Please be sure to backup your install! Before proceeding: http://codex.wordpress.org/WordPress_Backups
Getting Logins Working: Masking the symptoms
First I would disable debugging output because that should fix most of these issues. When a warning occurs in Wordpress, PHP starts writing the response body and closes the header section of the response. This means that whenever Wordpress tries to add another header after the original warning was raised, PHP will raise another warning:
Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-login.php on line 380
So if we disable debugging then we should be able to mask the symptoms. This is a quick patch for a larger problem that we will have to solve with an in-place upgrade
To Disable Debugging
Ensure that the following constants exist and are set correctly is in your wp-config.php file
define('WP_DEBUG', false);
and
define('WP_DEBUG_DISPLAY', false);
Now you should be able to login to your site as an administrator without errors.
Disable your Plugins
Disable all your plugins in Plugins -> Installed Plugins This is imperative so that we can make sure that the update goes smoothly.
Do an Update
Go to Dashboard -> Updates and click either Update Now or Re-install Now
Reactivate your Plugins
Reactivate all your plugins in Plugins -> Installed Plugins and update them if necessary.
That's It
That's the process for reinstalling Wordpress. The key here is that you have Debugging enabled on a production site which is not good. You should always have WP_DEBUG and WP_DEBUG_DISPLAY set to false in a production environment.