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 | |
| ZELLIJ_AUTO_ATTACH=true | |
| ZELLIJ_AUTO_EXIT=true | |
| if [[ -n "$SSH_CONNECTION" ]] && [[ -z "$ZELLIJ" ]]; then | |
| skip_zellij=false | |
| for i in 2 1; do | |
| printf '\rStarting zellij in %ds, press ESC to cancel...' "$i" | |
| if read -rsn1 -t 1 key && [[ "$key" == $'\e' ]]; then |
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 | |
| disk="$1" | |
| while true ; do | |
| #blockdev --flushbufs "$disk" | |
| err="$(timeout 1s dd "if=$disk" of=/dev/null bs=512 count=409600 conv=noerror iflag=direct 2>&1)" | |
| status=$? | |
| if [ $status != 0 ] && [ $status != 124 ]; then | |
| echo "dd error $status: $err" >&2 | |
| exit $status |
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
| .css-kuoxoh-panel-content:has(> div > div > div:nth-of-type(2) > div[data-testid="data-testid gauge container"]) > div > div { | |
| transform: scale(1.2); | |
| overflow: visible !important; | |
| } | |
| .css-kuoxoh-panel-content:has(> div > div > div:nth-of-type(2) > div[data-testid="data-testid gauge container"]) > div > div > div { | |
| margin-right: 0 !important; | |
| } | |
| .css-kuoxoh-panel-content:has(> div > div > div:nth-of-type(2) > div[data-testid="data-testid gauge container"]) > div > div > div:nth-of-type(1) > div[data-testid="data-testid gauge container"] > svg { |
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}<&- |
NewerOlder