Compare commits

...

31 Commits

Author SHA1 Message Date
de8451e12b Switched hiddenbar for ice
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 07:07:35 +01:00
3d836bc810 Added spotmenu
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:56:58 +01:00
066e482fd8 Added Gifski
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:47:16 +01:00
c6a9a90dde Cleaned up GS leftovers
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:36:53 +01:00
1d34f433ef Removed GS tools
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:34:18 +01:00
8be57f1430 Handle removing old tools
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-07 06:19:23 +01:00
92b9c9d927 Remove karabiner-elements
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-06 18:24:34 +01:00
9334e7adcc Added tailscale app
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-06 18:23:36 +01:00
17ad5b51fc Added 1password
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-06 18:15:42 +01:00
7c99a558f6 Fixed install of some apps and config 2025-09-06 17:14:17 +01:00
fca2d9530e Added kind-list-images
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-09-03 11:00:41 +01:00
Marcus Noble
3ad35f41c3 Update kind-create-cluster to v1.34 by default 2025-09-03 10:10:32 +01:00
d98212c757 Update FPATH
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-29 10:09:22 +01:00
c879e18a89 Fix green colour
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-27 08:02:43 +01:00
4fb6921469 Added green colour util
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-27 07:58:36 +01:00
f4e7952130 Added baobab to install list
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-10 14:55:14 +01:00
716004c46b Added gpg config
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-09 10:06:34 +01:00
e2fb52f896 Enable syntax in vim:
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-09 09:41:47 +01:00
851be03ffc Removed screen dummp dir
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-07 20:47:39 +01:00
f7259cf9af Added more apps
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-07 20:47:22 +01:00
6bb71f487c Fix k9s screen dump dir
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-07 16:47:12 +01:00
2ad80a9c67 Added some more Mac-specific apps / installs
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-06 13:01:39 +02:00
14bc3b3b7c Various updates
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-06-06 09:57:01 +02:00
3e48fec287 Update git aliases to include PR link on publish
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-05-28 08:13:19 +01:00
ce1a34246e Updated k9s config
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-05-08 09:41:14 +01:00
fe5e9d9c9b Handle opening grafana via teleport
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-04-10 11:41:56 +01:00
a8f0d8d043 Fixed kind
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-02-07 13:47:10 +00:00
21f3d27493 Updated default kind version to 1.32
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-02-07 11:32:40 +00:00
18732d84e9 Added new Krew plugins - explore and blame
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-01-16 07:33:26 +00:00
58cbef9432 Added git release alias
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-01-09 05:26:37 +00:00
e8ba500810 Set git to follow tags by default
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
2025-01-09 05:17:55 +00:00
43 changed files with 654 additions and 1293 deletions

4
.gitignore vendored
View File

