-
Abstract: This guide provides best practices for writing clear, maintainable, and robust Zsh scripts. Aimed at helping developers transition from Bash to Zsh, particularly on macOS, this guide offers practical advice and examples for creating standardized and efficient scripts.
-
Copyright This text of this guide is Copyright ©️2024 by Christopher Allen, and is shared under spdx:CC-BY-SA-4.0 open-source license. All the example code is relenquished to the public domain under spx:CC0-1.0.
-
Tags: #zsh #scripting #cli #opinionated
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
| apiVersion: apps/v1 | |
| kind: DaemonSet | |
| metadata: | |
| name: netshoot | |
| labels: | |
| app: netshoot | |
| spec: | |
| updateStrategy: | |
| type: RollingUpdate | |
| selector: |
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
| --- | |
| apiVersion: source.toolkit.fluxcd.io/v1beta2 | |
| kind: HelmRepository | |
| metadata: | |
| name: csi-driver-nfs | |
| namespace: flux-system | |
| spec: | |
| interval: 24h | |
| url: https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts | |
| --- |
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
| --- | |
| apiVersion: cert-manager.io/v1 | |
| kind: Certificate | |
| metadata: | |
| name: cluster-wildcard-cert | |
| namespace: default | |
| spec: | |
| secretName: cluster-wildcard-cert | |
| issuerRef: | |
| name: <issuer-name> |
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
| kubectl get rolebindings,clusterrolebindings \ | |
| --all-namespaces \ | |
| -o custom-columns='KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,SERVICE_ACCOUNTS:subjects[?(@.kind=="ServiceAccount")].name' |
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
| FROM golang:alpine AS build-stage | |
| WORKDIR /app | |
| COPY * /app | |
| RUN go build . | |
| FROM golang:alpine AS run-stage | |
| COPY --from=build-stage /app/fedilogger /app/fedilogger | |
| CMD ["/app/fedilogger"] |
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
| ... | |
| spec: | |
| contatiners: | |
| - env: | |
| - name: REQUESTS_CA_BUNDLE | |
| value: /opt/cert/bundle.pem | |
| volumeMounts: | |
| - mountPath: /opt/cert | |
| name: custom-cert | |
| subPath: cert |
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
| apiVersion: v1 | |
| kind: Deployment | |
| metadata: | |
| name: my-pod | |
| spec: | |
| containers: | |
| - name: my-app | |
| image: my-image | |
| volumeMounts: |
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
| --- | |
| apiVersion: apps/v1 | |
| kind: DaemonSet | |
| metadata: | |
| name: netshoot | |
| labels: | |
| app: netshoot | |
| spec: | |
| updateStrategy: | |
| type: RollingUpdate |
rootaccess is required- make sure you are using a sufficiently new
tcpdumpversion that supports the-Tflag. This is the version I used for testing:
root@ada-ec-1:/home/ada# tcpdump --version
tcpdump version 4.99.1
libpcap version 1.10.1 (with TPACKET_V3)
NewerOlder