cwielenb/CNCF-Dataset huggingface dataset:
Project: Shifu (Provisioning / Automation & Configuration)
File: design-deviceShifu-plc4x.md

DeviceShifu-PLC4X allows shifu utilize project to integrate PLC devices with various protocols such as S7, Modbus, etc. Create a deviceShifu-PLC4X type using PLC4X library and allow user to connect PLC devices with all the with only this single deviceShifu-PLC4X. deviceShifu-PLC4X will receive RESTful style request like other, then transfer the request into valid PLC4X method calls and send it to connected devices. PLC4X can support various protocols, thus when initializing deviceShifu-PLC4X, user should specify which protocol to use. In order to support protocol specification, we can add new settings to edgedevice_types.go to support it. ```go type ProtocolSettings struct { MQTTSetting *MQTTSetting `json:"MQTTSetting,omitempty"` OPCUASetting *OPCUASetting `json:"OPCUASetting,omitempty"` SocketSetting *SocketSetting `json:"SocketSetting,omitempty"` PLC4XSetting *PLC4XSetting `json:"PLC4XSetting,omitempty"` } // PLC4XSetting defines PLC4X specific settings when connecting to an EdgeDevice type PLC4XSetting struct { //DrvierType is an enum of all the supported protocols DriverType *DriverType `json:"driverType,omitempty"` } ``` DeviceShifu-PLC4X will maintain an enum of protocols and match the driver base on the setting: ```go swtich plc4xSetting.DrvierType: case S7: drviers.RegsiterS7(drvierManager) ... ``` deviceShifu-PLC4X would take RESTful-style requests just as other deviceShifu do. PLC4X supports both `read` and `write` requests. For read, the method signature looks like: ```go // Prepare a read-request readRequest, err := connection.ReadRequestBuilder(). AddQuery("field", "holding-register:26:REAL"). AddQuery("field", "holding-register:3:REAL"). Build() ``` For write, the method signature looks like: ```go // Prepare a write-request writeRequest, err := connection.WriteRequestBuilder(). AddQuery("field", "holding-register:26:REAL", 2.7182818284). AddQuery("field", "holding-register:3:REAL", 3.141592657). Build() ``` Thus, we can construct the REST request as the following format: ``` For read: http://device-plc/read?${field1}?${field2} e.g: http://device-plc/read?holding-register:26:REAL?holding-register:3:REAL For write: http://device-plc/write?${field1}=${value1}?${field2}=${value2} e.g: http://device-plc/write?holding-register:26:REAL=2.7182818284?holding-register:3:REAL=3.141592657 ``` The `read` , `write` after `http://device-plc/` will be served as an instruction router. `?` would be served as query delimiter, whatever comes between `?` will be seen as the query. For `read`, the query would only contain the fields requests reading from. For `write`, the query would contain the fields requests trying to write and the value it tries to write. We can use existing mock-plc device, create a deviceShifu-PLC4X image add a e2e test to current azure-pipeline to run test against deviceShifu-PLC4X.
Project: KICS (Provisioning / Security & Compliance)
File: platform_template.md

This page contains all queries from {{platform}}. {%- for sub_platform in data -%} {%- if sub_platform != 'default' %} Below are listed queries related to {{platform}} {{sub_platform | upper}}: {% endif %} | Query |Severity|Category|More info| ||--|--|--| {%- for severity in data[sub_platform] -%} {%- for id in data %} |{{data}}<br/><sup><sub>{{id}}</sub></sup>|<span style="color:{{colors -}} |{{data -}}<br><a href="{{data}}">Documentation</a><br/>| {%- endfor -%} {%- endfor -%} {%- endfor -%}
Project: StarRocks (App Definition and Development / Database)
File: ADMIN_SET_CONFIG.md

displayed_sidebar: "English" This statement is used to set configuration items for the cluster (Currently, only FE dynamic configuration items can be set using this command). You can view these configuration items using the command. The configurations will be restored to the default values in the `fe.conf` file after the FE restarts. Therefore, we recommend that you also modify the configuration items in `fe.conf` to prevent the loss of modifications. :::tip This operation requires the SYSTEM-level OPERATE privilege. You can follow the instructions in to grant this privilege. ::: ```sql ADMIN SET FRONTEND CONFIG ("key" = "value") ``` Set `disable_balance` to `true`. ```sql ADMIN SET FRONTEND CONFIG ("disable_balance" = "true"); ```
Project: KubeMQ (App Definition and Development / Streaming & Messaging)
File: kubemq_queries_receive.md

