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=Docker garbage collection | |
ConditionACPower=true | |
ConditionDirectoryNotEmpty=/var/lib/docker | |
Requisite=docker.service | |
PartOf=docker.service | |
After=docker.service | |
[Service] | |
Environment=GRACE_PERIOD=1h |
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 | |
set -eu | |
# The idea is to create a large file that will be written to disk and not into the filesystem tree. | |
# reflinks work if a copy shares disk space. | |
# Do not use 'fallocate' or the like, because some filesystems will compress it and store the result in their tree. | |
if ! command -v filefrag &>/dev/null; then | |
>&2 printf "command not found: filefrag\n" |
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=GITLAB Runner for Docker | |
Documentation=https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/docker.md | |
ConditionArchitecture=x86-64 | |
ConditionACPower=true | |
AssertFileNotEmpty=/var/gitlab-runner/config/config.toml | |
After=docker.service docker-gitlab.service update-gitlab-runner.service | |
Requires=docker.service | |
Wants=update-gitlab-runner.service |
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=netboot server | |
Wants=network-online.target | |
After=network-online.target sys-subsystem-net-devices-ext0.device | |
AssertPathExists=/srv/ftp/tftproot | |
[Service] | |
Slice=machine.slice | |
KillMode=mixed | |
Restart=on-abort |
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=updates Golang's documentation index | |
ConditionFileNotEmpty=!/usr/share/go-1.6/godoc_index.db | |
ConditionACPower=true | |
AssertDirectoryNotEmpty=/usr/share/go-1.6 | |
[Service] | |
Restart=on-failure | |
ExecStart=/usr/bin/godoc \ |
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=newrelic-sysmond | |
After=docker.service | |
[Service] | |
ProtectHome=true | |
ProtectSystem=full | |
PIDFile=/run/newrelic-sysmond.pid | |
ExecStartPre=-/bin/bash -c "[[ -x /opt/sbin/nrsysmond ]] || (mkdir -p /opt/sbin; docker pull newrelic/nrsysmond:latest && rsync -au $(docker inspect newrelic/nrsysmond:latest | jq -r '.[0].GraphDriver.Data.UpperDir // .[0].GraphDriver.Data.RootDir')/usr/sbin/nrsysmond /opt/sbin/)" |
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 | |
# | |
# Backup script that tries to utilize all available disc spindles and cores. | |
# For every target archive ("sink") create a file "sink.list" | |
# which contains what to backup ("sources") linewise. | |
# (Prefer plzip to xz if you have the former at hand.) | |
# | |
# wrapper to: tar sort xargs xz | |
# | |
# run: ./backup.sh run *.list |
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 | |
# | |
# Gets videos, for example from YouTube, as best-quality separate tracks | |
# and stitches them, video by video, into a MKV – avoiding excess clutter files. | |
# | |
# wrapper to: mkvtoolnix youtube-dl iconv jq file | |
# | |
# author: W-Mark Kubacki <[email protected]> | |
set -e -o pipefail |
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 | |
# | |
# Copyright (c) 2015 W. Mark Kubacki <[email protected]> | |
# Licensed under the terms of the RPL 1.5 for all usages | |
# http://www.opensource.org/licenses/rpl1.5 | |
# | |
set -e -o pipefail | |
CAsubj="/C=DE/ST=Niedersachsen/L=Hannover/O=Dummy CA/CN=Sign-It-All" |
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
func BindHexEncodedField(field *[]byte) func(string, []string, binding.Errors) binding.Errors { | |
return func(fieldName string, formVals []string, errs binding.Errors) binding.Errors { | |
var err error | |
*field, err = hex.DecodeString(formVals[0]) | |
if err != nil { | |
errs.Add([]string{fieldName}, binding.DeserializationError, err.Error()) | |
} | |
return errs | |
} | |
} |