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
--- | |
# eventing-core.yaml | |
# Copyright 2018 The Knative Authors | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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 | |
CRD=$1 | |
kubectl patch crd/$CRD -p '{"metadata":{"finalizers":[]}}' --type=merge | |
kubectl delete crd/$CRD |
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
export AWS_ACCOUNT_ID=your-account-id | |
export AWS_ROLE=role-in-target-account | |
creds=$(aws --output text sts assume-role --role-arn $AWS_ROLE --role-session-name "my-session-name" | grep CREDENTIALS | cut -f2,4,5) | |
export AWS_ACCESS_KEY_ID=$(echo $creds | cut -f1) | |
export AWS_SECRET_ACCESS_KEY=$(echo $creds | cut -f2) | |
export AWS_SESSION_TOKEN=$(echo $creds | cut -f3) |
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
# https://github.com/saymedia/journald-cloudwatch-logs | |
function install_journald_cloudwatch_logs() { | |
cd /tmp/ || return | |
wget https://github.com/saymedia/journald-cloudwatch-logs/releases/download/v0.0.1/journald-cloudwatch-logs-linux.zip | |
unzip journald-cloudwatch-logs-linux.zip | |
mv journald-cloudwatch-logs/journald-cloudwatch-logs /usr/local/bin/journald-cloudwatch-logs | |
mkdir -p /var/lib/journald-cloudwatch-logs | |
touch /var/lib/journald-cloudwatch-logs/state | |
chown ec2-user:ec2-user /var/lib/journald-cloudwatch-logs/state | |
} |
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
apt-get install certbot python3-pip | |
pip3 install certbot-dns-route53 | |
# Request Cert | |
/usr/local/openvpn_as/scripts/sacli ConfigQuery | grep -qe 'cs.cert' | |
LESTATUS=$? | |
if [ $LESTATUS -ne 0 ] | |
then | |
certbot certonly --non-interactive \ | |
--dns-route53 \ |
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
curl -s https://ipvigilante.com/$(curl -s https://ipinfo.io/ip) | jq '.data.latitude, .data.longitude, .data.city_name, .data.country_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
find ./ -type f -name "somefile.txt" -exec sed -i -e 's/foo/bar/g' {} \; |
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
# Local: | |
git fetch --all --prune | |
# alternative: git branch -d $( git branch -vv | grep '\[[^:]\+: gone\]' | awk '{print $1}' | xargs ) | |
# Remote: | |
git branch --remotes --merged | grep -v master | sed 's@ origin/@:@' | xargs git push origin |
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
# 1. it find your public ip via ifconfig.io | |
# 2. than use this IP to request your timezone via worldtimeapi.org | |
# 3. and send it to the command timedatectl set-timezone | |
# By: https://www.commandlinefu.com/commands/view/24463/programmatic-way-to-find-and-set-your-timezone | |
sudo timedatectl set-timezone $(curl worldtimeapi.org/api/ip/$(curl ifconfig.io/ip)|cut -d\" -f16 | |
# Without systemd: | |
echo 'Etc/UTC' | tee /etc/timezone; dpkg-reconfigure --frontend noninteractive tzdata |
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 | |
# Depending on the environment you want to deploy there could be different custom values you want set | |
# This loop checks which stages are present and then lints them together with the helm chart | |
for chart in helm-charts/* ; do | |
if [ `ls $chart | grep 'prd'` ]; then | |
helm lint $chart -f $chart/prd_values.yaml | |
elif [ `ls $chart | grep 'dev'` ]; then | |
helm lint $chart -f $chart/dev_values.yaml |