This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # --- CONFIGURATION --- | |
| # Webhook documentation in https://developers.mattermost.com/integrate/webhooks/incoming/ | |
| WEBHOOK_URL="https://mm.example.com/hooks/secretkey" | |
| CHANNEL="movies" | |
| USERNAME="Radarr" | |
| ICON_URL="https://raw.githubusercontent.com/Radarr/Radarr/develop/Logo/256.png" | |
| # Check if script is run by Radarr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # --- CONFIGURATION --- | |
| # Webhook documentation in https://developers.mattermost.com/integrate/webhooks/incoming/ | |
| WEBHOOK_URL="https://mm.example.com/hooks/secretkey" | |
| CHANNEL="shows" | |
| USERNAME="Sonarr" | |
| ICON_URL="https://raw.githubusercontent.com/Sonarr/Sonarr/develop/Logo/256.png" | |
| # Check if script is run by Sonarr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ARG NVIDIA_DRIVER_VERSION=570.153.02 | |
| ARG NVIDIA_DRIVER_FILENAME="NVIDIA-Linux-aarch64-${NVIDIA_DRIVER_VERSION}.run" | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends \ | |
| ca-certificates \ | |
| kmod \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| DEVICES=$(camcontrol devlist | sed 's/.*,\(.*\)).*/\1/') | |
| for DEV in $DEVICES; do | |
| printf "%s: " "$DEV" | |
| camcontrol epc "$DEV" -c status -P | |
| done |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| # Input: | |
| # a b c d e | |
| # 0 Text Text NaN 0.0 5 | |
| # 1 Text NaN 1.1.1.1 0.0 55 | |
| # 2 Text.Text Text Text 0.4 555 | |
| data = [ | |
| {"a": "Text", "b": "Text", "d": 0, "e": 5}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| t.table_schema, | |
| t.table_name, | |
| c.column_name | |
| FROM | |
| information_schema.tables t | |
| INNER JOIN information_schema.columns c ON c.table_name = t.table_name | |
| AND c.table_schema = t.table_schema | |
| WHERE | |
| c.column_name ~ 'regex' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def advanced_dataframe_union(df1, df2): | |
| df1_fields = set((f.name, f.dataType) for f in df1.schema) | |
| df2_fields = set((f.name, f.dataType) for f in df2.schema) | |
| df2 = df2.select( | |
| df2.columns | |
| + [ | |
| F.lit(None).cast(datatype).alias(name) | |
| for name, datatype in df1_fields.difference(df2_fields) | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM alpine:3.10 | |
| RUN apk add --no-cache \ | |
| bzip2-dev \ | |
| g++ \ | |
| make | |
| RUN cd /tmp/ && \ | |
| wget -q https://launchpad.net/pbzip2/1.1/1.1.13/+download/pbzip2-1.1.13.tar.gz && \ | |
| tar -xzf pbzip2-1.1.13.tar.gz && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from pyspark.sql.types import * | |
| # Define the schema | |
| schema = StructType( | |
| [StructField("name", StringType(), True), StructField("age", IntegerType(), True)] | |
| ) | |
| # Write the schema | |
| with open("schema.json", "w") as f: |
NewerOlder