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
| casadm -L -o csv | grep -oP '(?<=^cache,)\d+' | while IFS= read -r cache_id; do casadm -P -i "$cache_id" -d -o csv | jq -sR 'split("\n")|map(split(","))|.[0] as $headers|.[1:]|map(select(length > 0)|with_entries({key: $headers[.key]|ascii_downcase|gsub("[^a-z%]+"; "_")|trimstr("_"), value: .value}))' | jq -r --arg cache_id "$cache_id" 'map(. as $obj|del(.io_class_id, .io_class_name)|to_entries|map("opencas.\(.key){opencas.cache_id=\"\($cache_id)\",opencas.io_class_id=\"\($obj.io_class_id)\",opencas.io_class_name=\"\($obj.io_class_name)\"} \(.value|rtrimstr("%")|tonumber)")[])[]'; done |
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
| # perms: ftp, read, policy, sensitive, write, test | |
| :local addr "" | |
| :local port "21" | |
| :local user "mikrotik" | |
| :local pass "" | |
| :local systemname [/system identity get name] | |
| :local time [/system clock get time] | |
| :local prefix ($systemname.".".[/system clock get date]."T".[:pick $time 0 2].[:pick $time 3 5].[:pick $time 6 8]) | |
| /system backup save name=$systemname |
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/sh | |
| copy_to_volume() { | |
| src="$1" | |
| dst="$2" | |
| volume=$(echo "$dst" | cut -d':' -f1) | |
| path=$(echo "$dst:" | cut -d':' -f2) | |
| docker volume create "$volume" | |
| container_id=$(docker create -v "$volume:/vol" "$(echo -e 'FROM scratch\nENTRYPOINT ["/"]' | docker build -q -)") | |
| err=0 |
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 | |
| (onrequest() { | |
| hddtemp /dev/sd* /dev/nvme*n* | jq -Rr 'sub("(?<device>.*?): (?<model>.*?): (?<value>\\d*).*"; "hw.temperature{hw.model=\"\(.model)\",system.device=\"\(.device)\"} \(.value)")' | |
| }; trap "exit 1" INT; while :; do content="$(onrequest; r=$?; echo /; exit "$r")"; { { echo -ne "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: $(printf %s "${content%/}" | wc -c)\r\n\r\n"; printf %s "${content%/}"; } | nc -l $(printf -- "$(nc -h 2>&1 | head -n 1 | grep -q Ncat && echo "%s %s" || echo "-s %s -p %s")" 127.0.0.1 8080) >/dev/null; } & wait; done) |
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
| scriptPath="$(readlink -f "$(dirname "$0")")" | |
| cd /opt/gitlab/embedded/service/gitlab-rails/public/assets/webpack | |
| echo >> main.*.js | |
| echo "$scriptPath/"*.js | |
| cat "$scriptPath/"*.js >> main.*.js | |
| gzip -c main.*.js > main.*.js.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
| curlShowErrors() { | |
| local exitCode=0 | |
| local output | |
| local status | |
| output="$(curl -sS -w '%{http_code}' "$@" | base64 -w 0)" || exitCode="$?" | |
| status="$(printf %s "$output" | base64 -d | tail -c 3)" | |
| if [[ "$status" =~ 2.. ]]; then | |
| printf %s "$output" | base64 -d | head -c -3 | |
| else | |
| printf %s "http $status: " >&2 |
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
| exec {SUBSHELL_STDOUT_FD}>&1; eval "$({ | |
| set -e | |
| trap 'while IFS= read -r SUBSHELL_VAR; do SUBSHELL_VAL="${!SUBSHELL_VAR}"; [[ "$SUBSHELL_VAR" != SUBSHELL_VAR ]] && [[ "$SUBSHELL_VAR" != SUBSHELL_VAL ]] && [[ "$SUBSHELL_VAR" != SUBSHELL_STDOUT_FD ]] && [[ "$SUBSHELL_VAR" != SUBSHELL_VARS_FD ]] && unset "$SUBSHELL_VAR" 2> /dev/null && printf "%q=%q\\n" "$SUBSHELL_VAR" "$SUBSHELL_VAL" || true; done < <(compgen -v) >&${SUBSHELL_VARS_FD}' EXIT | |
| test=asdf6 | |
| echo output | |
| false | |
| } {SUBSHELL_VARS_FD}>&1 >&${SUBSHELL_STDOUT_FD}-)"; exec {SUBSHELL_STDOUT_FD}<&- |
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
| set -e -o pipefail | |
| shopt -s expand_aliases | |
| throw() { return "${1:-1}"; } | |
| trystderr() { printf %s "$TRY_INTERNAL_STDERR" | base64 -d >&2; } | |
| alias try='TRY_INTERNAL_F() { ' | |
| alias catch=' }; [[ $- = *e* ]]; TRY_INTERNAL_E="$?"; set +e; exec {TRY_INTERNAL_STDOUT_FD}>&1; TRY_INTERNAL_=$(set -e -o pipefail; TRY_INTERNAL_F >&${TRY_INTERNAL_STDOUT_FD}-); ERR="$?"; exec {TRY_INTERNAL_STDOUT_FD}<&-; if [[ "$TRY_INTERNAL_E" == 0 ]]; then set -e; fi; if [[ "$ERR" != 0 ]]; then ' | |
| alias catchvars=' }; [[ $- = *e* ]]; TRY_INTERNAL_E="$?"; set +e; exec {TRY_INTERNAL_STDOUT_FD}>&1; TRY_INTERNAL_VARS="$(set -e -o pipefail; TRY_INTERNAL_TRAP() { declare -p "" $(compgen -v | grep -v "^FUNCNAME\$\\|^GROUPS\$\\|^ERR\$\\|^TRY_INTERNAL_" | while IFS= read -r TRY_INTERNAL_VAR; do if unset "$TRY_INTERNAL_VAR" 2>/dev/null; then printf "%s\\n" "$TRY_INTERNAL_VAR"; fi; done) 2>/dev/null || true; }; trap TRY_INTERNAL_TRAP EXIT; TRY_INTERNAL_F >&${TRY_INTERNAL_STDOUT_FD}-)"; ERR="$?"; exec {TRY_INTERNAL_STDOUT_FD}<&-; eval "$TRY_INTERNAL_V |
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
| // entrypoint: /bin/sh -c 'cat /etc/grafana/grafana-full-height-panel.js | tee -a /usr/share/grafana/public/build/app.*.js >/dev/null; exec su -s /bin/sh -c "exec /run.sh" grafana' | |
| (() => { | |
| let isMouseDown = false; | |
| document.addEventListener('mousedown', (event) => { | |
| if (event.which === 1) isMouseDown = true; | |
| }); | |
| document.addEventListener('mouseup', (event) => { |
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
| # Use Generic Template | |
| # Set D1 to Counter | |
| SetOption65 1 | |
| timezone 0 | |
| TelePeriod 10 | |
| Rule1 ON System#Init DO Counter1 0 ENDON ON System#Save DO Counter1 0 ENDON | |
| Rule1 1 | |
| CounterDebounce 500 |
NewerOlder