@@ -28,3 +28,7 @@
/home/.kube/*
!/home/.kube/clusters/.gitkeep
!/home/.kube/switch-config.yaml
/home/.k9s/benchmarks
/home/.k9s/clusters
/home/.k9s/screen-dumps

View File

@@ -20,6 +20,10 @@ if [ $? -eq 0 ]; then
blue() {
printf "\e[38;5;75m$@${END_CHARS}"
}
green() {
printf "\e[32;5;75m$@${END_CHARS}"
}
else
bold() {
echo $@
@@ -40,6 +44,10 @@ else
blue() {
echo $@
}
green() {
echo $@
}
fi
_fzf() {

View File

@@ -1,103 +0,0 @@
#!/usr/bin/env bash
source .utils
ACCOUNT_ID=${AWS_ACCOUNTID}
ROLE=GiantSwarmAdmin
MFA=
MFA_ARN=arn:aws:iam::${AWS_ACCOUNTID}:mfa/marcus@giantswarm.io
print_usage() {
orange "gs-aws - set up AWS credentials"
echo " "
underline "Usage:"
echo "gs-aws"
echo " "
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-a, --account the AWS account number (default: \$AWS_ACCOUNTID)"
echo "-r, --role the role to assume (default: GiantSwarmAdmin)"
echo "-t, --mfa-token the MFA token to use when generating a session [Required]"
echo "-m, --mfa-arn the ARN of the MFA device (Default ${MFA_ARN})"
}
while test $# -gt 0; do
case "$1" in
-a|--account)
shift
ACCOUNT_ID=$1
shift
;;
-r|--role)
shift
ROLE=$1
shift
;;
-t|--mfa-token)
shift
MFA=$1
shift
;;
-m|--mfa-arn)
shift
MFA_ARN=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
if [ -z $AWS_ACCESS_KEY_ID ] || [ -z $AWS_SECRET_ACCESS_KEY ] || [ -z $ACCOUNT_ID ]; then
echo "Initial AWS credentials required"
exit 1
fi
if [ -z $MFA ] || [ -z $MFA_ARN ]; then
echo "MFA token and ARN required"
exit 1
fi
unset AWS_PROFILE
printf "✨ Getting session credentials..."
SESSION_JSON=$(aws sts get-session-token --serial-number ${MFA_ARN} --token-code ${MFA})
printf "\n\e[1A\e[K✅ Got session credentials\n"
export AWS_SECRET_ACCESS_KEY=$(echo $SESSION_JSON | jq -r '.Credentials.SecretAccessKey')
export AWS_ACCESS_KEY_ID=$(echo $SESSION_JSON | jq -r '.Credentials.AccessKeyId')
export AWS_SESSION_TOKEN=$(echo $SESSION_JSON | jq -r '.Credentials.SessionToken')
export EXPIRATION=$(echo $SESSION_JSON | jq -r '.Credentials.Expiration')
if [ "${ACCOUNT_ID}" != "${AWS_ACCOUNTID}" ]; then
printf "✨ Assuming cross-account role..."
ASSUME_SESSION=$(aws sts assume-role --role-session-name $(whoami)-aws --role-arn arn:aws:iam::${ACCOUNT_ID}:role/${ROLE})
export AWS_SECRET_ACCESS_KEY=$(echo $ASSUME_SESSION | jq -r '.Credentials.SecretAccessKey')
export AWS_ACCESS_KEY_ID=$(echo $ASSUME_SESSION | jq -r '.Credentials.AccessKeyId')
export AWS_SESSION_TOKEN=$(echo $ASSUME_SESSION | jq -r '.Credentials.SessionToken')
export EXPIRATION=$(echo $ASSUME_SESSION | jq -r '.Credentials.Expiration')
printf "\n\e[1A\e[K✅ Assumed role\n"
fi
mkdir -p ~/.aws
cat > ~/.aws/credentials << EOF
[giantswarm]
aws_access_key_id=${AWS_ACCESS_KEY_ID}
aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}
aws_session_token=${AWS_SESSION_TOKEN}
expiration=${EXPIRATION}
EOF
echo "⚡️ AWS credentials setup"
echo ""
echo " You'll need to switch to the 'giantswarm' profile:"
echo ""
echo "unset AWS_ACCESS_KEY_ID"
echo "unset AWS_SECRET_ACCESS_KEY"
echo "export AWS_PROFILE=giantswarm"

View File

@@ -1,108 +0,0 @@
#!/usr/bin/env bash
source .utils
DRY_RUN=0
NAMESPACE="org-giantswarm"
RELEASE="20.0.0-alpha1"
PROVIDER="aws"
AZS="eu-west-1a"
DESCRIPTION="$(whoami)'s test cluster"
print_usage() {
orange "gs-create-cluster - create a Giant Swarm managed CAPI workload cluster"
echo " "
underline "Usage:"
echo "gs-create-cluster [cluster-name]"
echo " "
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the cluster is in (default: org-giantswarm)"
echo "-r, --release the namespace the cluster is in (default: 20.0.0-alpha1)"
echo "-p, --provider the cloud provider to use (default: aws)"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-r|--release)
shift
RELEASE=$1
shift
;;
-p|--provider)
shift
PROVIDER=$1
shift
;;
--dry-run)
DRY_RUN=1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
# Positional args
NAME=${1:-wc001}
PREFIXED_NAMESPACE="org-$NAMESPACE"
case $NAMESPACE in org-*)
PREFIXED_NAMESPACE="$NAMESPACE"
NAMESPACE=${NAMESPACE#"org-"}
esac
CAPA_CLUSTER="--provider capa"
CAPZ_CLUSTER="--provider azure --release ${RELEASE}"
CAPG_CLUSTER="--provider gcp --gcp-project giantswarm-352614 --region europe-west3 --gcp-failure-domains europe-west3-a --gcp-machine-deployment-failure-domain europe-west3-a"
TEMPLATE_ARGS="--name ${NAME:0:5} --organization ${NAMESPACE}"
case "${PROVIDER}" in
aws)
TEMPLATE_ARGS="${TEMPLATE_ARGS} ${CAPA_CLUSTER}"
;;
gcp)
TEMPLATE_ARGS="${TEMPLATE_ARGS} ${CAPG_CLUSTER}"
;;
azure)
TEMPLATE_ARGS="${TEMPLATE_ARGS} ${CAPZ_CLUSTER}"
;;
*)
echo "Unsupported provider type"
exit 1
;;
esac
echo "✨ Pre-flight checks"
gs-get-cluster --namespace ${PREFIXED_NAMESPACE} ${NAME} &>/dev/null
if [ $? -eq 0 ]; then
echo "Cluster named '${NAME}' already exists"
exit 1
elif [[ "${PROVIDER}" = "aws" ]]; then
echo "Cleaning up any old awsclusterroleidentities..."
kubectl delete --namespace ${PREFIXED_NAMESPACE} awsclusterroleidentities ${NAME} 2>/dev/null
fi
echo "✨ Creating a new ${PROVIDER} cluster called '${NAMESPACE}/${NAME}' with release '${RELEASE}'"
if [[ $DRY_RUN = 1 ]]; then
echo kubectl-gs template cluster ${TEMPLATE_ARGS} --description "${DESCRIPTION}"
kubectl-gs template cluster ${TEMPLATE_ARGS} --description "${DESCRIPTION}"
else
kubectl-gs template cluster ${TEMPLATE_ARGS} --description "${DESCRIPTION}" | kubectl apply -f -
fi
if [[ $DRY_RUN = 0 ]]; then
sleep 10
echo "✨ Checking status..."
gs-get-cluster --namespace ${PREFIXED_NAMESPACE} ${NAME}
fi

View File

@@ -1,214 +0,0 @@
#!/usr/bin/env bash
source .utils
TEMPLATE="giantswarm/template-app"
VISIBILITY="public"
CODEOWNER_TEAM="team-tinkerers"
print_usage() {
orange "gs-create-repo - a new Giant Swarm repo"
echo " "
underline "Usage:"
echo "gs-create-repo (flags) [repo-name]"
echo " "
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-t, --template the template repo to base the new repo on (default: ${TEMPLATE})"
echo " --team the team to be set as codeowner of the repo (default: ${CODEOWNER_TEAM})"
echo " --visibility the visibility of the repo (default: ${VISIBILITY}"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-t|--template)
shift
TEMPLATE=$1
shift
;;
-p|--private)
shift
VISIBILITY="private"
;;
--visibility)
shift
VISIBILITY=$1
shift
;;
--team)
shift
CODEOWNER_TEAM=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
POS_ARGS+=${1}
shift
;;
esac
done
case $TEMPLATE in
*/*)
shift
;;
*)
TEMPLATE="giantswarm/${TEMPLATE}"
;;
esac
REPOSITORY_NAME=${POS_ARGS[0]}
#############################################
echo "✨ Creating new repo $(italic ${VISIBILITY}) $(orange ${REPOSITORY_NAME}) using base template $(blue ${TEMPLATE}) assigned to $(underline ${CODEOWNER_TEAM})"
printf "Continue? (y/n): "
read CONFIRM
if [[ "${CONFIRM}" != "y" ]]; then
exit 1
fi
gh repo create --${VISIBILITY} --template ${TEMPLATE} giantswarm/${REPOSITORY_NAME}
echo "Waiting breifly for cluster to be created from template..."
sleep 5
DST="${HOME}/Code/giantswarm/${REPOSITORY_NAME}"
echo "Cloning repo to ${DST}"
mkdir -p ${DST}
git clone git@github.com:giantswarm/${REPOSITORY_NAME}.git ${DST}
cd ${DST}
if [ -d helm/APP-NAME ]; then
mv 'helm/{APP-NAME}' helm/${REPOSITORY_NAME}
fi
devctl replace -i '{APP-NAME}' ${REPOSITORY_NAME} --ignore .git ./.** ./**
# Clean up some stuff
sed -i 's|\[Read me after cloning this template (GS staff only)\](https://intranet.giantswarm.io/docs/dev-and-releng/app-developer-processes/adding_app_to_appcatalog/)||g' README.md
sed -i 's|- {APP HELM REPOSITORY}||g' README.md
sed -i '$!N; /^\(.*\)\n\1$/!P; D' README.md
sed -i 's/- .*//' CHANGELOG.md
sed -i '$!N; /^\(.*\)\n\1$/!P; D' CHANGELOG.md
echo ""
blue "Run Kubebuilder init? (y/n): "
read CONFIRM
if [ "${CONFIRM}" = "y" ]; then
mv helm .helm
kubebuilder init --domain giantswarm.io --repo github.com/giantswarm/${REPOSITORY_NAME} --plugins=go/v4-alpha
mv .helm helm
mv Makefile Makefile.kubebuilder.mk
go mod tidy
fi
devctl gen workflows --flavour app --flavour generic --check-secrets
devctl gen makefile --flavour app --flavour generic --language go
touch Makefile.custom.mk
echo ""
blue "Update Circle-CI job? (y/n): "
read CONFIRM
if [ "${CONFIRM}" = "y" ]; then
cat << EOF > .circleci/config.yml
version: 2.1
orbs:
architect: giantswarm/architect@4.24.0
workflows:
test-and-push:
jobs:
- architect/go-build:
context: architect
name: go-build
binary: ${REPOSITORY_NAME}
resource_class: xlarge
filters:
tags:
only: /^v.*/
- architect/push-to-docker:
context: architect
name: push-${REPOSITORY_NAME}-to-quay
image: "quay.io/giantswarm/${REPOSITORY_NAME}"
username_envar: "QUAY_USERNAME"
password_envar: "QUAY_PASSWORD"
requires:
- go-build
filters:
# Trigger the job also on git tag.
tags:
only: /^v.*/
- architect/push-to-docker:
context: "architect"
name: push-${REPOSITORY_NAME}-to-docker
image: "docker.io/giantswarm/${REPOSITORY_NAME}"
username_envar: "DOCKER_USERNAME"
password_envar: "DOCKER_PASSWORD"
requires:
- go-build
# Needed to trigger job also on git tag.
filters:
tags:
only: /^v.*/
# Ensure that for every commit
# there is an app version in the test catalog.
- architect/push-to-app-catalog:
context: architect
name: push-to-app-catalog
app_catalog: "control-plane-catalog"
app_catalog_test: "control-plane-test-catalog"
chart: "${REPOSITORY_NAME}"
requires:
- push-${REPOSITORY_NAME}-to-quay
- push-${REPOSITORY_NAME}-to-docker
filters:
# Trigger the job also on git tag.
tags:
only: /^v.*/
- architect/push-to-app-collection:
context: architect
name: push-to-gcp-app-collection
app_name: "${REPOSITORY_NAME}"
app_collection_repo: "gcp-app-collection"
requires:
- push-to-app-catalog
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
EOF
fi
git add -A
git commit -m "Initial repo scaffold and setup"
git push
devctl repo setup giantswarm/${REPOSITORY_NAME} \
--allow-automerge=true --allow-mergecommit=false --allow-rebasemerge=false \
--allow-squashmerge=true --allow-updatebranch=true --delete-branch-on-merge=true \
--enable-issues=true --enable-projects=false --enable-wiki=false
echo ""
echo "🎉 New repo $(orange ${REPOSITORY_NAME}) created! - https://github.com/giantswarm/${REPOSITORY_NAME}"
echo ""
echo "⚡️ Adding reference to $(orange ${REPOSITORY_NAME}) in giantswarm/github"
cd "${HOME}/Code/giantswarm/github"
git checkout main
git pull
yq -i '. += {"name": "'${REPOSITORY_NAME}'", "gen": {"flavour": "app,generic", "language": "go"}, "replace": {"architect-orb": true, "renovate": true}} | sort_by(.name)' repositories/${CODEOWNER_TEAM}.yaml
git add repositories/${CODEOWNER_TEAM}.yaml
git commit -m "Added ${REPOSITORY_NAME} to ${CODEOWNER_TEAM} repos"
git push
cd -

