Project Description

Scope of this project is to implement a simple include feature (similar to #include _ of the C-precompiler or _import _ of python), for generic text files. See below section _Additional improvements too, on ifdef define .

A command based not on programming languages, but shell script, able to "insert" in specific lines of text files another needed text saved in external files, kept in separated files/folders, so improving critical values confidentiality or improving reusability of text, centralizing the changes in those separated files, that can be then reintegrated/expanded with the full text just before the use or at runtime.

As use case i.e., this could be used in pure yaml files (not accompanied by any standard include feature) to separate from a text body some secret values or some code lines equally repeated in many text-bodies.

Similarly for JSON or a Dockerfile or Markdown or any text or source code file.

Interest for this project is the need to improve text files management in Linux also with no language installed and when not allowed by the text-type standar syntax, making easier reusability of repeated groups of lines and/or reducing eventual exposure of specific values, centralizing the updates in separated files and folders.

Goal for this Hackweek

Main goal is to implement as Linux shell script a draft first verion of such feature and provide some examples.

Additional improvements while hacking

The full project has been renamed from "import in a text file..." to the current title, having been improved with DEFINE IFDEF ENDIF INCLUDE verbs preprocessing, in the cpp style, able to implement text changes based on expressions other than include external text files, now much more being a Generic Text Preprocessor.
INCLUDE works also with files from http urls.
Pls in Resources, see prepro folder and README documentation descriptions.

Resources

Code, documentation and tests, see in:

  • https://gitlab.suse.de/mdati/hack-wk
    • branch [main]

This project is part of:

Hack Week 23

Activity

  • almost 2 years ago: mdati added keyword "ifdef" to this project.
  • almost 2 years ago: mdati added keyword "preprocessor" to this project.
  • almost 2 years ago: AZhou liked this project.
  • almost 2 years ago: mdati liked this project.
  • almost 2 years ago: mdati started this project.
  • almost 2 years ago: mdati removed keyword #confidentiality from this project.
  • almost 2 years ago: mdati removed keyword #reusability from this project.
  • almost 2 years ago: mdati removed keyword #import from this project.
  • almost 2 years ago: mdati removed keyword #include from this project.
  • almost 2 years ago: mdati added keyword "include" to this project.
  • almost 2 years ago: mdati added keyword "import" to this project.
  • almost 2 years ago: mdati added keyword "reusability" to this project.
  • almost 2 years ago: mdati added keyword "confidentiality" to this project.
  • almost 2 years ago: mdati added keyword "textfile" to this project.
  • almost 2 years ago: mdati added keyword "asciidoc" to this project.
  • almost 2 years ago: mdati added keyword "linux" to this project.
  • almost 2 years ago: mdati added keyword "bash" to this project.
  • almost 2 years ago: mdati added keyword "#include" to this project.
  • almost 2 years ago: mdati added keyword "#import" to this project.
  • almost 2 years ago: mdati added keyword "#reusability" to this project.
  • almost 2 years ago: mdati added keyword "#confidentiality" to this project.
  • almost 2 years ago: mdati originated this project.

  • Comments

    • mdati
      almost 2 years ago by mdati | Reply

      The version 1 of the preprocessor with documentation, validation and examples is ready available in the named gitlab repo. Consider that, on the contrary of cpp expecting C syntax, with warnings when used for non-C types, this tool is generic-text oriented, with other features and could still be customized/extended more (e.g. import from remote URL)

    Similar Projects

    pudc - A PID 1 process that barks to the internet by mssola

    Description

    As a fun exercise in order to dig deeper into the Linux kernel, its interfaces, the RISC-V architecture, and all the dragons in between; I'm building a blog site cooked like this:

    • The backend is written in a mixture of C and RISC-V assembly.
    • The backend is actually PID1 (for real, not within a container).
    • We poll and parse incoming HTTP requests ourselves.
    • The frontend is a mere HTML page with htmx.

    The project is meant to be Linux-specific, so I'm going to use io_uring, pidfs, namespaces, and Linux-specific features in order to drive all of this.

    I'm open for suggestions and so on, but this is meant to be a solo project, as this is more of a learning exercise for me than anything else.

    Goals

    • Have a better understanding of different Linux features from user space down to the kernel internals.
    • Most importantly: have fun.

    Resources


    SUSE Health Check Tools by roseswe

    SUSE HC Tools Overview

    A collection of tools written in Bash or Go 1.24++ to make life easier with handling of a bunch of tar.xz balls created by supportconfig.

    Background: For SUSE HC we receive a bunch of supportconfig tar balls to check them for misconfiguration, areas for improvement or future changes.

    Main focus on these HC are High Availability (pacemaker), SLES itself and SAP workloads, esp. around the SUSE best practices.

    Goals

    • Overall improvement of the tools
    • Adding new collectors
    • Add support for SLES16

    Resources

    csv2xls* example.sh go.mod listprodids.txt sumtext* trails.go README.md csv2xls.go exceltest.go go.sum m.sh* sumtext.go vercheck.py* config.ini csvfiles/ getrpm* listprodids* rpmdate.sh* sumxls* verdriver* credtest.go example.py getrpm.go listprodids.go sccfixer.sh* sumxls.go verdriver.go

    docollall.sh* extracthtml.go gethostnamectl* go.sum numastat.go cpuvul* extractcluster.go firmwarebug* gethostnamectl.go m.sh* numastattest.go cpuvul.go extracthtml* firmwarebug.go go.mod numastat* xtr_cib.sh*


    OS self documentation, health check and troubleshooting by roseswe

    Project Description

    The aim of this hackweek project is to improve the utility "cfg2html" so that it is even more usable under SLES and perhaps also under Rancher.

    cfg2html (see also https://github.com/cfg2html/cfg2html) itself is a very mature utility for collecting and documenting information of an operating system like Linux, AIX, HP-UX and others.

    Goal for this Hackweek

    The aim is to extend cfg2html

    • for SLES and SLES-for-SAP apps, high availability
    • Improve code for MicroOS 5.x, SUMA, Edge and k8s environments
    • fix shellbeauity warnings
    • possibly add more plugins
    • SUMA/Salt integration to collect.

    Resources

    Required skills: Bash, shell script and the SUSE products mentioned.

    https://github.com/cfg2html/cfg2html

    https://www.cfg2html.com/