Disable rule in sonar

The right way to do is to put something like this on sonar-project.properties file per project: sonar.issue.ignore.multicriteria=e1,e2 # tab characters should not be used sonar.issue.ignore.multicriteria.e1.ruleKey=squid:S00105 sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.java # right curly braces should be on a new line sonar.issue.ignore.multicriteria.e2.ruleKey=squid:RightCurlyBraceStartLineCheck sonar.issue.ignore.multicriteria.e2.resourceKey=**/*.java There are docs here on how to ignore specific rules for specific files, which links to an … Read more

How can I store a binary file in a Kubernetes ConfigMap?

Binary ConfigMaps are now supported since Kubernetes version 1.10.0. From the readme notes: ConfigMap objects now support binary data via a new binaryData field. When using kubectl create configmap –from-file, files containing non-UTF8 data will be placed in this new field in order to preserve the non-UTF8 data. Note that kubectl’s –append-hash feature doesn’t take … Read more

loading configuration file in clojure as data structure

If you want to read java-style properties files, look at Dave Ray’s answer – though properties files have many limitations. If you are using Clojure 1.5 or later, I suggest you use edn, the extensible data notation used in Datomic – it’s basically clojure data structures, with no arbitrary code execution, and the ability to … Read more

Where to set system default environment variables in Alpine linux?

It seems that /etc/profile is the best place I could find. At least, some environment variables are set there: export CHARSET=UTF-8 export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin export PAGER=less export PS1=’\h:\w\$ ‘ umask 022 for script in /etc/profile.d/*.sh ; do if [ -r $script ] ; then . $script fi done According to the contents of /etc/profile, you can … Read more

How do I get at the goodies in my Grails Config.groovy at runtime?

In more recent versions of grails ConfigurationHolder has been deprecated. Instead you should use the grailsApplication object. grailsApplication.config.grails.serverURL If in a Controller or Service then use dependency injection of grailsApplication object. e.g. class MyController{ def grailsApplication def myAction() { grailsApplication.config.grails.serverURL } See How to access Grails configuration in Grails 2.0?

HAProxy – URL Based routing with load balancing

You can segregate requests based on URL and load balance with a single HAProxy server. Your configuration will have something like this: frontend http acl app1 path_end -i /app1/123 #matches path ending with “/app/123” acl app2 path_end -i /app2/123 acl app3 path_end -i /app3/123 use_backend srvs_app1 if app1 use_backend srvs_app2 if app2 use_backend srvs_app3 if … Read more

Externalizing Grails Datasource configuration

You can use a properties file specified in the grails.config.locations as a way to externalize the datasource configuration. Below is how I typically set up a Grails project: In my DataSource.groovy I specify this for the production environment: …. …. production { dataSource { dbCreate = “update” driverClassName = “com.myorg.jdbcDriverNotExists” url = “” username = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)