View File

@@ -1,38 +0,0 @@
#!/usr/bin/env bash
source .utils
set -e
NAMESPACE="org-giantswarm"
print_usage() {
orange "gs-get-cluster - get a Giant Swarm managed workload cluster"
echo " "
underline "Usage:"
echo "gs-get-cluster [cluster-name]"
echo " "
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --namespace the namespace the cluster is in (default: org-giantswarm)"
}
while test $# -gt 0; do
case "$1" in
-n|--namespace)
shift
NAMESPACE=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
kubectl-gs get cluster --namespace $NAMESPACE $@ 2>/dev/null || kubectl get cl --namespace $NAMESPACE $@

View File

@@ -1,83 +0,0 @@
#!/usr/bin/env bash
source .utils
DEBUG=""
print_usage() {
orange "gs-login - login to Giant Swarm managed clusters"
echo " "
underline "Usage:"
echo "gs-login [INSTALLATION] [WORKLOAD CLUSTER] [ORGANISATION]"
echo " "
underline "Examples:"
echo "> gs-login gauss"
echo "> gs-login gauss mywc1"
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-t|--ttl)
shift
echo "-t / --ttl no longer handled"
shift
;;
-g|--certificate-group)
shift
echo "-g / --certificate-group no longer handled"
shift
;;
-h|--help)
print_usage
exit 0
;;
--debug)
DEBUG="--level=debug"
shift
;;
/)
# We want to ignore slash seperators between MC and WC
shift
;;
*)
POS_ARGS+=(`echo $1 | tr '/' ' '`)
shift
;;
esac
done
if [ ${#POS_ARGS[@]} -eq 0 ]; then
POS_ARGS+=(`opsctl list installations --short | tr ' ' '\n' | fzf`)
fi
case ${#POS_ARGS[@]} in
0)
print_usage
exit 1
;;
*)
kubectl config delete-context gs-${POS_ARGS[0]} &>/dev/null
TELEPORT_CLUSTER_NAME="$(echo "${POS_ARGS[@]}" | tr ' ' '-')"
TELEPORT_SUPPORTED=$(tsh kube ls -f json --query "name == \"${TELEPORT_CLUSTER_NAME}\"" 2>/dev/null | jq '. | length')
if [[ "${TELEPORT_SUPPORTED}" == "0" ]]; then
# Teleport not supported, old style login
echo "Cluster isn't know to Teleport, using old login method"
opsctl login ${DEBUG} ${POS_ARGS[@]}
else
echo "Logging in with Teleport. Cluster: '${TELEPORT_CLUSTER_NAME}'"
# Make sure that caching is disabled to avoid issues with cross-cluster cache pollution
TELEPORT_CACHE_DIR="${HOME}/.kube/cache/discovery/teleport.giantswarm.io_443"
if [[ "$(readlink -f ${TELEPORT_CACHE_DIR})" != "/dev/null" ]]; then
rm -rf ${TELEPORT_CACHE_DIR}
ln -s /dev/null ${TELEPORT_CACHE_DIR}
fi
tsh kube login ${TELEPORT_CLUSTER_NAME}
fi
;;
esac

View File

@@ -1,78 +0,0 @@
#!/usr/bin/env bash
source .utils
DEBUG=""
SUPPORTED_APPS="alertmanager cloudprovider grafana happa kibana kyverno prometheus"
print_usage() {
orange "gs-open - open apps on Giant Swarm clusters"
echo " "
underline "Usage:"
echo "gs-open [APP] [INSTALLATION] [WORKLOAD CLUSTER] "
echo " "
underline "Supported apps:"
italic "${SUPPORTED_APPS}"
echo " "
underline "Examples:"
echo "> gs-open prometheus gauss"
echo "> gs-open alertmanager gauss mywc1"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo " --debug show debug log output"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
--debug)
DEBUG="--level=debug"
shift
;;
/)
# We want to ignore slash seperators between MC and WC
shift
;;
*)
POS_ARGS+=(`echo $1 | tr '/' ' '`)
shift
;;
esac
done
if [ ${#POS_ARGS[@]} -eq 0 ]; then
POS_ARGS+=(`echo ${SUPPORTED_APPS} | tr ' ' '\n' | fzf`)
fi
if [ ${#POS_ARGS[@]} -eq 1 ]; then
POS_ARGS+=(`opsctl list installations --short | tr ' ' '\n' | fzf`)
fi
APP=${POS_ARGS[0]}
if [[ "${APP}" == "cloud" ]]; then
APP=cloudprovider
fi
if [[ "${APP}" == "prom" ]]; then
APP=prometheus
fi
case ${#POS_ARGS[@]} in
0)
print_usage
exit 1
;;
2)
echo "✨ Opening ${APP} on ${POS_ARGS[1]}"
opsctl open ${DEBUG} --app ${APP} --installation ${POS_ARGS[1]}
;;
3)
echo "✨ Opening ${APP} on ${POS_ARGS[1]} / ${POS_ARGS[2]}"
opsctl open ${DEBUG} --app ${APP} --installation ${POS_ARGS[1]} --workload-cluster ${POS_ARGS[2]}
;;
esac

View File

@@ -1,118 +0,0 @@
#!/usr/bin/env bash
source .utils
set -e
print_usage() {
orange "gs-release - create a new release of a Giant Swarm repo"
echo " "
underline "Usage:"
echo "gs-release [SEMVER LEVEL]"
echo " "
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
*)
break
;;
esac
done
SEMVER=$1
CURRENT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
MAIN_BRANCH=$(git remote show origin 2>/dev/null|grep HEAD|sed 's/.* //')
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
if [ "$MAIN_BRANCH" != "$CURRENT_BRANCH" ]; then
echo "Not currently on main branch, please switch to ${MAIN_BRANCH} to perform a release"
exit 1
fi
VERSION_PARTS=($(echo $CURRENT_TAG | tr "." "\n"))
VERSION_MAJOR=${VERSION_PARTS[0]}
VERSION_MINOR=${VERSION_PARTS[1]}
VERSION_PATCH=${VERSION_PARTS[2]}
echo "The latest released version is ${CURRENT_TAG}"
echo ""
echo "The release will include:"
sed -n "/^## \[Unreleased\]$/,/^## /p" CHANGELOG.md | tail -n +3 | tail -r | tail -n +2 | tail -r | sed "s/^/ /g"
echo ""
if [[ "$SEMVER" == "" ]]; then
printf "What semver release level? (patch, minor or major): "
read SEMVER
fi
case ${SEMVER} in
patch)
VERSION_PATCH=$((VERSION_PATCH+1))
;;
minor)
VERSION_MINOR=$((VERSION_MINOR+1))
VERSION_PATCH=0
;;
major)
if [[ ${VERSION_MAJOR:0:1} == "v" ]]; then
VERSION_MAJOR="v$((VERSION_MAJOR+1))"
else
VERSION_MAJOR=$((VERSION_MAJOR+1))
fi
VERSION_MINOR=0
VERSION_PATCH=0
;;
*)
echo "Unknown Semver level provided"
exit 1
;;
esac
NEW_VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
NEW_BRANCH="${MAIN_BRANCH}#release#${NEW_VERSION}"
echo ""
echo "✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ "
echo "Current version ${CURRENT_TAG}"
echo " New version ${NEW_VERSION}"
echo " Release branch ${NEW_BRANCH}"
echo "✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ "
echo ""
printf "Confirm? (y/n): "
read CONFIRM
if [ "${CONFIRM}" = "y" ]; then
echo ""
echo "Publishing new release branch..."
echo ""
git checkout -b "${NEW_BRANCH}"
git push -u origin "${NEW_BRANCH}"
ORG_NAME=$(git remote get-url origin | sed 's/.*github.com[:|\/]//' | sed 's/\.git$//' | tr '/' ' ' | awk '{print $1}')
REPO_NAME=$(git remote get-url origin | sed 's/.*github.com[:|\/]//' | sed 's/\.git$//' | tr '/' ' ' | awk '{print $2}')
echo ""
echo "🚀 Keep an eye on $(underline "https://github.com/${ORG_NAME}/${REPO_NAME}/pulls") for the new release PR"
echo ""
echo "Switching back to the main git branch"
git checkout $(git remote show origin 2>/dev/null|grep HEAD|sed 's/.* //') &> /dev/null
git pull &> /dev/null
else
echo "Aborting..."
exit 1
fi

