From a84c6ee664c15481b92a84b50172c85d37c6191f Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Tue, 13 Jul 2021 13:13:40 +0200 Subject: =?UTF-8?q?initiale=20=C3=BCberweisung=20diesdas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 165 ++++++++++++++++++++++++++++++++++++++++ README.md | 4 + ansible/.gitignore | 1 + ansible/files/git-out | 41 ++++++++++ ansible/files/udo | 38 +++++++++ ansible/git-out.yml | 49 ++++++++++++ ansible/mio/bin/mio | 15 ++++ ansible/mio/lib/mio.lst | 25 ++++++ ansible/mio/systemd/mio.service | 11 +++ ansible/mio/systemd/mio.timer | 10 +++ ansible/nano.yml | 24 ++++++ ansible/udo.yml | 16 ++++ 12 files changed, 399 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 ansible/.gitignore create mode 100644 ansible/files/git-out create mode 100755 ansible/files/udo create mode 100644 ansible/git-out.yml create mode 100755 ansible/mio/bin/mio create mode 100644 ansible/mio/lib/mio.lst create mode 100644 ansible/mio/systemd/mio.service create mode 100644 ansible/mio/systemd/mio.timer create mode 100644 ansible/nano.yml create mode 100644 ansible/udo.yml 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. + 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/README.md b/README.md new file mode 100644 index 0000000..c3904f2 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Content + +Important and life-enriching material from the life of EDP systems and their +maintainers. diff --git a/ansible/.gitignore b/ansible/.gitignore new file mode 100644 index 0000000..a8b42eb --- /dev/null +++ b/ansible/.gitignore @@ -0,0 +1 @@ +*.retry diff --git a/ansible/files/git-out b/ansible/files/git-out new file mode 100644 index 0000000..2ad2c25 --- /dev/null +++ b/ansible/files/git-out @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# author: Harald Pfeiffer +# licence: +# - LGPLv3 +# - CC-by-SA 4.0 +# (choose whichever fits your needs) + +MYVAR=( "MMMMMMWKXWMMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMM: cMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMX XMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMk' 'kMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMX:. '0MMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMWl ''' xMM: " ) +MYVAR=( "${MYVAR[@]}" "NNNO. cMMN. dM: " ) +MYVAR=( "${MYVAR[@]}" " :N0 xMMN' .W: " ) +MYVAR=( "${MYVAR[@]}" "::::oKMMMd 0MMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMMMMM. :MMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMMMMc . .MMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMMMc .N, MMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMMc .NMo OKKKKKd;, " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMc .NMM0 .k " ) +MYVAR=( "${MYVAR[@]}" "MMMMMc .NMMMMxcccccccc:;;lx" ) +MYVAR=( "${MYVAR[@]}" "MMMMc .NMMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMc .NMMMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "0MM0cclxKMMMMMMMMMMMMMMMd " ) +MYVAR=( "${MYVAR[@]}" " '0MK; .kMMMMMMMMMMMMMMX: " ) +MYVAR=( "${MYVAR[@]}" " .OMX: .xMMMMMMMMMMMMMMX:" ) + +for loyne in "${MYVAR[@]}";do + printf "\\033[1m\\033[48;5;29m %b \\033[0m\\n" "$loyne" +done + +printf "\\n\\033[1;5m\\033[38;5;29m PERFORMING EMERGENCY EXIT \\033[0m\\n" +sleep 1.337 +if ! logout >/dev/null 2>&1;then + SHELLPARENT="$(ps -ef|grep $PPID|awk '{print $3}'|head -n1)" + SHELLPPP="$(ps -ef|grep $SHELLPARENT|awk '{print $3}'|head -n1)" + kill "$SHELLPPP" + exit +fi diff --git a/ansible/files/udo b/ansible/files/udo new file mode 100755 index 0000000..019e149 --- /dev/null +++ b/ansible/files/udo @@ -0,0 +1,38 @@ +#!/usr/bin/env sh + +printf "\n ;NNNNNNNNNNNNN\n" +printf " XNNNNNNNNNNNN\n" +printf " oNNNNNNNNNNNN\n" +printf " KNNNNNNNNNNN\n" +printf " .xNNNNNNNXOd\n" +printf " ;' .;lo;. \n" +printf " ,' ..:lc\n" +printf " ..... . c0KO:0\n" +printf " ...... ,: 'cxxd\n" +printf " ...... ;okO00Ok\n" +printf " ........ .0xOKN0ONN\n" +printf " cXoXNo cON\n" +printf " x0o . ;l .'.,c,.kN\n" +printf " :NNNK.......';lkNNx ,XKxxXNN\n" +printf " ........XNNNNdXd,oKNNNNNNNd .oONNNNN\n" +printf " ...''',;lclxkNNOcckNXl0NN0NNNl .oXNNNNNNN\n" +printf " 'KlXNNNNNl0kkdxONNNNNNd0NoNNNc dNNNNNNNNNN\n" +printf " ',NXKNo0NNNNNNxco0NNNxNOxNN.xNNNNNNNNNNX\n" +printf " ;N0XoNNo,:lcdOOooXNNNNdNx KNNNNNNNNXc \n" +printf " . ;NOKK:lKNNXOocxNNNNNN0K. xNNNNXkc. \n" +printf " :NXNNXkc,;clxxkNNNNKl. .NN0: \n" +printf ". c. 'lNNNNNNNNNNNNNNNx. ,,,. \n" +printf " .; .ocONNNNNNNNNNk. cl. \n" +printf " . .. ,Ol;;:ooooc,. ck \n" +printf " . . .kNN0kl. xNK;'. \n" +printf ".. . . :XNNNK.,oX:lNNNx \n" +printf " ... ' .0NNNNNNNNNNX: \n" +printf " . . .xNNNNNNNXc .; \n" +printf " ;ONNNx; \n" +printf " 'K. \n\n" + +case "$1" in + "") sudo 2>&1|sed 's/\ s\(udo\ \)/ \1/g' >&2;; + "-h") sudo -h|sed 's/\ s\(udo\ \)/ \1/g;s/^s\(udo\ \)/\1/';; + *) sudo -p "[udo] Schätzelein, gib doch mal dein Passwort ein: " $@;; +esac diff --git a/ansible/git-out.yml b/ansible/git-out.yml new file mode 100644 index 0000000..30c2d7e --- /dev/null +++ b/ansible/git-out.yml @@ -0,0 +1,49 @@ +--- +# "git out" for emergency scenario. The scenario consists of three steps: +# 1. git commit +# 2. git push +# 3. git out + +- hosts: "{{ runtime_hosts | default('CHANGEME') }}" + become: true + gather_facts: false + vars: + binfiles: + - files/git-out + tasks: + - name: Gather necessary facts + setup: + filter: "ansible_distibution*" + - name: Trigger execution on Red Hat derivatives + debug: + msg: "{{ansible_distribution}}, checking in." + changed_when: true + notify: "redhat" + when: ansible_distribution_file_variety == "RedHat" + - name: Trigger execution on Debian derivatives + debug: + msg: "{{ansible_distribution}}, checking in." + changed_when: true + notify: "debian" + when: ansible_distribution_file_variety == "Debian" + handlers: + - name: Copy essential binaries(tm) to {{ inventory_hostname }} + copy: + #src: "{{item.file}}" + src: "files/git-out" + dest: "/usr/libexec/git-core/git-out" + mode: 0755 + owner: root + group: root + #loop: "{{vars.binfiles}}" + listen: "redhat" + - name: Copy essential binaries(tm) to {{ inventory_hostname }} + copy: + #src: "{{item.file}}" + src: "files/git-out" + dest: "/usr/lib/git-core/git-out" + mode: 0755 + owner: root + group: root + #loop: "{{vars.binfiles}}" + listen: "debian" diff --git a/ansible/mio/bin/mio b/ansible/mio/bin/mio new file mode 100755 index 0000000..1362c8c --- /dev/null +++ b/ansible/mio/bin/mio @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +YOUTUBE="https://www.youtube.com/watch?v=" +MYTGT="/tmp/mio" +MYMIOCOLL="/var/lib/mio/mio.lst" + +rm -vf "$MYTGT"* + +MYLINES="$(wc -l "$MYMIOCOLL"|awk '{print $1}')" +MYMIO="$(head -n "$((RANDOM%$MYLINES+1))" "$MYMIOCOLL"|tail -n1)" +unset MYLINES MYMIOCOLL +MYMIOTUBE="${YOUTUBE}${MYMIO}" +unset MYMIO +#echo "$MYMIOTUBE" +youtube-dl --write-description --write-info-json -o "/tmp/mio.%(ext)s" "$MYMIOTUBE" diff --git a/ansible/mio/lib/mio.lst b/ansible/mio/lib/mio.lst new file mode 100644 index 0000000..40dc3c6 --- /dev/null +++ b/ansible/mio/lib/mio.lst @@ -0,0 +1,25 @@ +lEJHOzT61I0 +B8p_7Crbsgg +z0CG-vEXeAU +aqQrzPicRks +YnDUcCIAcn4 +h9s_opMmWi8 +-GglKl6RBqk +6UeFcJzVgjk +aIhY_xflSS0 +Q27ksVybWbc +7O0JL1dAH40 +jsh7podkEko +4iZRCfRAGZk +9ugHfj9OT2k +z0CG-vEXeAU +2Pn-rr_oNTs +cNOGSa6YiIo +XRuwCLUK7P4 +vP08CJFgPcw +Xh95JisAGzg +is7LiAyw1_c +U-VIEJGTnTk +aeIpNfjDzPI +Jnu_-jg5Xnc +Ubtcib0Xk2E diff --git a/ansible/mio/systemd/mio.service b/ansible/mio/systemd/mio.service new file mode 100644 index 0000000..4cee4e9 --- /dev/null +++ b/ansible/mio/systemd/mio.service @@ -0,0 +1,11 @@ +[Unit] +Description=Alder Snake de Nävigän vum Eastsides Gewächs +After=network.target dbus.target +Wants=network-online.target + +[Service] +Type = oneshot +RemainAfterExit = no +ExecStart = /usr/local/bin/mio +User=mio +Group=mio diff --git a/ansible/mio/systemd/mio.timer b/ansible/mio/systemd/mio.timer new file mode 100644 index 0000000..66c8ae0 --- /dev/null +++ b/ansible/mio/systemd/mio.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Alder Snake de Nävigän vum Eastsides Gewächs +Wants=network-online.target + +[Timer] +OnCalendar=Mon,Tue,Wed,Thu,Fri 07..18:00:00 +RandomizedDelaySec=900 + +[Install] +WantedBy=timers.target diff --git a/ansible/nano.yml b/ansible/nano.yml new file mode 100644 index 0000000..d0fd7d5 --- /dev/null +++ b/ansible/nano.yml @@ -0,0 +1,24 @@ +--- +# Title: Create /etc/profile.d/nano.sh for great justice + +- hosts: "{{ runtime_hosts | default('CHANGEME') }}" + become: true + tasks: + - name: Check whether /etc/profile.d/nano.sh exists + stat: + path: /etc/profile.d/nano.sh + register: nanosh + - name: Create /etc/profile.d/nano.sh for great justice + file: + path: /etc/profile.d/nano.sh + owner: root + group: root + mode: 0644 + state: touch + when: nanosh.stat.exists == false + - name: Edit /etc/profile.d/nano.sh for great justice + blockinfile: + path: /etc/profile.d/nano.sh + block: | + alias nano="cat /usr/bin/vi" + insertbefore: BOF diff --git a/ansible/udo.yml b/ansible/udo.yml new file mode 100644 index 0000000..1667abb --- /dev/null +++ b/ansible/udo.yml @@ -0,0 +1,16 @@ +--- +# Title: ICH BIN EIN FINK, DU BIST EIN ZEISIG + +- hosts: "{{ runtime_hosts | default('CHANGEME') }}" + become: true + vars: + binfiles: + - files/udo + tasks: + - name: Copy essential binaries(tm) to {{ inventory_hostname }} + copy: + #src: "{{item.file}}" + src: "files/udo" + dest: "/usr/local/bin/udo" + mode: 0755 + #loop: "{{vars.binfiles}}" -- cgit v1.2.3