Queries receive a body from a 'queries' channel Queries receive (Subscribe) command allows to receive a body from a 'queries' channel and response with appropriate reply ``` kubemq queries receive [flags] ``` ``` kubemq queries receive some-channel kubemq queries receive some-channel -g G1 ``` ``` -a, --auto-response set auto response executed query -g, --group string set 'queries' channel consumer group (load balancing) -h, --help help for receive ``` - Execute Kubemq 'queries'
Project: ClickHouse (App Definition and Development / Database)
File: 20_feature-request.md

name: Feature request about: Suggest an idea for ClickHouse title: '' labels: feature assignees: '' (you don't have to strictly follow this form) Use case A clear and concise description of what is the intended usage scenario is. Describe the solution you'd like A clear and concise description of what you want to happen. Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Additional context Add any other context or screenshots about the feature request here.
Project: YugabyteDB (App Definition and Development / Database)
File: yba_universe_node_release.md

Release a node instance from YugabyteDB Anywhere universe Release a node instance from YugabyteDB Anywhere universe. Release the instance to the IaaS/provider. Only for stopped/removed nodes. ``` yba universe node release [flags] ``` ``` -h, --help help for release ``` ``` -a, --apiToken string YugabyteDB Anywhere api token. --config string Config file, defaults to $HOME/.yba-cli.yaml --debug Use debug mode, same as --logLevel debug. --disable-color Disable colors in output. (default false) -H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000") -l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info") -n, --name string [Required] The name of the universe for the corresponding node operations. --node-name string [Optional] The name of the universe node for the corresponding node operations. Required for add, reboot, release, remove, reprovision, start, stop. -o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table") --timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s) --wait Wait until the task is completed, otherwise it will exit immediately. (default true) ``` - Manage YugabyteDB Anywhere universe nodes
Project: Carvel (App Definition and Development / Application Definition & Image Build)
File: README_Chime_Bots.md

The following is a sample class and Lambda function that receives a Amazon Chime Bot event and handles the various event types accordingly. ```go package main import ( "fmt" "context" "net/http" "bytes" "encoding/json" "errors" "strconv" "github.com/aws/aws-lambda-go/events" ) func handler(_ context.Context, chimeBotEvent events.ChimeBotEvent) error { switch chimeBotEvent.EventType { case "Invite": if err := message(chimeBotEvent.InboundHTTPSEndpoint.URL, "Thanks for inviting me to this room " + chimeBotEvent.Sender.SenderID); err != nil { return fmt.Errorf("failed to send webhook message: %v", err) } return nil case "Mention": if err := message(chimeBotEvent.InboundHTTPSEndpoint.URL, "Thanks for mentioning me " + chimeBotEvent.Sender.SenderID); err != nil { return fmt.Errorf("failed to send webhook message: %v", err) } return nil case "Remove": fmt.Printf("I have been removed from %q by %q", chimeBotEvent.Discussion.DiscussionType, chimeBotEvent.Sender.SenderID) return nil default: return fmt.Errorf("event type %q is unsupported", chimeBotEvent.EventType) } } func message(url, content string) (error) { input := &bytes.Buffer{} if err := json.NewEncoder(input).Encode(webhookInput{Content:content}); err != nil { return errors.New("failed to marshal request: " + err.Error()) } resp, err := http.Post("POST", url, input) if err != nil { return errors.New("failed to execute post http request: " + err.Error()) } if resp != nil && resp.Body != nil { defer resp.Body.Close() } if resp.StatusCode != http.StatusOK { return errors.New("bad response: status code not is " + strconv.Itoa(http.StatusOK) + " not " + strconv.Itoa(resp.StatusCode)) } return nil } type webhookInput struct { Content string `json:"Content"` } ```
Project: KICS (Provisioning / Security & Compliance)
File: 6b376af8-cfe8-49ab-a08d-f32de23661a4.md

title: WORKDIR Path Not Absolute hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 6b376af8-cfe8-49ab-a08d-f32de23661a4 Query name: WORKDIR Path Not Absolute Platform: Dockerfile Severity: <span style="color:#edd57e">Low</span> Category: Build Process URL: For clarity and reliability, you should always use absolute paths for your WORKDIR<br> ```dockerfile title="Positive test num. 1 - dockerfile file" hl_lines="5" FROM alpine:3.5 RUN apk add --update py2-pip RUN pip install --upgrade pip WORKDIR /path/to/workdir WORKDIR workdir COPY requirements.txt /usr/src/app/ RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt COPY app.py /usr/src/app/ COPY templates/index.html /usr/src/app/templates/ EXPOSE 5000 CMD ["python", "/usr/src/app/app.py"] ``` ```dockerfile title="Negative test num. 1 - dockerfile file" FROM alpine:3.5 RUN apk add --update py2-pip RUN pip install --upgrade pip WORKDIR /path/to/workdir WORKDIR "/path/to/workdir" WORKDIR / WORKDIR c:\\windows ENV DIRPATH=/path ENV GLASSFISH_ARCHIVE glassfish5 WORKDIR $DIRPATH/$DIRNAME WORKDIR ${GLASSFISH_HOME}/bin COPY requirements.txt /usr/src/app/ RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt COPY app.py /usr/src/app/ COPY templates/index.html /usr/src/app/templates/ EXPOSE 5000 CMD ["python", "/usr/src/app/app.py"] ```
Project: Checkov (Provisioning / Security & Compliance)
File: circleci_pipelines.md

layout: default title: circleci_pipelines resource scans nav_order: 1 | | Id | Type | Entity | Policy | IaC | Resource Link | |-|-|--|--|--|--|| | 0 | CKVCIRCLECIPIPELINES1 | circleci_pipelines | jobs.*.docker | | 1 | CKVCIRCLECIPIPELINES2 | circleci_pipelines | jobs.*.docker | | 2 | CKVCIRCLECIPIPELINES3 | circlecipipelines | orbs.{orbs: @} | Ensure mutable development orbs are not used. | circlecipipelines | | | 3 | CKVCIRCLECIPIPELINES4 | circlecipipelines | orbs.{orbs: @} | Ensure unversioned volatile orbs are not used. | circlecipipelines | | | 4 | CKVCIRCLECIPIPELINES5 | circleci_pipelines | jobs.*.steps | | 5 | CKVCIRCLECIPIPELINES6 | circleci_pipelines | jobs.*.steps | | 6 | CKVCIRCLECIPIPELINES7 | circleci_pipelines | jobs.*.steps | | 7 | CKVCIRCLECIPIPELINES8 | circleci_pipelines | executors.*.docker | | 8 | CKVCIRCLECIPIPELINES8 | circleci_pipelines | jobs.*.docker |
Project: ClickHouse (App Definition and Development / Database)
File: distribution_queue.md

slug: /en/operations/system-tables/distribution_queue Contains information about local files that are in the queue to be sent to the shards. These local files contain new parts that are created by inserting new data into the Distributed table in asynchronous mode. Columns: `database` () Name of the database. `table` () Name of the table. `data_path` () Path to the folder with local files. `is_blocked` () Flag indicates whether sending local files to the server is blocked. `error_count` () Number of errors. `data_files` () Number of local files in a folder. `datacompressedbytes` () Size of compressed data in local files, in bytes. `brokendatafiles` () Number of files that has been marked as broken (due to an error). `brokendatacompressed_bytes` () Size of compressed data in broken files, in bytes. `last_exception` () Text message about the last error that occurred (if any). Example ``` sql SELECT * FROM system.distribution_queue LIMIT 1 FORMAT Vertical; ``` ``` text Row 1: database: default table: dist data_path: ./store/268/268bc070-3aad-4b1a-9cf2-4987580161af/default@127%2E0%2E0%2E2:9000/ is_blocked: 1 error_count: 0 data_files: 1 datacompressedbytes: 499 last_exception: ``` See Also
Project: Meshery (Provisioning / Automation & Configuration)
File: v0.6.161.md

layout: release date: 2023-10-15 tag: v0.6.161 29425b6a4 Merge branch 'master' into theBeginner86/chore/41 7a4ef2ff4 Merge pull request #9118 from theBeginner86/theBeginner86/chore/40 f4a050de4 Merge pull request #9119 from theBeginner86/theBeginner86/chore/41 220592ceb [Docs] Release Notes for Meshery e2088d35a fix lock.json 74f9dead4 rever react-redux 7343f9275 update package-lock.json
Project: KICS (Provisioning / Security & Compliance)
File: ce76b7d0-9e77-464d-b86f-c5c48e03e22d.md

title: Container Capabilities Unrestricted hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: ce76b7d0-9e77-464d-b86f-c5c48e03e22d Query name: Container Capabilities Unrestricted Platform: DockerCompose Severity: <span style="color:#ff7213">Medium</span> Category: Resource Management URL: Some capabilities are not needed in certain (or any) containers. Make sure that you only add capabilities that your container needs. Drop unnecessary capabilities as well.<br> ```yaml title="Positive test num. 1 - yaml file" hl_lines="4 13" version: "3.9" services: webapp: build: context: ./dir dockerfile: Dockerfile-alternate args: buildno: 1 ports: "8080:8080" "3000:3000" cap_add: all ``` ```yaml title="Positive test num. 2 - yaml file" hl_lines="13" version: "3.9" services: webapp: build: context: ./dir dockerfile: Dockerfile-alternate args: buildno: 1 ports: "8080:8080" "3000:3000" cap_add: all cap_drop: SYS_CHROOT ``` ```yaml title="Positive test num. 3 - yaml file" hl_lines="13" version: "3.9" services: webapp: build: context: ./dir dockerfile: Dockerfile-alternate args: buildno: 1 ports: "8080:8080" "3000:3000" cap_add: all cap_drop: all ``` <details><summary>Positive test num. 4 - yaml file</summary> ```yaml hl_lines="4" version: "3.9" services: webapp: build: context: ./dir dockerfile: Dockerfile-alternate args: buildno: 1 ports: "8080:8080" "3000:3000" ``` </details> ```yaml title="Negative test num. 1 - yaml file" version: "3.9" services: webapp: build: context: ./dir dockerfile: Dockerfile-alternate args: buildno: 1 ports: "8080:8080" "3000:3000" cap_drop: all ```
Project: FOSSA (Provisioning / Security & Compliance)
File: cabal.md

Find all directories with a `cabal.project` file or a file with a `.cabal` extension. When one is found, skip all subdirectories. NOTE: We don't actually examine the cabal files, we just use their existence to determine that we are woking with a cabal project. As a result, we can handle multiple `.cabal` files, even though `cabal` cannot.* From the project root, we open the `./dist-newstyle/cache/plan.json` file, created by `cabal`. The relevant items in the file take the following form: Extra data removed for brevity ``` json { "install-plan": [ { "type": "configured", "id": "with-components-1.0.2.3-efgh", "pkg-name": "with-components", "pkg-version": "1.0.2.3", "style": "global", "components": { "lib": { "depends": [ "base-4.13.0.0" ] }, "setup": { "depends": [ "rts" ] } } }, { "type": "pre-existing", "id": "rts", "pkg-name": "rts", "pkg-version": "1.0", "depends": [] }, { "type": "configured", "id": "spectrometer-0.1.0.0-inplace", "pkg-name": "spectrometer", "pkg-version": "0.1.0.0", "style": "local", "depends": [ "aeson-1.5.2.0-abcd", "base-4.13.0.0", "with-components-1.0.2.3-efgh" ] } ] } ``` Analysis has two notable parts: matching `id` fields from the strings in `depends` and `components.*.depends`, and noting the package `type` and `style`. `pre-existing` types refer to builtin, ghc-provided packages, while `configured` packages have two `style`s of their own: `local`, referring to the current project, and `global`, referring to packages obtained from a remote source like .
Project: Chef InSpec (Provisioning / Security & Compliance)
File: lxc.md

+++ title = "lxc resource" draft = false gh_repo = "inspec" platform = "linux" [menu] [menu.inspec] title = "lxc" identifier = "inspec/resources/os/lxc.md lxc resource" parent = "inspec/resources/os" +++ Use the `lxc` Chef InSpec audit resource to test the information about Linux containers. LXC is a command-line client for LXD that manages your LXD instances (containers and virtual machines). The tests are against the container's information obtained on `lxc info [container-name]`. `lxc` resource allows the testing if the container exists or is in running status. This resource is distributed with Chef InSpec and is automatically available for use. An `lxc` Chef InSpec audit resource allows testing if the container exists or is in running status. ```ruby describe lxc("linux-container-name") do it { should exist } it { should be_running } end ``` For a full list of available matchers, please visit our . The specific matchers of this resource are: `exist` and `be_running`. The `exist` matcher is used to specify if the container exists: ```ruby it { should exist } ``` The `be_running` matcher is used to check if the container is running: ```ruby it { should be_running } ``` Returns the instance name. ```ruby its("name") { should eq "ubuntu-container" } ``` Returns the instance status. ```ruby its("status") { should cmp "Running" } ``` Returns the instance type (for example, container). ```ruby its("type") { should eq "container" } ``` Returns the architecture of the instance. ```ruby its("architecture") { should eq "x86_64" } ``` Returns the pid of the instance. ```ruby its("pid") { should eq 1378 } ``` Returns the creation date of the instance. ```ruby its("created_at") { should eq "2022/08/16 12:07 UTC" } ``` Returns the last used date of the instance. ```ruby its("lastusedat") { should eq "2022/08/17 05:06 UTC" } ``` Returns the resource information of the instance. ```ruby its("resources") { should include "Disk usage" } ``` The following examples show how to use this Chef InSpec audit resource. The below test passes if the container `immense-phoenix` exists as part of the LXD instances. ```ruby describe lxc("immense-phoenix") do it { should exist } end ``` The below test passes if the container `delicate-sloth` exists as part of the LXD instances and the status is running. ```ruby describe lxc("delicate-sloth") do it { should be_running } end ``` The below test passes if the container `ubuntu-container` exists, is running, and the properties value matches against the desired value. ```ruby describe lxc("ubuntu-container") do it { should exist } it { should be_running } its("name") { should eq "ubuntu-container" } its("status") { should cmp "Running" } its("type") { should eq "container" } its("architecture") { should eq "x86_64" } its("pid") { should eq 1378 } its("created_at") { should eq "2022/08/16 12:07 UTC" } its("lastusedat") { should eq "2022/08/17 05:06 UTC" } its("resources") { should include "Disk usage" } end ```
Project: YugabyteDB (App Definition and Development / Database)
File: strlen.md

title: STRLEN linkTitle: STRLEN description: STRLEN menu: preview: parent: api-yedis weight: 2320 aliases: /preview/api/redis/strlen /preview/api/yedis/strlen type: docs `STRLEN key` This command finds the length of the string value that is associated with the given `key`. If `key` is associated with a non-string value, an error is raised. If `key` does not exist, 0 is returned. Returns length of the specified string. ```sh $ SET yugakey "string value" ``` ``` "OK" ``` ```sh $ STRLEN yugakey ``` ``` 12 ``` ```sh $ STRLEN undefined_key ``` ``` 0 ``` , , , , , , ,
Project: GraphScope (App Definition and Development / Database)
File: install_on_local.md

This guide will walk you through the process of installing GraphScope on your local machine. Ubuntu 20.04 or later, CentOS 7 or later, or macOS 12 (Intel/Apple silicon) or later Python 3.7 ~ 3.11, and pip >= 19.3 JDK 11 (If you want to use GIE, both JDK 8 and 20 have known compatibility issues) GraphScope is distributed via, and could be installed bydirectly. You can use `pip` to install latest stable graphscope package ```bash python3 -m pip install graphscope --upgrade ``` ````{tip} If you occur a very low downloading speed, try to use a mirror site for the pip. ```bash python3 -m pip install graphscope --upgrade \ -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com ``` If you encounter errors like `Could not find a version that satisfies the requirement graphscope (from versions: )`, please check if you are working with an old pip, and ensure pip's version >= 19.3, as graphscope wheels are compatible with . ```bash python3 -m pip install --upgrade pip ``` ```` The above command will download all the components required for running GraphScope in standalone mode on your local machine. If you wish to experience the latest features, you can install the preview version, which is built and released in a nightly manner. ```bash python3 -m pip install graphscope --pre ``` To get a clean and tidy environment, you can also use a Docker environment to get started quickly. ```bash docker run --name dev -it --shm-size=4096m ubuntu:latest apt-get update -y && apt-get install python3-pip default-jdk -y python3 -m pip install graphscope ipython tensorflow ``` Optionally, You can build GraphScope from source and install it on your machine. Build GraphScope from source needs many libraries and tools as dependencies. We provide a utility script `gs` to help you install all the dependencies. ```bash git clone https://github.com/alibaba/graphscope cd graphscope python3 gsctl.py install-deps dev ``` To make our life easier, we provide a pre-built docker image with all the dependencies installed. You can use pull it and work in a container with this image to build GraphScope. ```bash docker pull registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-dev:latest docker run --name dev -it --shm-size=4096m registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-dev:latest git clone https://github.com/alibaba/graphscope ``` After the dependencies are installed on your local or in the container, you can build and install GraphScope in root directory of the source code. ```bash make make install ``` ````{note} Analytical engine(GAE) may require on-the-fly compilation, which needs clang or g++. Hence additional setup steps may in need to install build-essentials. e.g., on ubuntu: ```bash apt update -y && apt install cmake build-essential -y ``` ```` ````{note} Learning engine (GLE) doesn't support running on Python 3.11 currently, cause TensorFlow lacks supports for this version. ```` ````{note} Currently, the support for arm-based platforms is very preliminary, and not ready for production yet. ````