View File

@@ -1,75 +0,0 @@
#!/usr/bin/env bash
source .utils
DEBUG=""
print_usage() {
orange "gs-ssh - ssh to Giant Swarm managed cluster node"
echo " "
underline "Usage:"
echo "gs-ssh [CLUSTER NAME] [NODE NAME]"
echo " "
underline "Examples:"
echo "> gs-ssh gauss"
echo "> gs-ssh gauss ip-1-2-3-4.ey-west-1.compute.internal"
echo " "
underline "Options:"
echo "-h, --help show this help text"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
--debug)
DEBUG="--level=debug"
shift
;;
/)
# We want to ignore slash seperators between MC and WC
shift
;;
*)
POS_ARGS+=(`echo $1 | tr '/' ' '`)
shift
;;
esac
done
if [ ${#POS_ARGS[@]} -eq 0 ]; then
POS_ARGS+=(`opsctl list installations --short | tr ' ' '\n' | fzf`)
fi
TELEPORT_CLUSTER_NAME="$(echo "${POS_ARGS[0]}" | tr ' ' '-')"
TELEPORT_SUPPORTED=$(tsh kube ls -f json --query "name == \"${TELEPORT_CLUSTER_NAME}\"" 2>/dev/null | jq '. | length')
if [ ${#POS_ARGS[@]} -eq 1 ]; then
if [[ "${TELEPORT_SUPPORTED}" == "0" ]]; then
orange "Node name must be specified if cluster doesn't support Teleport"
exit 1
else
POS_ARGS+=(`tsh ls -f names cluster=${POS_ARGS[0]} | fzf`)
fi
fi
kubectl config delete-context gs-${POS_ARGS[0]} &>/dev/null
if [[ "${TELEPORT_SUPPORTED}" == "0" ]]; then
# Teleport not supported, old style login
echo "Cluster isn't know to Teleport, using old ssh method"
opsctl ssh ${DEBUG} ${POS_ARGS[@]}
else
echo "SSHing with Teleport. Cluster: '${TELEPORT_CLUSTER_NAME}' Node: ${POS_ARGS[1]}"
# Make sure that caching is disabled to avoid issues with cross-cluster cache pollution
TELEPORT_CACHE_DIR="${HOME}/.kube/cache/discovery/teleport.giantswarm.io_443"
if [[ "$(readlink -f ${TELEPORT_CACHE_DIR})" != "/dev/null" ]]; then
rm -rf ${TELEPORT_CACHE_DIR}
ln -s /dev/null ${TELEPORT_CACHE_DIR}
fi
tsh ssh root@cluster=${POS_ARGS[0]},node=${POS_ARGS[1]}
fi

View File

@@ -1,97 +0,0 @@
#!/usr/bin/env bash
source .utils
CODE_DIR="${HOME}/Code/GiantSwarm/cluster-standup-teardown"
CUR_DIR=$(pwd)
OUTPUT_DIR=${CUR_DIR}
print_usage() {
orange "gs-standup - Standup a new test workload cluster, using the cluster-test-suites modules."
echo " "
underline "Usage:"
echo "gs-standup [provider]"
echo " "
underline "Examples:"
echo "> gs-standup capa"
echo "> gs-standup eks"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo " --dir override the directory of cluster-test-suite code"
echo "-o --output override the directory the files output to"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
--dir)
shift
CODE_DIR=$1
shift
;;
-o|--output)
shift
OUTPUT_DIR=$1
shift
;;
*)
POS_ARGS+=(`echo $1 | tr '/' ' '`)
shift
;;
esac
done
case ${#POS_ARGS[@]} in
0)
print_usage
exit 1
;;
1)
PROVIDER=""
CONTEXT=""
case ${POS_ARGS[0]} in
"aws"|"capa")
PROVIDER="aws"
CONTEXT="capa"
;;
"azure"|"capz")
PROVIDER="azure"
CONTEXT="capz"
;;
"vsphere"|"capv")
PROVIDER="vsphere"
CONTEXT="capv"
;;
"cloud-director"|"capvcd")
PROVIDER="cloud-director"
CONTEXT="capvcd"
;;
"eks")
PROVIDER="eks"
CONTEXT="eks"
;;
"aws-private"|"capa-private")
PROVIDER="aws"
CONTEXT="capa-private-proxy"
;;
esac
cd ${CODE_DIR}
go run ${CODE_DIR}/cmd/standup/main.go \
--provider ${PROVIDER} \
--context ${CONTEXT} \
--output ${OUTPUT_DIR}
cd ${CUR_DIR}
;;
*)
print_usage
exit 1
;;
esac

View File

@@ -1,89 +0,0 @@
#!/usr/bin/env bash
source .utils
CODE_DIR="${HOME}/Code/GiantSwarm/cluster-standup-teardown"
CURR_DIR=$(pwd)
INPUT_DIR=$(pwd)
print_usage() {
orange "gs-teardown - Teardown a previously created test cluster"
echo " "
underline "Usage:"
echo "gs-teardown [provider]"
echo " "
underline "Examples:"
echo "> gs-teardown capa"
echo "> gs-teardown eks"
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo " --dir override the directory of cluster-test-suite code"
echo " --in override the directory where the previously output files exist"
}
POS_ARGS=()
while test $# -gt 0; do
case "$1" in
-h|--help)
print_usage
exit 0
;;
--dir)
shift
CODE_DIR=$1
shift
;;
--input)
shift
INPUT_DIR=$1
shift
;;
*)
POS_ARGS+=(`echo $1 | tr '/' ' '`)
shift
;;
esac
done
case ${#POS_ARGS[@]} in
0)
print_usage
exit 1
;;
1)
CONTEXT=""
case ${POS_ARGS[0]} in
"aws"|"capa")
CONTEXT="capa"
;;
"azure"|"capz")
CONTEXT="capz"
;;
"vsphere"|"capv")
CONTEXT="capv"
;;
"cloud-director"|"capvcd")
CONTEXT="capvcd"
;;
"eks")
CONTEXT="eks"
;;
"aws-private"|"capa-private")
CONTEXT="capa-private-proxy"
;;
esac
cd ${CODE_DIR}
go run ${CODE_DIR}/cmd/teardown/main.go \
--context ${CONTEXT} \
--standup-directory ${INPUT_DIR}
cd ${CUR_DIR}
;;
*)
print_usage
exit 1
;;
esac

View File

@@ -1,24 +0,0 @@
#!/usr/bin/env bash
set -e
echo "⬆️ Updating tools ⬆️"
echo
if which opsctl &>/dev/null ; then
printf "⏳ opsctl..."
opsctl version update --no-cache 1>/dev/null
printf "\n\e[1A\e[K✅ opsctl - %s\n" $(opsctl version | grep "^Version:" | awk -F' ' '{print $NF}')
fi
if which devctl &>/dev/null ; then
printf "⏳ devctl... "
devctl version update --no-cache 1>/dev/null
printf "\n\e[1A\e[K✅ devctl - %s\n" $(devctl version | grep "^Version:" | awk -F' ' '{print $NF}')
fi
if which kubectl-gs &>/dev/null ; then
printf "⏳ kubectl-gs... "
kubectl-gs selfupdate 1>/dev/null
printf "\n\e[1A\e[K✅ kubectl-gs - %s\n" $(kubectl-gs --version | awk -F' ' '{print $NF}')
fi

View File

