This file contains 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
[Unit] | |
Description=Mount /dev/disk/by-id/ata-QEMU_HARDDISK_QM00009-part1 to /mnt | |
After=local-fs.target | |
Requires=local-fs.target | |
ConditionPathExists=/dev/disk/by-id/ata-QEMU_HARDDISK_QM00009-part1 | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/mount /dev/disk/by-id/ata-QEMU_HARDDISK_QM00009-part1 /mnt | |
RemainAfterExit=yes |
This file contains 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 | |
set -eu | |
export BACKUP_FOLDER=/opt/gitlab/data/backups | |
export CONTAINER_NAME=gitlab | |
echo "[$(date)] remove old backup" | |
find ${BACKUP_FOLDER} -name '*_gitlab_backup.tar' -delete -print | |
rm -v ${BACKUP_FOLDER}/gitlab_backup.tar.sha512sum || true | |
rm -v ${BACKUP_FOLDER}/gitlab_backup.log || true |
This file contains 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
server.on("/test", HTTP_GET, [](AsyncWebServerRequest *request){ | |
ArduinoJson::StaticJsonDocument<200> doc; | |
// Add values in the document | |
// | |
doc["sensor"] = "gps"; | |
doc["time"] = 1351824120; | |
// Add an array. | |
// |
This file contains 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
describe('Helpers.Quantity', () => { | |
it('should generate quantities', () => { | |
expect(scalarToQuantity(2 / 1_000_000_000, 'n')).to.equal('2n'); | |
expect(scalarToQuantity(3 / 1_000_000, 'u')) .to.equal('3u'); | |
expect(scalarToQuantity(0.1, 'm')) .to.equal('100m'); | |
expect(scalarToQuantity(BigInt(3000), 'k')) .to.equal('3k'); | |
expect(scalarToQuantity(BigInt(3 * 1000 * 1000), 'M')) .to.equal('3M'); | |
expect(scalarToQuantity(BigInt(3 * 1000 * 1000 * 1000), 'G')) .to.equal('3G'); | |
expect(scalarToQuantity(BigInt(5 * 1000 * 1000 * 1000) * BigInt(1000), 'T')) .to.equal('5T'); | |
expect(scalarToQuantity(BigInt(3 * 1000 * 1000 * 1000) * BigInt(1000 * 1000), 'P')) .to.equal('3P'); |
This file contains 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
function findSuffix(quantity: string): string { | |
let ix = quantity.length - 1; | |
while (ix >= 0 && !/[\.0-9]/.test(quantity.charAt(ix))) { | |
ix--; | |
} | |
return ix === -1 ? '' : quantity.substring(ix + 1); | |
} | |
function quantityToScalar(quantity: string): number | bigint { | |
if (!quantity) { |
This file contains 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
pvresize --setphysicalvolumesize 400G /dev/mapper/nvme0n1p3_crypt |
This file contains 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
apiVersion: monitoring.coreos.com/v1 | |
kind: Prometheus | |
metadata: | |
annotations: | |
meta.helm.sh/release-name: rancher-monitoring | |
meta.helm.sh/release-namespace: cattle-monitoring-system | |
creationTimestamp: '2022-12-20T12:02:36Z' | |
generation: 3 | |
labels: | |
app: rancher-monitoring-prometheus |
This file contains 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 | |
trap trap_exit SIGINT | |
trap trap_exit SIGQUIT | |
trap trap_exit SIGTSTP | |
trap_exit() { | |
echo "trap signal: sleep 3 and exit" | |
sleep 3 | |
echo "Bye..." | |
exit |
This file contains 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
{{/* vim: set filetype=mustache: */}} | |
{{/* | |
Create chart name and version as used by the chart label. | |
*/}} | |
{{- define "workers.hpa_metric_name" -}} | |
{{- printf "%s-%s" .Release.Namespace .Release.Name | replace "+" "_" | replace "-" "_" | trunc 63 -}} | |
{{- end -}} |
This file contains 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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
annotations: | |
imageHash: sha256:f885a590d7d3123df58bd23392e40daa3c951aae63f3e3d457ee43efffb49844 | |
creationTimestamp: "2022-06-29T12:45:22Z" | |
generateName: landings-fake-php-fpm-77f788b5cb- | |
labels: | |
app.kubernetes.io/instance: landings-fake-php-fpm | |
app.kubernetes.io/name: app-php-fpm-nginx |
NewerOlder