rsyslog.conf config check issues - config

Running rsyslogd -N 1, I receive two complains :
rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 27: parameter 'RebindInterval' not known -- typo in config file? [v8.27.0 try http://www.rsyslog.com/e/2207 ]
and a complain about last line :
rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 43: warnings occured in file '/etc/rsyslog.conf' around line 43 [v8.27.0 try http://www.rsyslog.com/e/2207 ]
rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 43: invalid character '(' - is there an invalid escape sequence somewhere? [v8.27.0 try http://www.rsyslog.com/e/2207 ]
rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 43: warnings occured in file '/etc/rsyslog.conf' around line 43 [v8.27.0 try http://www.rsyslog.com/e/2207 ]
rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 43: invalid character '=' - is there an invalid escape sequence somewhere? [v8.27.0 try http://www.rsyslog.com/e/2207 ]
rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 43: invalid character '"' - is there an invalid escape sequence somewhere? [v8.27.0 try http://www.rsyslog.com/e/2207 ]
It' s strange because rebindInterval should be known : https://www.rsyslog.com/doc/v8-stable/configuration/modules/omfwd.html#rebindinterval
Also last line is straight as in the doc : https://www.rsyslog.com/doc/v8-stable/rainerscript/include.html#include-multiple-files
The config is as follows rsyslog 8.28 on Ubuntu 16.04.
# /etc/rsyslog.conf Configuration file for rsyslog
module(load="imuxsock")
module(
load="imklog"
LogPath="/proc/kmsg"
)
module(load="imudp")
input(
type="imudp"
port="514"
)
module(load="imtcp")
input(
type="imtcp"
port="514"
)
module(
load="builtin:omfwd"
# RebindInterval="5000" # ERROR shown by rsyslogd -N 1 : parameter 'RebindInterval' not known.
)
module(
load="builtin:omfile"
template="RSYSLOG_TraditionalFileFormat"
fileOwner="syslog"
fileGroup="syslog"
fileCreateMode="0640"
dirCreateMode="0755"
)
global(
preserveFQDN="on"
umask="0022"
)
include(file="/etc/rsyslog.d/*.conf")

Related

unexpected '\r' carriage return from np.loadtxt

I am reading a .dat file using the following command
accel_x = np.loadtxt('./GroundMotions/GM/%s_%s_%s_%s_x.dat' % (station, realization, soilpro, profile))
where station, realization, soilpro, and profile are all Strings.
Then python throws me an error:
FileNotFoundError: [Errno 2] No such file or directory: './GroundMotions/GM/Z0XOCS_csz002_C4_WA-DNR-08_14\r_x.dat'
There is an unexpected \r in the error message. How can I avoid this unexpected carriage return?
You could strip it:
accel_x = np.loadtxt('./GroundMotions/GM/%s_%s_%s_%s_x.dat' % (station, realization, soilpro.strip('\r'), profile))
Or to strip all parameters:
'./GroundMotions/GM/%s_%s_%s_%s_x.dat' % tuple(str.strip(s, '\r') for s in (station, realization, soilpro, profile))

Snakefile ValueError: need more than 1 value to unpack

I am running in snakefile on cluster using this default config:
"__default__":
"account" : "myAccount"
"queue" : "myQueue"
"nCPUs" : "16"
"memory" : 20000
"resources" : "\"select[mem>20000] rusage[mem=20000] span[hosts=1]\""
"name" : "JOBNAME.{rule}.{wildcards}"
"output" : "{rule}.{wildcards}.out"
"error" : "{rule}.{wildcards}.err"
"time" : "24:00:00"
It runs ok for some rules, but it raise this error for one of the rules.
Traceback (most recent call last):
File "home/conda3_64/lib/python3.5/site-packages/snakemake/__init__.py", line 537, in snakemake
report=report)
File "home/conda3_64/lib/python3.5/site-packages/snakemake/workflow.py", line 653, in execute
success = scheduler.schedule()
File "home/conda3_64/lib/python3.5/site-packages/snakemake/scheduler.py", line 286, in schedule
self.run(job)
File "home/conda3_64/lib/python3.5/site-packages/snakemake/scheduler.py", line 302, in run
error_callback=self._error)
File "home/conda3_64/lib/python3.5/site-packages/snakemake/executors.py", line 638, in run
jobscript = self.get_jobscript(job)
File "home/conda3_64/lib/python3.5/site-packages/snakemake/executors.py", line 496, in get_jobscript
cluster=self.cluster_wildcards(job))
File "home/conda3_64/lib/python3.5/site-packages/snakemake/executors.py", line 556, in cluster_wildcards
return Wildcards(fromdict=self.cluster_params(job))
File "home/conda3_64/lib/python3.5/site-packages/snakemake/executors.py", line 547, in cluster_params
cluster.update(self.cluster_config.get(job.name, dict()))
ValueError: need more than 1 value to unpack
This is how I run the snakemake;
snakemake -j 20 --cluster-config ./config.yaml --cluster "qsub -A {cluster.account} -l walltime={cluster.time} -q {cluster.queue} -l nodes=1:ppn={cluster.nCPUs},mem={cluster.memory}" -p
If I run it without a cluster snakemake only it will run normally.
similar error is here ValueError: need more than 1 value to unpack python but I could not relate.
I cannot test it right now but based on the error I suspect the issue seems to be with your JOBNAME placeholder not being explicitly specified in call to qsub.
Adding -N some_name to your qsub arguments should resolve it.

redirecting sql output to a file in a shell script

I am facing an issue while executing the following script snippet.
$ORACLEHOME/bin/sqlplus -s $DBUSER/$DBPASSWORD <<EOF
set pages 0 feedback off
SELECT * FROM ERR_STG_ROAMING_PARTNER;
EOF > Err_File.txt
The following error message appears.
./Roaming.sh: line 213: warning: here-document at line 206 delimited by end-of-file (wanted `EOF')
./Roaming.sh: line 214: syntax error: unexpected end of file
Any help will be appreciated.
Try this:
$ORACLEHOME/bin/sqlplus -s $DBUSER/$DBPASSWORD > Err_File.txt <<EOF
set pages 0 feedback off
SELECT * FROM ERR_STG_ROAMING_PARTNER;
EOF
That is, specify the output redirection before the input heredoc redirection. The shell expects EOF to be on its own on the line terminating the heredoc.
The error message you are getting is the shell complaining about finding end-of-file (of the script file) before finding EOF. The usage of EOF for the heredoc delimiter might lead to some confusion here!

Importing .sql file into SQLite

I'm trying to import a large .sql file into an SQLite .db file, but I'm getting the following errors:
sqlite> .read ./smsCorpus_en_2012.04.30.sql
Error: near line 23: near "COMMENT": syntax error
Error: near line 50: near "LOCK": syntax error
Error: near line 52: near "some1": syntax error
Error: near line 58: near "s": syntax error
Error: near line 60: near "s": syntax error
Error: near line 66: near "UNLOCK": syntax error
The file is located at http://wing.comp.nus.edu.sg:8080/SMSCorpus/data/corpus/smsCorpus_en_sql_2012.04.30.zip (direct file link) linked on this page http://wing.comp.nus.edu.sg:8080/SMSCorpus/history.jsp
EDIT: just a warning, the file is quite large...not sure if this is the issue?
That file is a MySQL dump.
To make SQLite understand it, you have to:
delete COMMENTs on the table fields;
remove AUTO_INCREMENT from id (INTEGER PRIMARY KEY fields are autoincrementing in SQLite anyway);
remove ENGINE and DEFAULT CHARSET;
remove LOCK/UNLOCK commands;
make the INSERT commands have fewer records;
replace \' quoting with ''.
That is a MySQL Dump and not SQLite.
There are slight variations on the syntax.

GNUstep.csh file will not source

When I try the following in my GNUstep/Makefiles directory:
source GNUstep.csh
I receive the following output:
bash: GNUstep.csh: line 84: syntax error near unexpected token `"${GNUSTEP_USER_CONFIG_FILE}"'
bash: GNUstep.csh: line 84: ` switch ("${GNUSTEP_USER_CONFIG_FILE}")'
Obviously something is wrong, but I don't really know bash and from what I see nothing appears to be mislabled, unless there isn't supposed to be quotes around the variable or something.