@@ -2,20 +2,11 @@
source .utils
# Force using the `go install` version as we need to pin to 0.19 for now
alias kind=$GOPATH/bin/kind
kind --version | grep "0.19." > /dev/null
if [[ "$?" != "0" ]]; then
echo "Kind v0.19.0 is required"
exit 1
fi
NAME=""
VERSION="1.31.1@sha256:cd224d8da58d50907d1dd41d476587643dad2ffd9f6a4d96caf530fb3b9a5956"
VERSION="1.34.0@sha256:7416a61b42b1662ca6ca89f02028ac133a309a2a30ba309614e8ec94d976dc5a"
NODES="2"
FEATURE_GATES=""
RUNTIME_CONFIG=""
FEATURE_GATES="MutatingAdmissionPolicy"
RUNTIME_CONFIG="admissionregistration.k8s.io/v1alpha1"
AUDIT_POLICY=""
print_usage() {

View File

@@ -2,17 +2,8 @@
source .utils
# Force using the `go install` version as we need to pin to 0.19 for now
alias kind=$GOPATH/bin/kind
CONTEXT_NAME=$(kubectl config current-context | sed -e "s/kind-//")
kind --version | grep "0.19." > /dev/null
if [[ "$?" != "0" ]]; then
echo "Kind v0.19.0 is required"
exit 1
fi
print_usage() {
orange "kind-delete-cluster - delete a Kind cluster"
echo " "

53
home/.bin/kind-list-images Executable file
View File

@@ -0,0 +1,53 @@
#!/usr/bin/env zsh
source .utils
TAG_COUNT=5
MINOR_VERSION="v1."
print_usage() {
orange "kind-list-images - List latest images for use with Kind nodes"
echo " "
underline "Usage:"
echo "kind-list-images [minor-version]"
echo " "
echo " "
underline "Options:"
echo "-h, --help show this help text"
echo "-n, --last-n-minors return the last n minor versions (default: ${TAG_COUNT})"
}
while test $# -gt 0; do
case "$1" in
-n|--last-n-minors)
shift
TAG_COUNT=$1
shift
;;
-h|--help)
print_usage
exit 0
;;
*)
MINOR_VERSION=$1
shift
;;
esac
done
TAGS=( $(crane ls kindest/node | sort | grep 'v1.' | grep -vE 'alpha|beta' | grep ${MINOR_VERSION}) )
declare -A latestMinor
for TAG in "${TAGS[@]}"; do
MINOR="${TAG%.*}"
latestMinor[$MINOR]=$TAG
done
RETURN_TAGS=( $(echo $latestMinor | tr ' ' '\n' | sort -r | head -n ${TAG_COUNT}) )
for TAG in "${RETURN_TAGS[@]}"; do
echo " - kindest/node:$(blue $TAG)@$(crane digest kindest/node:$TAG)"
done

View File

@@ -36,33 +36,27 @@ done
NAME=${2}
addLabelsAndAnnotations() {
yq e '.metadata.labels."app.kubernetes.io/name" = "'${NAME}'" |
.metadata.labels."giantswarm.io/user" = "'$(whoami)'" |
.metadata.annotations."giantswarm.io/description" = ""' -
}
case "$1" in
deployment|dp)
kubectl create ${NAMESPACE} deployment ${NAME} --image=nginx:1.21 --dry-run=client -o yaml ${@:3} | addLabelsAndAnnotations
kubectl create ${NAMESPACE} deployment ${NAME} --image=nginx:1.21 --dry-run=client -o yaml ${@:3}
;;
ingress|in)
kubectl create ${NAMESPACE} ingress ${NAME} --dry-run=client -o yaml --rule=example.com/=my-service:web ${@:3} | addLabelsAndAnnotations
kubectl create ${NAMESPACE} ingress ${NAME} --dry-run=client -o yaml --rule=example.com/=my-service:web ${@:3}
;;
service|svc)
kubectl create ${NAMESPACE} service clusterip ${NAME} --dry-run=client -o yaml ${@:3} | addLabelsAndAnnotations
kubectl create ${NAMESPACE} service clusterip ${NAME} --dry-run=client -o yaml ${@:3}
;;
configmap|cm)
kubectl create ${NAMESPACE} configmap ${NAME} --dry-run=client -o yaml ${@:3} | addLabelsAndAnnotations
kubectl create ${NAMESPACE} configmap ${NAME} --dry-run=client -o yaml ${@:3}
;;
secret|sec)
kubectl create ${NAMESPACE} secret generic ${NAME} --dry-run=client -o yaml ${@:3} | addLabelsAndAnnotations
kubectl create ${NAMESPACE} secret generic ${NAME} --dry-run=client -o yaml ${@:3}
;;
cronjob|cj)
kubectl create ${NAMESPACE} cronjob ${NAME} --image=alpine:latest --schedule="1 * * * *" --dry-run=client -o yaml ${@:3} | addLabelsAndAnnotations
kubectl create ${NAMESPACE} cronjob ${NAME} --image=alpine:latest --schedule="1 * * * *" --dry-run=client -o yaml ${@:3}
;;
job|jo)
kubectl create ${NAMESPACE} job ${NAME} --image=alpine:latest --dry-run=client -o yaml ${@:3} | addLabelsAndAnnotations
kubectl create ${NAMESPACE} job ${NAME} --image=alpine:latest --dry-run=client -o yaml ${@:3}
;;
esac

View File

@@ -15,7 +15,6 @@ zstyle ':omz:update' mode reminder
source `brew --prefix switch`/switch.sh
# History
HISTFILE="$HOME/.zsh_history"
HISTIGNORE="&:exit:reset:clear:zh"
@@ -30,7 +29,6 @@ setopt HIST_REDUCE_BLANKS
setopt autocd
autoload -U add-zsh-hook
DISABLE_AUTO_TITLE="true"
# Override auto-title when static titles are desired ($ title My new title)
@@ -54,4 +52,6 @@ preexec() {
printf "\033]0;%s\a" "${1%% *} | $cwd" # Omit construct from $1 to show args
}
eval "$(ssh-agent -s)" > /dev/null
if [ $(/bin/ps -ef | /usr/bin/grep "ssh-agent" | /usr/bin/grep -v "grep" | wc -l) -eq 0 ]; then
eval "$(ssh-agent -s)" > /dev/null
fi

View File

@@ -2,7 +2,7 @@
alias _cat=`which cat`
alias _curl=`which curl`
alias _ls="/bin/ls"
alias _grep="/bin/grep"
alias _grep="/usr/bin/grep"
alias _diff="/usr/bin/diff"
alias _du=`which du`
alias _df=`which df`
@@ -22,7 +22,7 @@ fi
# Aliases
alias cat='bat '
alias curl='curlie'
alias ls='exa --group-directories-first --icons --header --git --ignore-glob=.git'
alias ls='eza --group-directories-first --icons --header --git --ignore-glob=.git'
alias grep='rg'
alias diff='delta'
alias du='dust'
@@ -73,10 +73,10 @@ git() {
elif [ "$1" = "commit" ]; then # Sign all commits
shift
_git commit -s $@
elif [ "$1" = "co" ]; then # Sign all commits
elif [ "$1" = "co" ]; then # Create a new branch
shift
_git checkout -b $@
elif [ "$1" = "push" ]; then # Sign all commits
elif [ "$1" = "push" ]; then # Guard against pushing to certain orgs
shift
if [ $# -eq 0 ]; then
remote_url=$(_git remote get-url $(git current-remote))
@@ -86,6 +86,60 @@ git() {
fi
fi
_git push $@
elif [ "$1" = "release" ]; then # Create a new tag
shift
SEMVER=$1
CURRENT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
VERSION_PARTS=($(echo $CURRENT_TAG | tr "." "\n"))
VERSION_MAJOR=${VERSION_PARTS[1]}
VERSION_MINOR=${VERSION_PARTS[2]}
VERSION_PATCH=${VERSION_PARTS[3]}
case ${SEMVER} in
patch)
VERSION_PATCH=$((VERSION_PATCH+1))
;;
minor)
VERSION_MINOR=$((VERSION_MINOR+1))
VERSION_PATCH=0
;;
major)
if [[ ${VERSION_MAJOR:0:1} == "v" ]]; then
VERSION_MAJOR="v$((VERSION_MAJOR+1))"
else
VERSION_MAJOR=$((VERSION_MAJOR+1))
fi
VERSION_MINOR=0
VERSION_PATCH=0
;;
*)
echo "Unknown Semver level provided"
exit 1
;;
esac
NEW_VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
echo ""
echo "✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ "
echo "Current version ${CURRENT_TAG}"
echo " New version ${NEW_VERSION}"
echo "✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ ✨ "
echo ""
printf "Confirm? (y/n): "
read CONFIRM
if [ "${CONFIRM}" = "y" ]; then
git tag -a -m "${NEW_VERSION}" ${NEW_VERSION}
echo "New tag created, don't forget to push to remote"
else
echo "Aborting..."
exit 1
fi
else
_git $@
fi

