codeclimate validate-config Error - code-climate

Am new to code climate and am facing this error when i run my github project on codeclimate.
codeclimate validate-config
ERROR: Unable to parse: (<unknown>): found unexpected end of stream while scanning a quoted scalar at line 23 column 5
Below is my .codeclimate.yml file :
---
machine:
environment:
CODECLIMATE_REPO_TOKEN: ab24b326dac817e772c5246823b67af66e2358e51134c33e20aaf7fb228088b0
engines:
duplication:
enabled: false
config:
languages:
- python
fixme:
enabled: true
pep8:
enabled: true
radon:
enabled: true
ratings:
paths:
- "**.py"
exclude_paths:
- "docs/*"
- "examples/*
-*api/songs/models*
-*/site-packages/*
-*markupsafe/*
-*psycopg2/*
-*six.py*
-*sqlalchemy/*
-*werkzeug/*
-*stringprep.py*
-*uuid.py*
-*ctypes/*
-*decimal.py*
-*encodings/*
-*hmac.py*
-*asyncio/*
-*concurrent/*
-*multiprocessing/*
-*mimetypes.py*
-*numbers.py*
-*pydoc.py*
-*http/*
-*app/api/user/__init__.py*
-*app/api/request/__init__.py*
-*app/api/__init__.py*
-*app/__init__.py*
-*app/config.py*
-*app/model/*
-*test/*
-*html/*
-*_bootlocale.py*
-*typing.py*
The line line 23 which is in the error message is as below in the file above:
- "examples/*
What should i do to correct this?

The problem with that line is it's missing the closing quotation mark. However, all of the exclude_paths patterns will need to be enclosed in quotes; i.e. the config should look like this:
---
machine:
environment:
CODECLIMATE_REPO_TOKEN: ab24b326dac817e772c5246823b67af66e2358e51134c33e20aaf7fb228088b0
engines:
duplication:
enabled: false
config:
languages:
- python
fixme:
enabled: true
pep8:
enabled: true
radon:
enabled: true
ratings:
paths:
- "**.py"
exclude_paths:
- "docs/*"
- "examples/*"
- "*api/songs/models*"
- "*/site-packages/*"
- "*markupsafe/*"
- "*psycopg2/*"
- "*six.py*"
- "*sqlalchemy/*"
- "*werkzeug/*"
- "*stringprep.py*"
- "*uuid.py*"
- "*ctypes/*"
- "*decimal.py*"
- "*encodings/*"
- "*hmac.py*"
- "*asyncio/*"
- "*concurrent/*"
- "*multiprocessing/*"
- "*mimetypes.py*"
- "*numbers.py*"
- "*pydoc.py*"
- "*http/*"
- "*app/api/user/__init__.py*"
- "*app/api/request/__init__.py*"
- "*app/api/__init__.py*"
- "*app/__init__.py*"
- "*app/config.py*"
- "*app/model/*"
- "*test/*"
- "*html/*"
- "*_bootlocale.py*"
- "*typing.py*"
Note: You'll still see some deprecation warnings because you're using the old .codeclimate.yml format. There is information about converting from the old format to version 2 in the CodeClimate docs:
https://docs.codeclimate.com/docs/advanced-configuration#section-analysis-configuration-versions

Related

ID apache-service-running in SLS apache.service.running is not a dictionary

I'm trying to install and configure apache using the v1.2.2 saltstack apache-formula
salt server-test state.apply apache test=true
But keep getting the following error:
server-test:
Data failed to compile:
ID apache-service-running in SLS apache.service.running is not a dictionary
my master salt path looks like that:
file_roots:
base:
- /srv/salt/states
- /srv/salt/formulas/php
- /srv/salt/formulas/nginx
- /srv/salt/formulas/apache-formula
- /srv/salt/formulas/mysql-formula
- /srv/salt/files
pillar_roots:
base:
- /srv/salt/pillar/base
dev:
- /srv/salt/pillar/dev
prod:
- /srv/salt/pillar/prod
I can't figure out where the problem is! any hints?
pillar/base/apache/server-test.sls
apache:
manage_service_states: False
lookup:
version: '2.4'
# for each site name there must be a config in salt://configs/webserver/apache2/sites/
site_names: [ 'server-test' ]
security:
ServerTokens: Prod
modules:
enabled:
- ssl
- alias
- rewrite
- headers
- shib
- http2
#disabled:
# - php7.3
# others are managed elsewhere
# - status
# - proxy
#- proxy_fcgi
mpm:
module: mpm_event
params:
start_servers: 3
min_spare_threads: 50
max_spare_threads: 100
thread_limit: 64
threads_per_child: 25
max_request_workers: 2000
server_limit: 80
max_connections_per_child: 0
The formula is broken: #383
manage_service_states: False doesn't work.

How to cite different authors with the same last name with Bibtex

I am using rmarkdown with bibtex citation package, but don't know how to handle the citation of different authors with the same last name. I found the post https://tex.stackexchange.com/questions/287970/how-to-cite-two-different-authors-with-the-same-surname-in-bibtex, but this does not work with rmarkdown. Any help would be appreciated.
---
title: "Paper"
thanks:
author: |
| \normalfont myself
date: "`r format(Sys.time(), '%B %d, %Y')`"
output:
pdf_document:
number_sections: true
citation_package: natbib
fig_caption: true
fig_height: 4.5
fig_width: 8
link-citations: yes
toc: false
bibliography: /Users/jj/Documents/ch3/references02.bib
biblio-style: apalike
in_header: preamble.tex
keep_tex: yes
fontsize: 12pt
linestretch: 1.2
subparagraph: true
number_sections: true
geometry: margin=1in
header-includes:
- \usepackage{amsmath}
- \usepackage{amsthm}
- \usepackage{bbm}
- \numberwithin{equation}{section}
- \usepackage{makecell}
- \usepackage{indentfirst}
- \usepackage{geometry}
- \usepackage{graphicx}
- \usepackage{tikz}
- \usepackage{verbatim}
- \usepackage{chronosys}
- \usepackage{stackengine}
- \usepackage{booktabs, colortbl, xcolor}
- \usepackage{babel}
- \usetikzlibrary{arrows.meta,calc}
- \usepackage[font=small]{caption}
- \usepackage{adjustbox}
- \usepackage{tabularx}
- \usepackage{pgfplots}
- \pgfplotsset{compat=1.7}
- \usepackage[makeroom]{cancel}
- \usetikzlibrary{arrows,decorations.markings}
- \usetikzlibrary{intersections}
- \usepackage[nottoc]{tocbibind}
- \newtheorem{prop}{Proposition}
- \newtheorem{definition}{Definition}
- \newtheorem{algorithem}{Algorithm}
- \usepackage[T1]{fontenc}
- \usepackage{tabularx,ragged2e,booktabs,caption}
- \newenvironment{rcases}
{\left.\begin{aligned}}
{\end{aligned}\right\rbrace}
- \renewcommand{\refname}{References}
- \UseRawInputEncoding
- \usepackage[utf8]{inputenc}
- \usepackage{hyperref}
- \hypersetup{
colorlinks=true,
linkcolor=black,
filecolor=blue,
citecolor = blue,
urlcolor=blue,
}
- \usepackage{subcaption}
- \usepackage[font=small,labelfont=bf]{caption}
- \usepackage{float}
- \usepackage{flafter}
- \floatstyle{plaintop}
- \restylefloat{table}
- \setlength{\parindent}{2.5em}
- \setlength{\parskip}{0em}
- \usepackage{adjustbox}
- \usepackage[style=english]{csquotes}
- \usepackage[nameinlink,capitalize,noabbrev]{cleveref}
- \creflabelformat{equation}{#2\textup{(\textcolor{red}{#1})}#3}
- \creflabelformat{figure}{#2\textcolor{red}{#1}#3}
- \creflabelformat{table}{#2\textcolor{red}{#1}#3}
- \creflabelformat{section}{#2\textcolor{red}{#1}#3}
- \usepackage[toc,page]{appendix}
- \usepackage{rotating}
- \usepackage{accents}
- \newcommand*{\dt}[1]{%
- \accentset{\mbox{\large\bfseries .}}{#1}}
- \DeclareMathOperator{\Tr}{Tr}
- \usepackage{cleveref}
---
references02.bib file is the following:
#incollection{chang2003,
author="Chang, Ha-Joon",
editor="Ha-Joon Chang",
title="Trade and Industrial Policy Issues",
bookTitle="Rethinking Development Economics",
year="2003",
publisher="Anthem Press",
pages="257-276"
}
#book{sjchang2003,
place={Cambridge},
title={Financial Crisis and Transformation of Korean Business Groups: The Rise and Fall of Chaebols},
DOI={10.1017/CBO9780511510861},
publisher={Cambridge University Press},
author={Chang, Sea-Jin},
year={2003}
}
The text would be:
\cite{chang2003} and \cite{sjchang2003} said different things, blah blah...

Letsencrypt certificate renewal issue on Ubuntu 18.04 machine using Apache Server

I am using Apache servers to host my Django (v2.1) app. I've installed Letsencrypt certificate for HTTPS. Now the time of renewal has come and it is giving me some unauthorized access error.
When I run sudo certbot command, I got the following output.
/usr/lib/python3/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: noppera.tk
2: www.noppera.tk
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 2
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for www.noppera.tk
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. www.noppera.tk (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.noppera.tk/.well-known/acme-challenge/U0D416-6zOf7YRW0jAVIG8oiLthmpy_xmewRdUlwrQM [34.240.58.158]: 400
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: www.noppera.tk
Type: unauthorized
Detail: Invalid response from
http://www.noppera.tk/.well-known/acme-challenge/U0D416-6zOf7YRW0jAVIG8oiLthmpy_xmewRdUlwrQM
[34.240.58.158]: 400
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
Also if I run this for option 1, I got the same error. (If you want, I can paste that log too)
What I've already tried is the following:
Has already installed django-letsencrypt==3.0.1
Added letsencrypt in settings.py
Added the following line in urls.py url(r'^\.well-known/', include('letsencrypt.urls')),
Right now site is accessible using HTTPS. Can anyone help me out renewing the certificate?
EDIT 1
Option 1 Logs:
/usr/lib/python3/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: noppera.tk
2: www.noppera.tk
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for noppera.tk
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. noppera.tk (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://noppera.tk/.well-known/acme-challenge/y6dj0WW9qDgZiBnDTmXmA5FTSusyjabeE3dZs5eEGpI [34.240.58.158]: "\n\n<html>\n<head>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js\"></script>\n\n\n\n\n\n\n\n<style>\n /*"
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: noppera.tk
Type: unauthorized
Detail: Invalid response from
https://noppera.tk/.well-known/acme-challenge/y6dj0WW9qDgZiBnDTmXmA5FTSusyjabeE3dZs5eEGpI
[34.240.58.158]: "\n\n<html>\n<head>\n <script
src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js\"></script>\n\n\n\n\n\n\n\n<style>\n
/*"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
Django Log for option 1 (noppera.tk)
Invalid HTTP_HOST header: '{{HOST IP}}'. You may need to add '{{HOST IP}}' to ALLOWED_HOSTS.
Bad Request: /console/login/LoginForm.jsp
Not Found: /.well-known/acme-challenge/WRiDAIe3JPBlZXVWduKBYKrmYKbyS3I2eetsth0YBD0
Django Log for option 2 (www.noppera.tk)
Invalid HTTP_HOST header: 'www.noppera.tk'. You may need to add 'www.noppera.tk' to ALLOWED_HOSTS.
Bad Request: /.well-known/acme-challenge/GTX3_zQ6XPymDUn1WVZ_27vO_XtYxPClBD5uA8Y1nhM
Right now, ALLOWED_HOSTS = ["*"]
EDIT 2
Changed ALLOWED_HOSTS = ["*"] to ALLOWED_HOSTS = ["www.noppera.tk", "*"] for Option 2, but same error.
I have found a solution. Posting to help others.
The problem was lying with the duplicate conf in the apache2/sites-available folder. There were 2 default configs and 2 custom config for my site (for each http and https). So what I did was disable the default config and reload Apache using sudo a2dissite default-ssl.conf and sudo a2dissite 000-default.conf.
After that I executed sudo certbot and it renewed certificates successfully.
Few of the useful resources are below:
https://www.jbarrett.me/blog/items/4/setting-ssl-django-app-lets-encrypt-ubuntu-apache-and-mod_wsgi
https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04#step-5-%E2%80%94-setting-up-virtual-hosts-(recommended)

Writing greek letters in rmarkdown to docx (newcommand for docx)

I am trying to write none-italic "uL" (microliters) in R markdown with the letter "mu".
It is no problem creating a newcommand for PDF that replaces "\microliters" with "uL".
newcommand{\microliters}{\textmu L}
This (of course?) does not work when knitting to docx. As a workaround, I can live with \microliters being replaced by a "uL" with a regular "u" - in stead of "mu".
But how can I create a docx "newcommand", that does that?
I'm not sure about "newcommand", but this works when converting from rmarkdown to docx:
µl
or
μ
I finally got a solution - not sure if any of the packages are mandatory, so I have included them all:
---
title: "Concentrationmeasurements"
author: "Christian Aa. Olesen"
date: "April 29, 2018"
output:
word_document: default
pdf_document:
latex_engine: pdflatex
header-includes:
- \usepackage{float}
- \floatplacement{figure}{H}
- \usepackage{setspace}
- \doublespacing
- \usepackage{lipsum}
- \usepackage{multirow}
- \usepackage[table,xcdraw]{xcolor}
- \usepackage{lineno}
- \linenumbers
- \usepackage{rotating}
- \usepackage{tikz}
- \usepackage{enumitem}
- \usepackage{blindtext}
- \usepackage{textcomp}
- \usepackage{refstyle}
- \usepackage{graphicx}
- \usepackage[font=small,labelfont=bf]{caption}
- \usepackage{tabularx}
- \usepackage[page]{appendix}
- \usepackage{amsmath}
- \usepackage{amsfonts}
- \usepackage{amssymb}
- \usepackage{hyperref}
- \usepackage{textcomp}
- \usepackage{graphicx}
- \usepackage{amsmath}
- \usepackage{xspace}
- \newcommand{\rtmark}{\textsuperscript{\textregistered}\xspace}
- \usepackage{multirow}
- \usepackage{float}
---
```{r,echo=FALSE, results='asis'}
doc.type <- knitr::opts_knit$get('rmarkdown.pandoc.to')
if (doc.type == "docx") cat(paste("\\newcommand{\\microliters}{\\mathrm{\\mu l}}")) else cat(paste("\\newcommand{\\microliters}{\\textrm{\\textmu l}}","\n"))
```

Unclassifiable statement and Fatal Error: Invalid character '$' at (1)

I am encountering errors when I try to compile an old Fortran code. I don't wish to change the program, but just to be able to run it.
I tried Simply Fortran and I am attempting to build the file, but I get these errors:
==============================================================================
Generating Makefile... Okay
==============================================================================
Compiling .\tmod9502.f
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.\tmod9502.f:97:6:
INCLUDE TMCOMMON.FOR
1
Error: Unclassifiable statement at (1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.\tmod9502.f:98:25:
CHARACTER*15 INPUTS$,SUBCAT$,PARAMS$,OUTPUT$
1
Fatal Error: Invalid character '$' at (1). Use '-fdollar-ok' to allow it as an extension
compilation terminated.
Error(E42): Last command making (build\tmod9502.o) returned a bad status
Error(E02): Make execution terminated
Based on this initial bit of code:
INCLUDE TMCOMMON.FOR
CHARACTER*15 INPUTS$,SUBCAT$,PARAMS$,OUTPUT$