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 | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
# This is the SMF start method for anycast. | |
# Put it in /opt/custom/smf/anycast | |
set -o xtrace |
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 | |
set -o errexit | |
set -o pipefail | |
if [[ -n "$TRACE" ]]; then | |
export PS4='[\D{%FT%TZ}] ${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' | |
set -o xtrace | |
fi |
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
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", | |
"name": "Annotations & Alerts", |
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
# zpool create tank mirror /var/tmp/f1 /var/tmp/f2 mirror /var/tmp/f3 /var/tmp/f4 | |
# zpool list tank | |
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT | |
tank 1.88G 1.36M 1.87G - - 0% 0% 1.00x ONLINE - | |
# zpool status tank | |
pool: tank | |
state: ONLINE | |
scan: none requested | |
config: |
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 | |
# MIT License. | |
# This isn't meant to be run as a script exactly, but github has better syntax hilighting if I pretend. | |
chr=${PWD}/testroot | |
mkdir -p $chr/{bin,lib,lib64,native,var} | |
cd $chr | |
cp -v /bin/{bash,touch,ls,rm} $chr/bin |
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 | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
# Copyright 2020 Joyent, Inc. | |
printf '# HELP plugin_zone_count Zone count by state\n' | |
printf '# TYPE plugin_zone_count gauge\n' |
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 | |
# | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
# | |
# Copyright 2020 Joyent, Inc. | |
if [[ -n "$TRACE" ]]; then | |
export PS4='[\D{%FT%TZ}] ${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' |
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 | |
# MPU parts need to be minimum 5MB, except the last part. | |
split -b 5m file part. | |
# Create MPU transaction | |
mpu_id=$(mmpu create ~~/stor/file) | |
# Upload each part | |
part0=$(mmpu upload -f part.aa "$mpu_id" 0) | |
part1=$(mmpu upload -f part.ab "$mpu_id" 1) |
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 -x | |
set -o pipefail | |
api_v="1.21" | |
call_docker() { | |
local uuid=$(uuid) | |
/opt/pkg/bin/curl -k -si \ | |
--cert ${DOCKER_CERT_PATH}/cert.pem \ |
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
# include this file from nginx.conf inside the http stanza. | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name adminui.example.com; | |
access_log /var/log/nginx/adminui.access.log bunyan; | |
error_log /var/log/nginx/adminui.error.log; |