View File

@@ -34,3 +34,6 @@ export DOCKER_HOST=$(docker context inspect --format='{{.Endpoints.docker.Host}}
# Brew - Prevent updating all packages when installing a new one
export HOMEBREW_NO_AUTO_UPDATE=1
# k9s
export K9S_CONFIG_DIR="$HOME/.k9s"

View File

@@ -22,6 +22,7 @@
[push]
default = simple
followTags = true
[init]
defaultBranch = main
@@ -37,13 +38,15 @@
[alias]
basename = "!git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\\///' | sed 's/\\.git//'"
remote-base-url = "!git remote get-url $(git fork-or-origin) | tr ':' '/' | sed 's|ssh///git@|https://|' | sed 's|git@|https://|' | sed 's|\\.git|/|'"
org-name = "!git remote -v | grep -m 1 -o ':.*/' | sed 's:^.\\(.*\\).$:\\1:'"
branch-name = "!git rev-parse --abbrev-ref HEAD"
changelog-changed = "!test $(git diff --name-only HEAD origin/$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') | grep CHANGELOG.md | wc -l | xargs) = 1"
main-branch = "!git remote show origin|grep HEAD|sed 's/.* //'"
main-branch = "!git remote show origin 2>/dev/null | grep HEAD | sed 's/.* //'"
fork-or-origin = "!func(){ $(git remote show fork &>/dev/null); if [[ $? == 0 ]]; then echo \"fork\" ; else echo \"origin\"; fi; }; func"
main = "!git remote set-head origin --auto && git checkout $(git main-branch) && git pull"
publish = "!func(){ if [[ $(git branch-name) != \"$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')\" ]]; then git push -u $(git fork-or-origin) $(git branch-name) && (git changelog-changed || echo '\n\n⚠ Dont forget to update changelog ⚠️ ') ; else echo "Wat?!"; fi; }; func"
pr-link = "!echo \"$(git remote-base-url)compare/$(git main-branch)...$(git branch-name)?expand=1\""
publish = "!func(){ if [[ $(git branch-name) != \"$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')\" ]]; then git push -u $(git fork-or-origin) $(git branch-name) && (git changelog-changed || echo '\n\n⚠ Dont forget to update changelog ⚠️ ') && (echo '\n\n'; git pr-link) ; else echo "Wat?!"; fi; }; func"
cleanup = "!git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done"
dont-change-file = "!git update-index --assume-unchanged"
ignore-file = "!git update-index --skip-worktree"

View File

@@ -1,156 +0,0 @@
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
scrollback: 10000000,
// default font size in pixels for all tabs
fontSize: 13,
// font family with optional fallbacks
fontFamily: '"OpenDyslexicMono Nerd Font", "Fira Code", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// default font weight: 'normal' or 'bold'
fontWeight: 'normal',
// font weight for bold characters: 'normal' or 'bold'
fontWeightBold: 'bold',
// line height as a relative unit
lineHeight: 1,
// letter spacing as a relative unit
letterSpacing: 0,
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
// terminal text color under BLOCK cursor
cursorAccentColor: '#000',
// `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █
cursorShape: 'BEAM',
// set to `true` (without backticks and without quotes) for blinking cursor
cursorBlink: true,
// color of the text
foregroundColor: '#fff',
// terminal background color
// opacity is only supported on macOS
backgroundColor: '#000',
// terminal selection color
selectionColor: 'rgba(248,28,229,0.3)',
// border color (window, tabs)
borderColor: '#333',
// custom CSS to embed in the main window
css: `.line {
color: #999;
stroke: #999;
}`,
// custom CSS to embed in the terminal window
termCSS: '',
// if you're using a Linux setup which show native menus, set to false
// default: `true` on Linux, `true` on Windows, ignored on macOS
showHamburgerMenu: '',
// set to `false` (without backticks and without quotes) if you want to hide the minimize, maximize and close buttons
// additionally, set to `'left'` if you want them on the left, like in Ubuntu
// default: `true` (without backticks and without quotes) on Windows and Linux, ignored on macOS
showWindowControls: '',
// custom padding (CSS format, i.e.: `top right bottom left`)
padding: '12px 14px',
// the full list. if you're going to provide the full color palette,
// including the 6 x 6 color cubes and the grayscale map, just provide
// an array here instead of a color map object
colors: {
black: '#000000',
red: '#C51E14',
green: '#1DC121',
yellow: '#C7C329',
blue: '#0A2FC4',
magenta: '#C839C5',
cyan: '#20C5C6',
white: '#C7C7C7',
lightBlack: '#686868',
lightRed: '#FD6F6B',
lightGreen: '#67F86F',
lightYellow: '#FFFA72',
lightBlue: '#6A76FB',
lightMagenta: '#FD7CFC',
lightCyan: '#68FDFE',
lightWhite: '#FFFFFF',
},
// the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
// if left empty, your system's login shell will be used by default
//
// Windows
// - Make sure to use a full path if the binary name doesn't work
// - Remove `--login` in shellArgs
//
// Bash on Windows
// - Example: `C:\\Windows\\System32\\bash.exe`
//
// PowerShell on Windows
// - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`
shell: '',
// for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
// by default `['--login']` will be used
shellArgs: ['--login'],
// for environment variables
env: {},
// set to `false` for no bell
bell: `false`,
// if `true` (without backticks and without quotes), selected text will automatically be copied to the clipboard
copyOnSelect: false,
// if `true` (without backticks and without quotes), hyper will be set as the default protocol client for SSH
defaultSSHApp: true,
// if `true` (without backticks and without quotes), on right click selected text will be copied or pasted if no
// selection is present (`true` by default on Windows and disables the context menu feature)
// quickEdit: true,
// URL to custom bell
// bellSoundURL: 'http://example.com/bell.mp3',
// for advanced config flags please refer to https://hyper.is/#cfg
},
// a list of plugins to fetch and install from npm
// format: [@org/]project[#version]
// examples:
// `hyperpower`
// `@company/project`
// `project#1.0.1`
plugins: ["hyper-search", "hyperterm-paste", "hyper-tabs-enhanced", "hyper-chesterish", "hyper-quit"],
// in development, you can create a directory under
// `~/.hyper_plugins/local/` and include it here
// to load it and avoid it being `npm install`ed
localPlugins: [],
keymaps: {
// Example
// 'window:devtools': 'cmd+alt+o',
},
};

9
home/.k9s/aliases.yaml Normal file
View File

@@ -0,0 +1,9 @@
aliases:
dp: deployments
sec: v1/secrets
jo: jobs
cr: clusterroles
crb: clusterrolebindings
ro: roles
rb: rolebindings
np: networkpolicies

42
home/.k9s/config.yaml Normal file
View File

@@ -0,0 +1,42 @@
k9s:
liveViewAutoRefresh: false
refreshRate: 2
maxConnRetry: 5
readOnly: false
noExitOnCtrlC: false
ui:
enableMouse: false
headless: false
logoless: true
crumbsless: false
reactive: true
noIcons: false
skin: default
skipLatestRevCheck: false
disablePodCounting: false
shellPod:
image: busybox:1.35.0
namespace: default
limits:
cpu: 100m
memory: 100Mi
tty: true
imageScans:
enable: false
exclusions:
namespaces: []
labels: {}
logger:
tail: 5000
buffer: 50000
sinceSeconds: 0
fullScreen: false
textWrap: false
showTime: false
thresholds:
cpu:
critical: 90
warn: 80
memory:
critical: 90
warn: 80

View File

