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
| #Core resources | |
| resource.customizations.health.Service: | | |
| hs = {} | |
| -- Check if this is a LoadBalancer service | |
| if obj.spec ~= nil and obj.spec.type == "LoadBalancer" then | |
| -- If LoadBalancer ingress is empty, mark as healthy (ignore) | |
| if obj.status == nil or obj.status.loadBalancer == nil or obj.status.loadBalancer.ingress == nil or #obj.status.loadBalancer.ingress == 0 then | |
| hs.status = "Healthy" | |
| hs.message = "LoadBalancer service waiting for external IP/hostname assignment" | |
| return hs |
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
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| case $- in | |
| *i*) ;; | |
| *) return;; | |
| esac |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <title>Access Denied</title> | |
| <link | |
| href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" | |
| rel="stylesheet" | |
| integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" |
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
| {# ===================================================================== | |
| COMMENTS (all forms) | |
| ===================================================================== #} | |
| {# single line #} | |
| {## | |
| multiline | |
| block | |
| ##} |
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
| [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 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 | |
| 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 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
| 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 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
| 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 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
| 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 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
| pvresize --setphysicalvolumesize 400G /dev/mapper/nvme0n1p3_crypt |
NewerOlder