git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Pfeiffer <harald.pfeiffer _ xmart.de> 2018-06-28 17:15:58 +0200
committerHarald Pfeiffer <harald.pfeiffer _ xmart.de> 2018-06-28 17:15:58 +0200
commit76d8c394cd5d35a032432f1cafc5a09e6da1bb5d (patch)
tree76f8746b5a4faf7ab54a16d9f773f074e9298230
downloadmeta-gitlab-76d8c394cd5d35a032432f1cafc5a09e6da1bb5d.tar.bz2
Forked from an internal repo of mine, history intentionally left blank
-rwxr-xr-x.environ-prep76
-rw-r--r--.gitignore0
-rw-r--r--.gitlab-ci.yml104
-rw-r--r--LICENSE165
-rw-r--r--Makefile12
-rw-r--r--README.md25
-rwxr-xr-xaux/git-checkers/.filelistgen-nonsysv141
-rw-r--r--aux/git-checkers/bashlist6
-rw-r--r--aux/git-checkers/ecmalist0
l---------aux/git-checkers/filelistgen1
-rw-r--r--aux/git-checkers/kornlist1
-rwxr-xr-xaux/git-checkers/logrotchecker16
-rw-r--r--aux/git-checkers/makelist3
-rwxr-xr-xaux/git-checkers/patchchecker5
-rw-r--r--aux/git-checkers/patchlist1
-rw-r--r--aux/git-checkers/poshlist2
-rwxr-xr-xaux/git-checkers/pychecker23
-rw-r--r--aux/git-checkers/pylist1
-rwxr-xr-xaux/git-checkers/sudoerschecker9
-rwxr-xr-xaux/git-checkers/systemdchecker17
-rw-r--r--aux/git-checkers/tidylist0
-rw-r--r--samples/Makefile11
-rw-r--r--samples/README.md7
-rwxr-xr-xsamples/bash/script9
-rwxr-xr-xsamples/ksh/script8
-rw-r--r--samples/logrotate/logrotate.conf36
-rw-r--r--samples/logrotate/logrotate.d/chrony8
-rw-r--r--samples/patch/Makefile9
-rw-r--r--samples/patch/after5
-rw-r--r--samples/patch/before1
-rw-r--r--samples/patch/patch8
-rwxr-xr-xsamples/python/script47
-rw-r--r--samples/sudoers/sudoers1
-rw-r--r--samples/sudoers/sudoers.d/insults1
-rw-r--r--samples/systemd/kuhsaft.service14
35 files changed, 773 insertions, 0 deletions
diff --git a/.environ-prep b/.environ-prep
new file mode 100755
index 0000000..4399a8b
--- /dev/null
+++ b/.environ-prep
@@ -0,0 +1,76 @@
+#!/bin/sh
+export PKM="false"
+# Supported for now: apt (jessie and later), dnf (fedora), yum (Red Hat), zypper (*SUSE)
+for i in apt dnf yum zypper;do
+ command -v "$i" >/dev/null 2>&1
+ [ "$?" -eq 0 ]&&export PKM="$i"&&break
+done
+case "$PKM" in
+ apt) echo "[INFO] Package manager is: apt";;
+ dnf) echo "[INFO] Package manager is: dnf";;
+ yum) echo "[INFO] Package manager is: yum";;
+ zypper) echo "[INFO] Package manager is: zypper";;
+ *) echo "[FAIL] Package manager cannot be determined." >&2;exit 1;;
+esac
+case "$PKM" in
+ apt) apt -qqq update||exit 1;;
+ dnf|yum) "$PKM" -y -q -e0 makecache||exit 1;;
+ zypper) zypper refs&&zypper ref||exit 1;;
+ *) echo "Package manager $PKM not supported yet." >&2;exit 1;;
+esac
+echo "[ OK ] Generating repository cache done."
+case "$PKM" in
+ apt) apt -yqqq dist-upgrade||exit 1;;
+ dnf|yum) "$PKM" -y -q -e0 upgrade||exit 1;;
+ zypper) zypper dup||exit 1;;
+ *) echo "Package manager $PKM not supported yet." >&2;exit 1;;
+esac
+echo "[ OK ] Docker system upgrade done."
+case "$PKM" in
+ apt)
+ apt -yqqq install ksh make sudo node-util node-esprima shellcheck locales\
+ git cowsay patchutils pyflakes pylint >/dev/null 2>&1||exit 2
+ ;;
+ dnf|yum)
+ "$PKM" -y -q -e0 install git ksh make sudo nodejs-util nodejs-esprima ShellCheck\
+ cowsay patch pyflakes pylint||exit 2
+ ;;
+ #zypper) zypper -f in $BLAFASEL||exit 2;;
+ *) echo "Package manager $PKM not supported yet." >&2;exit 2;;
+esac
+echo "[ OK ] Package installation done."
+#sed -i 's/^#.*\(en-IE.UTF-8\)/\1/g' /etc/locale.gen||exit 1
+case "$PKM" in
+ apt)
+ sed -i 's/^#.*\(en-IE.UTF-8\)/\1/g' /etc/locale.gen||exit 3
+ echo ': "${LANG:=en_IE.UTF-8}"; export LANG'>>/etc/profile.d/lang||exit 3
+ locale-gen||exit 3
+ ;;
+ dnf|yum) echo 'LANG="en_IE.UTF-8"' > /etc/locale.conf;;
+ zypper) echo "\*SUSE not supported yet." >&2;exit 3;;
+ *) echo "Package manager $PKM not supported yet." >&2;exit 3;;
+esac
+echo "[ OK ] Locale setup done (is now: $(localectl status|grep 'System Locale'|awk '{print $NF}'))."
+if [ -e ./samples ];then chmod -vR o-w ./samples||exit 4;fi
+# This needs to be adjusted to other distros!
+export SELINST=0
+export SELMODE=""
+case "$PKM" in
+ dnf|yum|zypper)
+ [ -e "/etc/sysconfig/selinux" ]&&\
+ export SELMODE="$(grep ^SELINUX= /etc/sysconfig/selinux|tail -n1|awk -F= '{print $NF}')"&&\
+ export SELINST=1
+ ;;
+ apt)
+ [ -e "/etc/default/selinux" ]&&\
+ export SELMODE="$(grep ^SELINUX= /etc/default/selinux|tail -n1|awk -F= '{print $NF}')"&&\
+ export SELINST=1
+ ;;
+ *) echo "Package manager $PKM not supported yet." >&2;exit 2;;
+esac
+[ "$SELINST" -eq 1 ]&&echo "[INFO] SELinux mode is $SELMODE"||echo "[INFO] SELinux mode not determinable, probably not installed."
+
+[ -r "./aux/conf.d" ]&&for i in ./aux/conf.d/*.conf;do
+ [ -r "$i" ]&&. "$i"
+done
+echo "[INFO] Local configuration done."
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.gitignore
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..cb0a2fa
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,104 @@
+#image: minimum2scp/systemd-stretch:latest
+stages:
+ - conf-check
+ - code-check
+ - makefile-check
+ - patch-check
+before_script:
+# - "apt-get -qq update&&apt-get -yqqq install ksh make sudo node-util >/dev/null 2>&1"
+ - "./.environ-prep"
+bash-parser:
+ script: "export LANG=en_IE.UTF-8;for i in $(cat aux/git-checkers/bashlist);do shellcheck -e SC2181,SC2188,SC2015,SC2119,SC2004,SC1090,SC2164,SC2001 $i&&echo $i: $(tput -Txterm smul)OK$(tput -Txterm rmul);done"
+ stage: code-check
+ only:
+ - master
+ environment:
+ name: production
+ when: always
+ tags:
+ - centos
+korn-parser:
+ script: "export LANG=en_IE.UTF-8;for i in $(cat aux/git-checkers/kornlist);do shellcheck -e SC2181,SC2188,SC2015,SC2119,SC2004,SC1090,SC2164,SC2001 $i&&echo $i: $(tput -Txterm smul)OK$(tput -Txterm rmul);done"
+ stage: code-check
+ only:
+ - master
+ environment:
+ name: production
+ when: always
+ tags:
+ - centos
+posh-parser:
+ script: "export LANG=en_IE.UTF-8;for i in $(cat aux/git-checkers/poshlist);do shellcheck -e SC2181,SC2188,SC2015,SC2002,SC2119,SC2004,SC1090,SC2164,SC2016 $i&&echo $i: $(tput -Txterm smul)OK$(tput -Txterm rmul);done"
+ stage: code-check
+ only:
+ - master
+ environment:
+ name: production
+ when: always
+ tags:
+ - centos
+makefile-parser:
+ script: "make -n"
+ stage: makefile-check
+ only:
+ - master
+ environment:
+ name: production
+ when: always
+ tags:
+ - centos
+sudoers-parser:
+ script: "./aux/git-checkers/sudoerschecker"
+ stage: conf-check
+ only:
+ - master
+ when: always
+ tags:
+ - centos
+logrotate-parser:
+ script: "./aux/git-checkers/logrotchecker"
+ stage: conf-check
+ only:
+ - master
+ environment:
+ name: production
+ when: always
+ tags:
+ - centos
+systemd-parser:
+ script: "./aux/git-checkers/systemdchecker"
+ stage: conf-check
+ only:
+ - master
+ environment:
+ name: production
+ when: always
+ tags:
+ - centos
+nodejs-parser:
+ script: "for i in `cat aux/git-checkers/ecmalist`;do /usr/bin/nodejs -c $i;done"
+ stage: code-check
+ only:
+ - master
+ when: always
+ tags:
+ - centos
+patch-parser:
+ script: "./aux/git-checkers/patchchecker"
+ stage: patch-check
+ only:
+ - master
+ when: always
+ tags:
+# - docker
+ - centos
+python-parser:
+ script: "aux/git-checkers/pychecker"
+ stage: code-check
+ only:
+ - master
+ environment:
+ name: production
+ when: always
+ tags:
+ - centos
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..0a04128
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..46efc18
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+VERSION = 3.81
+
+all: filelists
+
+filelists:
+ @[ -e ./aux/git-checkers/filelistgen ]&&./aux/git-checkers/filelistgen||true
+
+@PHONY: help
+help:
+ @echo -e "help:\t\tThis help"
+ @echo -e "all:\t\tall of the following targets:"
+ @echo -e "filelists:\tGenerates all code checker file lists"
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..2e59f73
--- /dev/null
+++ b/README.md
@@ -0,0 +1,25 @@
+## META LAYER
+
+Meta layer here means: this is a git folder about its git repository. Here I'll
+explicitly push the code with which I administer my git folders.
+
+Τα [**μεταδεδομένα**] (https://el.wikipedia.org/wiki/%CE%9C%CE%B5%CF%84%CE%B1%CE%B4%CE%B5%CE%B4%CE%BF%CE%BC%CE%AD%CE%BD%CE%B1) (μετάφραση του όρου metadata, ο οποίος σχηματίζεται από την ελληνική λέξη μετά και τη λατινική λέξη data "δεδομένα") είναι δεδομένα τα οποία περιγράφουν άλλα δεδομένα.
+
+### Rough Outline
+
+What the repository does in its rough state can be outlined as:
+1. Be jenkins without jenkins :) Most environments lack automated frameworks to check code and configuration quality for system administrators. Praise Gitlab's CI runner and the sysadmins who make this available in *your* environment. We are using this, a forked docker image will be supplied with all necessary patches and then checks your code inside there.
+2. Check our main Makefile if there's additional stuff inside. For now there isn't ;)
+
+### Content / In-Deep
+
+#### aux/git-checkers:
+* **filelistgen** Scans the whole GITROOT for files to be checked/linted during QoS (see .gitlab.-ci.yml)
+* **\*-list** The generated lists for the code checkers/linters, see *filelistgen*
+* **\*-checker** Additional code checker/linter scripts if not directly defined in *.gitlab-ci.yml*
+
+#### Main directory:
+* ***Makefile*** which prepares everything for the docker image (parser file lists etc). You could also use this inside the docker image, just add a point to the gitlab YAML. We do not do this inside the CI runner docker as most environments (see rough outline) can be happy enough to have the runners at all and we don't want to push unnecessary FLOPS and IOPS inside there.
+* ***.gitlab-ci.yml*** - Gitlab YAML to trigger all CI runner checks, including all of the above plus a Makefile checker for the root directory's Makefile
+* ***samples*** - Directory containing simple samples to check whether all automatization works
+
diff --git a/aux/git-checkers/.filelistgen-nonsysv b/aux/git-checkers/.filelistgen-nonsysv
new file mode 100755
index 0000000..a97ca75
--- /dev/null
+++ b/aux/git-checkers/.filelistgen-nonsysv
@@ -0,0 +1,141 @@
+#!/bin/bash
+
+RETVAL=0
+declare -x NCURSINST SCDIR GROOTDIR BASHLIST KORNLIST ECMALIST TIDYLIST
+command -v tput >/dev/null 2>&1&&NCURSINST=1||NCURSINST=0
+SCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+# I AM G(IT)ROOT!
+GROOTDIR="$(git rev-parse --show-toplevel)"||exit 1
+BASHLIST="$GROOTDIR/aux/git-checkers/bashlist"
+KORNLIST="$GROOTDIR/aux/git-checkers/kornlist"
+POSHLIST="$GROOTDIR/aux/git-checkers/poshlist"
+ECMALIST="$GROOTDIR/aux/git-checkers/ecmalist"
+TIDYLIST="$GROOTDIR/aux/git-checkers/tidylist"
+MAKELIST="$GROOTDIR/aux/git-checkers/makelist"
+PYTHLIST="$GROOTDIR/aux/git-checkers/pylist"
+
+function initmimick {
+ [ -z "$1" ]&&echo "crit_fail in initmimick(): no parameter passed" >&2&&exit 1
+ [ -z "$2" ]&&echo "crit_fail in initmimick(): no string passed" >&2&&exit 2
+ case "$1" in
+ 0)
+ echo -en "\\033[999D";echo -en "\\033[K"
+ case "$NCURSINST" in
+ 1)echo -en "[ $(tput setaf 2)$(tput bold)OK$(tput sgr0) ] $2.";;
+ *)echo -en "[ OK ] $2.";;
+ esac
+ echo " $3"
+ ;;
+ *)
+ echo -en "\\033[999D";echo -en "\\033[K"
+ case "$NCURSINST" in
+ 1)echo -en "[ $(tput setaf 1)$(tput bold)FAIL$(tput sgr0) ] $2:";;
+ *)echo -en "[ FAIL ] $2:";;
+ esac
+ echo " $3"
+ ;;
+ esac
+}
+STAGECMD="Generating Bash code list"
+echo -n "[....] $STAGECMD"
+FIGREP="$(tr '\n' '|' < "$GROOTDIR/.gitignore"|sed 's/|$//g')"
+[ -z "$FIGREP" ]&&FIGREP="0xdeadbeef"
+if [ "$(find "$GROOTDIR" -type f -exec file '{}' \;|grep Bourne-Again|grep -vE "tmp/|aux/github-markdown"|sed "s|:.*||g;s|$GROOTDIR/||g"|grep -vcP "$FIGREP")" -gt 0 ];then
+ if [ -e "$GROOTDIR/.gitignore" ];then
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep Bourne-Again|grep -vE "tmp/|aux/github-markdown"|sed "s|:.*||g;s|$GROOTDIR/||g"|grep -vP "$FIGREP" > "$BASHLIST"
+ else
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep Bourne-Again|grep -vE "tmp/|aux/github-markdown"|sed "s|:.*||g;s|$GROOTDIR/||g"> "$BASHLIST"
+ fi
+else
+ true>"$BASHLIST"
+fi
+CRETVAL="$?"
+case "$CRETVAL" in
+ 0) initmimick 0 "$STAGECMD" "...$(wc -l "$BASHLIST"|awk '{print $1}') found";;
+ *) initmimick 1 "$STAGECMD" "...$(wc -l "$BASHLIST"|awk '{print $1}') found";((++RETVAL));;
+esac
+STAGECMD="Generating KSH code list"
+echo -n "[....] $STAGECMD"
+if [ "$(find "$GROOTDIR" -type f -exec file '{}' \;|grep Korn\ shell|grep -vE "/tmp/|aux/github-markdown"|sed "s|:.*||g;s|$GROOTDIR/||g"|grep -vcP "$FIGREP")" -gt 0 ];then
+ if [ -e "$GROOTDIR/.gitignore" ];then
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep Korn\ shell|grep -vE "/tmp/|aux/github-markdown"|sed "s|:.*||g;s|$GROOTDIR/||g"|grep -vP "$FIGREP" > "$KORNLIST"
+ else
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep Korn\ shell|grep -vE "/tmp/|aux/github-markdown"|sed "s|:.*||g;s|$GROOTDIR/||g" > "$KORNLIST"
+ fi
+else
+ true>"$KORNLIST"
+fi
+CRETVAL="$?"
+case "$CRETVAL" in
+ 0) initmimick 0 "$STAGECMD" "...$(wc -l "$KORNLIST"|awk '{print $1}') found";;
+ *) initmimick 1 "$STAGECMD" "...$(wc -l "$KORNLIST"|awk '{print $1}') found";((++RETVAL));;
+esac
+STAGECMD="Generating POSIX shell code list"
+echo -n "[....] $STAGECMD"
+if [ "$(find "$GROOTDIR" -type f -exec file '{}' \;|grep POSIX\ shell|grep -vE "/tmp/|aux/github-markdown|\.git/"|sed "s|:.*||g;s|$GROOTDIR/||g"|grep -vcP "$FIGREP")" -gt 0 ];then
+ if [ -e "$GROOTDIR/.gitignore" ];then
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep POSIX\ shell|grep -vE "/tmp/|aux/github-markdown|\.git/"|sed "s|:.*||g;s|$GROOTDIR/||g"|grep -vP "$FIGREP" > "$POSHLIST"
+ else
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep POSIX\ shell|grep -vE "/tmp/|aux/github-markdown|\.git/"|sed "s|:.*||g;s|$GROOTDIR/||g" > "$POSHLIST"
+ fi
+else
+ true>"$POSHLIST"
+fi
+CRETVAL="$?"
+case "$CRETVAL" in
+ 0) initmimick 0 "$STAGECMD" "...$(wc -l "$POSHLIST"|awk '{print $1}') found";;
+ *) initmimick 1 "$STAGECMD" "...$(wc -l "$POSHLIST"|awk '{print $1}') found";((++RETVAL));;
+esac
+STAGECMD="Generating ECMA script list"
+echo -n "[....] $STAGECMD"
+if [ "$(find "$GROOTDIR" -type f -name "*.js"|sed "s|$GROOTDIR/||g"|grep -vcE "/tmp/")" -gt 0 ];then
+ find "$GROOTDIR" -type f -name "*.js"|sed "s|$GROOTDIR/||g"|grep -vE "/tmp/" > "$ECMALIST" 2>/dev/null
+else
+ true>"$ECMALIST"
+fi
+CRETVAL="$?"
+case "$CRETVAL" in
+ 0) initmimick 0 "$STAGECMD" "...$(wc -l "$ECMALIST"|awk '{print $1}') found";;
+ *) initmimick 1 "$STAGECMD" "...$(wc -l "$ECMALIST"|awk '{print $1}') found";((++RETVAL));;
+esac
+STAGECMD="Generating PHP and HTML code list"
+echo -n "[....] $STAGECMD"
+if [ "$(find "$GROOTDIR" -type f -exec file '{}' \;|grep -E 'PHP script|HTML document'|sed "s|:.*||g;s|$GROOTDIR/||g"|wc -l)" -gt 0 ];then
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep -E 'PHP script|HTML document'|sed "s|:.*||g;s|$GROOTDIR/||g" > "$TIDYLIST" 2>/dev/null
+else
+ true>"$TIDYLIST"
+fi
+CRETVAL="$?"
+case "$CRETVAL" in
+ 0) initmimick 0 "$STAGECMD" "...$(wc -l "$TIDYLIST"|awk '{print $1}') found";;
+ *) initmimick 1 "$STAGECMD" "...$(wc -l "$TIDYLIST"|awk '{print $1}') found";((++RETVAL));;
+esac
+STAGECMD="Generating Makefile code list"
+echo -n "[....] $STAGECMD"
+if [ "$(find "$GROOTDIR" -type f -exec file '{}' \;|grep makefile\ script|sed "s|:.*||g;s|$GROOTDIR/||g"|wc -l)" -gt 0 ];then
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep makefile\ script|sed "s|:.*||g;s|$GROOTDIR/||g" > "$MAKELIST"
+else
+ true>"$MAKELIST"
+fi
+CRETVAL="$?"
+case "$CRETVAL" in
+ 0) initmimick 0 "$STAGECMD" "...$(wc -l "$MAKELIST"|awk '{print $1}') found";;
+ *) initmimick 1 "$STAGECMD" "...$(wc -l "$MAKELIST"|awk '{print $1}') found";((++RETVAL));;
+esac
+STAGECMD="Generating Python code list"
+echo -n "[....] $STAGECMD"
+if [ "$(find "$GROOTDIR" -type f -exec file '{}' \;|grep Python\ script|grep -vE "/tmp/|aux/github-markdown"|sed "s|:.*||g;s|$GROOTDIR/||g"|grep -vcP "$FIGREP")" -gt 0 ];then
+ if [ -e "$GROOTDIR/.gitignore" ];then
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep Python\ script|grep -vE "/tmp/|aux/github-markdown"|sed "s|:.*||g;s|$GROOTDIR/||g"|grep -vP "$FIGREP" > "$PYTHLIST"
+ else
+ find "$GROOTDIR" -type f -exec file '{}' \;|grep Python\ script|grep -vE "/tmp/|aux/github-markdown"|sed "s|:.*||g;s|$GROOTDIR/||g" > "$PYTHLIST"
+ fi
+else
+ true>"$PYTHLIST"
+fi
+CRETVAL="$?"
+case "$CRETVAL" in
+ 0) initmimick 0 "$STAGECMD" "...$(wc -l "$PYTHLIST"|awk '{print $1}') found";;
+ *) initmimick 1 "$STAGECMD" "...$(wc -l "$PYTHLIST"|awk '{print $1}') found";((++RETVAL));;
+esac
+exit $RETVAL
diff --git a/aux/git-checkers/bashlist b/aux/git-checkers/bashlist
new file mode 100644
index 0000000..b6528b0
--- /dev/null
+++ b/aux/git-checkers/bashlist
@@ -0,0 +1,6 @@
+aux/git-checkers/.filelistgen-nonsysv
+aux/git-checkers/logrotchecker
+aux/git-checkers/patchchecker
+aux/git-checkers/sudoerschecker
+aux/git-checkers/systemdchecker
+samples/bash/script
diff --git a/aux/git-checkers/ecmalist b/aux/git-checkers/ecmalist
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/aux/git-checkers/ecmalist
diff --git a/aux/git-checkers/filelistgen b/aux/git-checkers/filelistgen
new file mode 120000
index 0000000..acd0c7a
--- /dev/null
+++ b/aux/git-checkers/filelistgen
@@ -0,0 +1 @@
+.filelistgen-nonsysv \ No newline at end of file
diff --git a/aux/git-checkers/kornlist b/aux/git-checkers/kornlist
new file mode 100644
index 0000000..e73b0bc
--- /dev/null
+++ b/aux/git-checkers/kornlist
@@ -0,0 +1 @@
+samples/ksh/script
diff --git a/aux/git-checkers/logrotchecker b/aux/git-checkers/logrotchecker
new file mode 100755
index 0000000..4f16efe
--- /dev/null
+++ b/aux/git-checkers/logrotchecker
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# No way to push this to gitlab's CI runner YAML for now, so here's the script:
+RETVAL=0
+
+LOGROTS="$(find . -name "logrotate*" -type d|wc -l)"
+[ "$LOGROTS" -eq 0 ]&&echo "No directory with a name starting with logrotate found."&&exit 0
+
+for i in $(find . -name "logrotate*" -type d)/*;do
+ ERRCNT="$(/usr/sbin/logrotate -ds /tmp/logrotcheck "$i" 2>&1|grep '^error:'|grep -vcE 'unknown group|found error')"
+ echo "$i: $ERRCNT errors"
+ [ "$ERRCNT" -ne 0 ]&&((++RETVAL))
+ continue
+done
+
+exit $RETVAL
diff --git a/aux/git-checkers/makelist b/aux/git-checkers/makelist
new file mode 100644
index 0000000..5b2e7d6
--- /dev/null
+++ b/aux/git-checkers/makelist
@@ -0,0 +1,3 @@
+Makefile
+samples/patch/Makefile
+samples/Makefile
diff --git a/aux/git-checkers/patchchecker b/aux/git-checkers/patchchecker
new file mode 100755
index 0000000..e30a522
--- /dev/null
+++ b/aux/git-checkers/patchchecker
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+GITROOT="$(git rev-parse --show-toplevel)"||exit 1
+
+for i in $(cat "$GITROOT/aux/git-checkers/patchlist");do /usr/bin/patch -d "$(echo "$GITROOT/$i"|sed 's|/[^/]\+$||g')" -f --dry-run -p0 < $i;done|tr '\n' ':';[ "${PIPESTATUS[0]}" -eq 0 ]&&echo " OK."||(echo " FAILED.";false)
diff --git a/aux/git-checkers/patchlist b/aux/git-checkers/patchlist
new file mode 100644
index 0000000..d1aa093
--- /dev/null
+++ b/aux/git-checkers/patchlist
@@ -0,0 +1 @@
+samples/patch/patch
diff --git a/aux/git-checkers/poshlist b/aux/git-checkers/poshlist
new file mode 100644
index 0000000..60d642f
--- /dev/null
+++ b/aux/git-checkers/poshlist
@@ -0,0 +1,2 @@
+aux/git-checkers/pychecker
+.environ-prep
diff --git a/aux/git-checkers/pychecker b/aux/git-checkers/pychecker
new file mode 100755
index 0000000..2e2c21a
--- /dev/null
+++ b/aux/git-checkers/pychecker
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+RETVAL=0
+declare -x SCDIR GROOTDIR
+command -v tput >/dev/null 2>&1&&NCURSINST=1||NCURSINST=0
+SCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+# I AM G(IT)ROOT!
+GROOTDIR="$(git rev-parse --show-toplevel)"||exit 1
+while read FILE;do
+ echo '##############################################################'
+ echo '# $FILE'
+ echo '##############################################################'
+ pyflakes "$FILE"
+ case "$?" in
+ 0) echo "pyflakes: $(tput -Txterm smul)OK$(tput -Txterm rmul)";;
+ *)
+ echo "pyflakes: $(tput -Txterm smul)FAILED$(tput -Txterm rmul)"
+ RETVAL=$((RETVAL+1))
+ ;;
+ esac
+ pylint --indent-string="\t" --comment="yes" "$FILE"
+done < "$SCDIR/pylist"
+exit "$RETVAL"
diff --git a/aux/git-checkers/pylist b/aux/git-checkers/pylist
new file mode 100644
index 0000000..f0d92d2
--- /dev/null
+++ b/aux/git-checkers/pylist
@@ -0,0 +1 @@
+samples/python/script
diff --git a/aux/git-checkers/sudoerschecker b/aux/git-checkers/sudoerschecker
new file mode 100755
index 0000000..1d7e7ed
--- /dev/null
+++ b/aux/git-checkers/sudoerschecker
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+GITROOT="$(git rev-parse --show-toplevel)"||exit 1
+SUDOERSDINV=( $(find "$GITROOT" -name sudoers.d -type d) )
+SUDOERSD=1
+[ "${#SUDOERSDINV[@]}" -eq 0 ]&&echo "No directory called sudoers.d found."&&SUDOERSD=0
+
+[ "$SUDOERSD" -eq 1 ]&&for i in "${SUDOERSDINV[@]}"/*;do /usr/sbin/visudo -cf "$i";done
+find "$GITROOT" -name sudoers -type f -exec /usr/sbin/visudo -cf '{}' \;
diff --git a/aux/git-checkers/systemdchecker b/aux/git-checkers/systemdchecker
new file mode 100755
index 0000000..85cb24e
--- /dev/null
+++ b/aux/git-checkers/systemdchecker
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+GITROOT="$(git rev-parse --show-toplevel)"||exit 1
+
+echo -n "Locating systemd units..."
+SVCFILES=( $(find "$GITROOT" -name "*.service" -exec grep -l '\[Unit\]' '{}' \;) )
+TGTFILES=( $(find "$GITROOT" -name "*.target" -exec grep -l '\[Unit\]' '{}' \;) )
+TMRFILES=( $(find "$GITROOT" -name "*.timer" -exec grep -l '\[Unit\]' '{}' \;) )
+MNTFILES=( $(find "$GITROOT" -name "*.mount" -exec grep -l '\[Unit\]' '{}' \;) )
+SYSTEMDFILES=( ${SVCFILES[@]} ${TGTFILES[@]} ${TMRFILES[@]} ${MNTFILES[@]} )
+echo " found ${#SYSTEMDFILES[@]} unit$([ "${#SYSTEMDFILES[@]}" -gt 1 ]&&echo -n "s") to check."
+
+export LOOPRV=0
+for i in "${SYSTEMDFILES[@]}";do
+ systemd-analyze verify "$i"&&echo "$i: $(tput -Txterm smul)OK$(tput -Txterm rmul)"||((++LOOPRV))
+done
+exit $LOOPRV
diff --git a/aux/git-checkers/tidylist b/aux/git-checkers/tidylist
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/aux/git-checkers/tidylist
diff --git a/samples/Makefile b/samples/Makefile
new file mode 100644
index 0000000..feacd5f
--- /dev/null
+++ b/samples/Makefile
@@ -0,0 +1,11 @@
+VERSION = 3.81
+
+all: moo
+
+moo: cowsay-exists
+ @echo "I BIMS 1 kusafterzeuqer xD"|cowsay
+ @echo
+
+cowsay-exists:
+ @command -v cowsay > /dev/null
+
diff --git a/samples/README.md b/samples/README.md
new file mode 100644
index 0000000..cd16a23
--- /dev/null
+++ b/samples/README.md
@@ -0,0 +1,7 @@
+## Content
+
+This folder only contains samples to make some simple checks whether every CI
+runner trigger inside this folder would run. "Simple" here means: if you expect
+advanced results from code errors do not seek them here. This is just for
+checking if the code checks as such will execute and if their result and output
+are fine.
diff --git a/samples/bash/script b/samples/bash/script
new file mode 100755
index 0000000..056fb9a
--- /dev/null
+++ b/samples/bash/script
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+echo "$HOME"
+ARR=( "moo" "maeh" "oink" "quaaak" "pirates" )
+# This is a comment line telling you the above array is a mixture of German and English
+for i in "${ARR[@]}";do
+ echo "$i"|sed 's|^maeh$|GUENTER DAS SCHAF|g'
+done
+
diff --git a/samples/ksh/script b/samples/ksh/script
new file mode 100755
index 0000000..1329ea3
--- /dev/null
+++ b/samples/ksh/script
@@ -0,0 +1,8 @@
+#!/bin/ksh
+
+echo "$HOME"
+ARR=( "moo" "maeh" "oink" "quaaak" "pirates" )
+# This is a comment line telling you the above array is a mixture of German and English
+for i in "${ARR[@]}";do
+ echo "$i"|sed 's|^maeh$|GUENTER DAS SCHAF|g'
+done
diff --git a/samples/logrotate/logrotate.conf b/samples/logrotate/logrotate.conf
new file mode 100644
index 0000000..39a092d
--- /dev/null
+++ b/samples/logrotate/logrotate.conf
@@ -0,0 +1,36 @@
+# see "man logrotate" for details
+# rotate log files weekly
+weekly
+
+# keep 4 weeks worth of backlogs
+rotate 4
+
+# create new (empty) log files after rotating old ones
+create
+
+# use date as a suffix of the rotated file
+dateext
+
+# uncomment this if you want your log files compressed
+#compress
+
+# RPM packages drop log rotation information into this directory
+include /etc/logrotate.d
+
+# no packages own wtmp and btmp -- we'll rotate them here
+/var/log/wtmp {
+ missingok
+ monthly
+ create 0664 root utmp
+ minsize 1M
+ rotate 1
+}
+
+/var/log/btmp {
+ missingok
+ monthly
+ create 0600 root utmp
+ rotate 1
+}
+
+# system-specific logs may be also be configured here.
diff --git a/samples/logrotate/logrotate.d/chrony b/samples/logrotate/logrotate.d/chrony
new file mode 100644
index 0000000..2823a1a
--- /dev/null
+++ b/samples/logrotate/logrotate.d/chrony
@@ -0,0 +1,8 @@
+/var/log/chrony/*.log {
+ missingok
+ nocreate
+ sharedscripts
+ postrotate
+ /usr/bin/chronyc cyclelogs > /dev/null 2>&1 || true
+ endscript
+}
diff --git a/samples/patch/Makefile b/samples/patch/Makefile
new file mode 100644
index 0000000..b11370d
--- /dev/null
+++ b/samples/patch/Makefile
@@ -0,0 +1,9 @@
+VERSION=3.81
+
+all: diff
+
+diff: diff-exists
+ @diff -uNr before after > patch||:
+
+diff-exists:
+ @command -v diff >/dev/null 2>&1
diff --git a/samples/patch/after b/samples/patch/after
new file mode 100644
index 0000000..7420401
--- /dev/null
+++ b/samples/patch/after
@@ -0,0 +1,5 @@
+I fart in your general direction.
+
+My hovercraft is full of eels.
+
+Your mother was a hamster, and your father smelt of elderberries.
diff --git a/samples/patch/before b/samples/patch/before
new file mode 100644
index 0000000..e5ceb33
--- /dev/null
+++ b/samples/patch/before
@@ -0,0 +1 @@
+My hovercraft is full of eels.
diff --git a/samples/patch/patch b/samples/patch/patch
new file mode 100644
index 0000000..49027ab
--- /dev/null
+++ b/samples/patch/patch
@@ -0,0 +1,8 @@
+--- before 2018-06-14 10:54:31.238861817 +0200
++++ after 2018-06-14 10:58:58.384654674 +0200
+@@ -1 +1,5 @@
++I fart in your general direction.
++
+ My hovercraft is full of eels.
++
++Your mother was a hamster, and your father smelt of elderberries.
diff --git a/samples/python/script b/samples/python/script
new file mode 100755
index 0000000..cf719d9
--- /dev/null
+++ b/samples/python/script
@@ -0,0 +1,47 @@
+#!/bin/env /usr/bin/python
+
+"""
+This script just should be able to run. It's a sample, not more.
+"""
+
+from os import path
+from sys import argv, version_info
+from getopt import getopt, GetoptError
+import crypt
+
+def moo():
+ """
+ We moo some information at the m00ser.
+ """
+ print "This is ", path.basename(__file__), ", \n"
+ print "running under Python version ", version_info
+
+def salty():
+ """
+ Print a semi-random string generated to see whether our imports work
+ """
+ mypw = crypt.crypt("ebin-bassword", "$6$C0WS4Y5M0O")
+ print "Semi-random password string: ", mypw
+
+def main(myargv):
+ """
+ Maine.
+ """
+ try:
+ shopts, optargs = getopt(myargv, "hb:", ["help"])
+ except GetoptError:
+ print "fug D:"
+ exit(1)
+ for shopt, optarg in shopts:
+ if shopt == '-h' or shopt == '--help':
+ help()
+ print "\nnow you know the whole python, ebin :D :D :D\n"
+ exit()
+ elif shopt == '-b':
+ print optarg
+ exit()
+ moo()
+ salty()
+
+if __name__ == "__main__":
+ main(argv[1:])
diff --git a/samples/sudoers/sudoers b/samples/sudoers/sudoers
new file mode 100644
index 0000000..bdd662d
--- /dev/null
+++ b/samples/sudoers/sudoers
@@ -0,0 +1 @@
+%wharrgarbl ALL=(ALL) NOPASSWD:/usr/bin/feck --out --the --window,/bin/bash /bin/shutdown now,/bin/echo *
diff --git a/samples/sudoers/sudoers.d/insults b/samples/sudoers/sudoers.d/insults
new file mode 100644
index 0000000..e291383
--- /dev/null
+++ b/samples/sudoers/sudoers.d/insults
@@ -0,0 +1 @@
+Defaults insults
diff --git a/samples/systemd/kuhsaft.service b/samples/systemd/kuhsaft.service
new file mode 100644
index 0000000..c0a2b69
--- /dev/null
+++ b/samples/systemd/kuhsaft.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Making some tasty vow juice, yummy
+Requires=systemd-journald.service
+
+[Service]
+Type=oneshot
+#ExecStart=/bin/echo "touch my udder for juicy fodder"|/usr/games/cowsay
+#ExecStop=/bin/echo "Now I'm dead :("|/usr/games/cowsay -e"xx"
+ExecStart=/bin/echo
+ExecStop=/bin/echo
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target