@@ -1,26 +0,0 @@
k9s:
refreshRate: 2
maxConnRetry: 5
enableMouse: false
headless: false
logoless: true
crumbsless: false
readOnly: false
noIcons: false
logger:
tail: 5000
buffer: 50000
sinceSeconds: 0
fullScreenLogs: false
textWrap: false
showTime: false
currentContext:
currentCluster:
clusters: []
thresholds:
cpu:
critical: 90
warn: 80
memory:
critical: 90
warn: 80

154
home/.k9s/plugins.yaml Normal file
View File

@@ -0,0 +1,154 @@
plugins:
# kubectl-blame by knight42
# Annotate each line in the given resource's YAML with information from the managedFields to show who last modified the field.
# Source: https://github.com/knight42/kubectl-blame
# Install via:
# krew: `kubectl krew install blame`
# go: `go install github.com/knight42/kubectl-blame@latest`
blame:
shortCut: b
confirm: false
description: "Blame"
scopes:
- all
command: sh
background: false
args:
- -c
- "kubectl-blame $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT | less"
# Suspends/Resumes a cronjob
toggleCronjob:
shortCut: Shift-S
confirm: true
scopes:
- cj
description: Toggle to suspend or resume a running cronjob
command: kubectl
background: true
args:
- patch
- cronjobs
- $NAME
- -n
- $NAMESPACE
- --context
- $CONTEXT
- -p
- '{"spec" : {"suspend" : $!COL-SUSPEND }}'
# Flux
reconcile-git:
shortCut: Shift-R
confirm: false
description: Flux reconcile
scopes:
- gitrepositories
command: bash
background: false
args:
- -c
- >-
flux
reconcile source git
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
reconcile-hr:
shortCut: Shift-R
confirm: false
description: Flux reconcile
scopes:
- helmreleases
command: bash
background: false
args:
- -c
- >-
flux
reconcile helmrelease
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
reconcile-helm-repo:
shortCut: Shift-R
description: Flux reconcile
scopes:
- helmrepositories
command: bash
background: false
confirm: false
args:
- -c
- >-
flux
reconcile source helm
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
reconcile-oci-repo:
shortCut: Shift-R
description: Flux reconcile
scopes:
- ocirepositories
command: bash
background: false
confirm: false
args:
- -c
- >-
flux
reconcile source oci
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
reconcile-ks:
shortCut: Shift-R
confirm: false
description: Flux reconcile
scopes:
- kustomizations
command: bash
background: false
args:
- -c
- >-
flux
reconcile kustomization
--context $CONTEXT
-n $NAMESPACE $NAME
| less -K
remove_finalizers:
shortCut: Ctrl-F
confirm: true
scopes:
- all
description: |
Removes all finalizers
command: kubectl
background: true
args:
- patch
- --context
- $CONTEXT
- --namespace
- $NAMESPACE
- $RESOURCE_NAME.$RESOURCE_GROUP
- $NAME
- -p
- '{"metadata":{"finalizers":null}}'
- --type
- merge
watch-events:
shortCut: Shift-E
confirm: false
description: Watch Events
scopes:
- all
command: sh
background: false
args:
- -c
- "kubectl events --context $CONTEXT --namespace $NAMESPACE --for $RESOURCE_NAME.$RESOURCE_GROUP/$NAME --watch"

View File

@@ -3,3 +3,4 @@ set paste
set number
set linespace=3
set cursorline
syntax on

View File

@@ -16,6 +16,7 @@ PATH_DIRS=(
"${PATH}"
)
export PATH=${"${PATH_DIRS[*]}"// /:}
export FPATH="$FPATH:/opt/homebrew/share/zsh/site-functions"
if [ ! -z ~/.additional_dotfiles/credentials ]; then
source ~/.additional_dotfiles/credentials

112
install.sh Normal file → Executable file
View File

@@ -2,22 +2,21 @@
export PATH="/home/linuxbrew/.linuxbrew/bin:/opt/homebrew/bin/:$PATH"
GITEMAIL=$(git config --get user.email)
[ -d ~/.additional_dotfiles ] || (mkdir -p ~/.additional_dotfiles && touch ~/.additional_dotfiles/credentials)
[ -d /usr/local/share/zsh/site-functions ] || (sudo mkdir -p /usr/local/share/zsh/site-functions && sudo chmod 777 /usr/local/share/zsh/site-functions)
# Install homebrew
echo ""
echo "🔵 Installing homebrew"
which brew >/dev/null || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew tap homebrew/core
echo "🔵 Setting up zsh"
echo "✅"
# Install oh-my-zsh
echo ""
echo "🔵 Setting up zsh"
printf "Cloning oh-my-zsh..."
[ -d ${HOME}/.oh-my-zsh ] || sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
printf " ✅\n"
# Install ZSH plugins
printf "Cloning zsh plugins..."
[ -d ${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ] || git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
@@ -30,26 +29,41 @@ sudo chmod -R 755 /usr/local/share/zsh/site-functions
# Install tools
BREW_TOOLS=(
git argocd bandwhich bat danielfoehrkn/switch/switch derailed/k9s/k9s
dive doggo duf dust exa fd fzf git-delta go helm htop jq kind krew
dive doggo duf dust eza fd fzf git-delta go helm htop jq kind krew curl
kubectl kustomize node procs progress ripgrep rs/tap/curlie rust starship
tektoncd/tools/tektoncd-cli tldr tailscale yq hashicorp/tap/vault
tabby vale lastpass-cli jless macchina tz vmware-tanzu/carvel/kapp viddy
homeassistant-cli act dnsmasq gh kubebuilder golangci-lint gnu-sed
pulumi/tap/pulumi kubeseal podman podman-desktop fluxcd/tap/flux
watch crane openssh siderolabs/talos/talosctl civo/tools/civo
pete911/tap/kubectl-iam4sa gron azure-cli ssup2/tap/kpexec
opentofu
tektoncd/tools/tektoncd-cli tldr tailscale yq tabby vale jless macchina tz viddy
homeassistant-cli act dnsmasq gh kubebuilder golangci-lint gnu-sed s3cmd
pulumi/tap/pulumi kubeseal fluxcd/tap/flux ical-buddy baobab
watch crane openssh siderolabs/talos/talosctl civo/tools/civo raspberry-pi-imager
gron ssup2/tap/kpexec opentofu visual-studio-code 1password-cli scw smartmontools
firefox signal slack ffmpeg openscad tsh colima docker docker-buildx nordvpn
1password tailscale-app
)
# Brew tools only available / needed on Mac
MAC_BREW_TOOLS=(
pinentry-mac gpg gawk coreutils wget stats homebrew/cask-fonts/font-open-dyslexic-nerd-font
hiddenbar dimentium/autoraise/autoraiseapp
pinentry-mac gpg gawk coreutils wget stats font-open-dyslexic-nerd-font
dimentium/autoraise/autoraiseapp the-unarchiver rar mas capcut
mqtt-explorer raycast bettertouchtool calibre kdenlive royal-tsx tableplus
homebrew/cask/todoist ultimaker-cura webtorrent pika pearcleaner spotmenu
jordanbaird-ice
)
CARGO_TOOLS=( bottom )
NODE_TOOLS=( git-split-diffs )
KREW_TOOLS=( gs outdated tree stern )
KREW_TOOLS=( outdated tree stern explore blame access-matrix cert-manager rbac-tool resource-capacity view-secret )
APT_TOOLS=( zsh gcc )
MAS_TOOLS=(
1263070803 # Lungo
1470584107 # Dato
1351639930 # Gifski
)
# Tools removed to be cleaned up
REMOVED_BREW_TOOLS=(
exa karabiner-elements kubectx hiddenbar
)
REMOVED_KREW_TOOLS=( gs )
echo ""
echo "🔵 Installing / updating tools"
# Install Debian/Ubuntu specific packages if apt exists
@@ -59,6 +73,8 @@ if command -v apt &>/dev/null; then
fi
# Homebrew
echo ""
echo "🔵 Homebrew tools"
export HOMEBREW_NO_INSTALL_CLEANUP=true
for tool in "${BREW_TOOLS[@]}"
do
@@ -72,6 +88,8 @@ do
done
# Cargo
echo ""
echo "🔵 Cargo tools"
for tool in "${CARGO_TOOLS[@]}"
do
printf "${tool}..."
@@ -84,6 +102,8 @@ do
done
# Krew
echo ""
echo "🔵 Krew tools"
kubectl-krew update &>/dev/null
for tool in "${KREW_TOOLS[@]}"
do
@@ -105,6 +125,7 @@ fulllink() {
fi
}
echo ""
echo "🔵 OS Specific setup"
echo "Detected OS type: ${OSTYPE}"
@@ -114,6 +135,8 @@ case "${OSTYPE}" in
;;
*darwin*)
# Mac specific setup
echo ""
echo "Instaling Mac-specific Brew tools..."
for tool in "${MAC_BREW_TOOLS[@]}"
do
printf "${tool}..."
@@ -125,7 +148,22 @@ case "${OSTYPE}" in
fi
done
# Mac App Store
echo ""
echo "Instaling Mac-specific App Store tools..."
for tool in "${MAS_TOOLS[@]}"
do
printf "MAS ID: ${tool}..."
mas install ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done
echo ""
echo "Setting up config files"
FILES=$(/usr/bin/find ./os-specific/darwin/home -maxdepth 1 -mindepth 1 | tr '\n' ' ')
for file in $FILES
do
@@ -147,12 +185,14 @@ case "${OSTYPE}" in
# Handle other files outside of the user's home directory
echo "Handiling non-standard files:"
echo ""
echo "🔵 Handiling non-standard files:"
# 1. Tabby config
mkdir -p "/Users/${USER}/Library/Application Support/tabby"
f=$(fulllink "./other-files/tabby/config.yaml")
dst="/Users/${USER}/Library/Application Support/tabby/config.yaml"
printf "Linking ${f}=>${dst}"
ln -sfn ${f} ${dst}
ln -sfn "${f}" "${dst}"
printf " ✅\n"
# 2. dnsmasq
@@ -168,6 +208,7 @@ case "${OSTYPE}" in
;;
esac
echo ""
echo "🔵 Adding configuration"
FILES=$(/usr/bin/find ./home -maxdepth 1 -mindepth 1 | tr '\n' ' ')
for file in $FILES
@@ -178,3 +219,36 @@ do
ln -sfn ${f} ${dst}
printf " ✅\n"
done
echo ""
echo "🔵 Updating installed tools..."
brew upgrade
mas upgrade
echo ""
echo "🔵 Removing old Homebrew tools"
export HOMEBREW_NO_INSTALL_CLEANUP=true
for tool in "${REMOVED_BREW_TOOLS[@]}"
do
printf "${tool}..."
brew uninstall ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done
echo ""
echo "🔵 Removing old Krew tools"
for tool in "${REMOVED_KREW_TOOLS[@]}"
do
printf "${tool}..."
kubectl-krew uninstall ${tool} &>/dev/null
if [ $? -eq 0 ]; then
printf " ✅\n"
else
printf " ❌\n"
fi
done

View File

@@ -1 +1,5 @@
pinentry-program /opt/homebrew/bin//pinentry-mac
default-cache-ttl 0
max-cache-ttl 600
default-cache-ttl-ssh 0
max-cache-ttl-ssh 0

View File

@@ -0,0 +1 @@
pinentry-mode loopback

View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Brand
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
open 'smb://nas._smb._tcp.local/Nextcloud/Pictures/Brand'

View File

@@ -0,0 +1,16 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Litra Glow Off
# @raycast.mode silent
# Optional parameters:
# @raycast.icon ⚫️
# Documentation:
# @raycast.description Turn off Litra Glow light
cd ~/.bin/
./litractl off

View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Litra Glow On
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 💡
# Documentation:
# @raycast.description Turn on Litra Glow light
cd ~/.bin/
./litractl on

View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Nextcloud
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
open 'smb://nas._smb._tcp.local/Nextcloud'

View File

@@ -0,0 +1,11 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Reaction Gifs
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
open 'smb://nas._smb._tcp.local/Nextcloud/Pictures/ReactionGifs'

View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Restart BusyCal Menu
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
# Documentation:
# @raycast.description Kills the BusyCal process
pkill busycal-setapp.alarm
open /Applications/Setapp/BusyCal.app

View File

@@ -0,0 +1,14 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Restart Logi daemon
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
# Documentation:
# @raycast.description Kills the LogiMgr process to allow a new one to spawn
pkill LogiMgr

View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Things
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
open 'smb://nas._smb._tcp.local/Things'

View File

@@ -0,0 +1,34 @@
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Toggle Microphone
# @raycast.mode silent
# @raycast.packageName System
# Optional parameters:
# @raycast.icon 🎙
# Documentation:
# @raycast.author Matthew Morek
# @raycast.authorURL https://github.com/matthewmorek
# @raycast.description Toggles microphone.
on getMicrophoneVolume()
input volume of (get volume settings)
end getMicrophoneVolume
on disableMicrophone()
set volume input volume 0
log "Microphone turned off 🔴"
end disableMicrophone
on enableMicrophone()
set volume input volume 100
log "Microphone turned on 🟢"
end enableMicrophone
if getMicrophoneVolume() is greater than 0 then
disableMicrophone()
else
enableMicrophone()
end if

View File

@@ -1,3 +1,4 @@
server=/cluster.local/192.168.1.3
server=192.168.1.3
server=192.168.1.4
server=192.168.1.5
@@ -7,3 +8,4 @@ listen-address=127.0.0.1
bogus-priv
no-resolv
bind-interfaces
auth-ttl=0

View File

@@ -1,4 +1,4 @@
version: 3
version: 7
profiles: []
hotkeys:
copy-current-path: []
@@ -129,37 +129,71 @@ hotkeys:
switch-profile:
- ⌘-Shift-E
toggle-window: []
scroll-to-bottom: []
delete-line:
- ⌘-Backspace
settings-tab: {}
explode-tab:
- ⌘-Shift-.
combine-tabs:
- ⌘-Shift-,
pane-nav-1: []
pane-nav-2: []
pane-nav-3: []
pane-nav-4: []
pane-nav-5: []
pane-nav-6: []
pane-nav-7: []
pane-nav-8: []
pane-nav-9: []
pane-increase-vertical: []
pane-decrease-vertical: []
pane-increase-horizontal: []
pane-decrease-horizontal: []
focus-all-tabs:
- ⌘-⌥-Shift-I
scroll-to-top:
- Shift-PageUp
scroll-up:
- ⌥-PageUp
scroll-down:
- ⌥-PageDown
restart-tab: []
reconnect-tab: []
disconnect-tab: []
command-selector:
- ⌘-Shift-P
terminal:
searchOptions: {}
colorScheme:
name: Desert
foreground: '#ffffff'
background: '#333333'
cursor: '#00ff00'
name: hyper-chesterish
foreground: '#CDD2E9'
background: '#293340'
cursor: '#2C85F7'
colors:
- '#4d4d4d'
- '#ff2b2b'
- '#98fb98'
- '#f0e68c'
- '#cd853f'
- '#ffdead'
- '#ffa0a0'
- '#f5deb3'
- '#555555'
- '#ff5555'
- '#55ff55'
- '#ffff55'
- '#87ceff'
- '#ff55ff'
- '#ffd700'
- '#ffffff'
- '#293340'
- '#E17E85'
- '#61BA86'
- '#FFEC8E'
- '#4CB2FF'
- '#BE86E3'
- '#2DCED0'
- '#CDD2E9'
- '#546386'
- '#E17E85'
- '#61BA86'
- '#FFB68E'
- '#4CB2FF'
- '#BE86E3'
- '#2DCED0'
- '#CDD2E9'
font: OpenDyslexicMono Nerd Font
ligatures: true
cursor: beam
pasteOnMiddleClick: false
autoOpen: true
customColorSchemes: []
background: colorScheme
autoOpen: true
ssh: {}
configSync:
parts: {}
@@ -176,3 +210,9 @@ recoverTabs: false
electronFlags:
- - force_discrete_gpu
- '0'
accessibility: {}
hacks: {}
groups: []
providerBlacklist: []
commandBlacklist: []
profileBlacklist: []