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 -e | |
resource=${1:-"pods"}; namespace=${2:-"default"} | |
watch -c "echo ' _ ___'; echo '| | __/ _ \ ___'; echo '| |/ / | | / __| Namespace: ${namespace}'; echo '| <| |_| \__ \ Resources: ${resource}'; echo '|_|\_\\\\\___/|___/'; echo; kubectl get -n "$namespace" "$resource" ${@:3} |
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
# Set up system. There's a problem with Juju 2.8.1 and microk8s 1.18 | |
# So we trick Juju 2.8.1 into thinking it's just connecting to a | |
# regular kubernetes cluster | |
sudo snap remove microk8s | |
sudo snap refresh --channel=2.8/stable juju --classic | |
sudo snap install --channel=1.18/stable microk8s --classic | |
sudo snap install --channel=1.18/stable kubectl --classic | |
sudo microk8s.config > ~/.kube/config | |
juju add-k8s k8s-1.18 --storage=hostpath |
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 -e | |
bundle_name=${1:-'charmed-kubernetes'} | |
channel=${2:-'stable'} | |
architecture=${3:-'amd64'} | |
mkdir -p /tmp/${bundle_name} | |
cd /tmp/${bundle_name} | |
echo "Downloading ${bundle_name} metadata..." | |
curl "https://api.jujucharms.com/charmstore/v5/meta/bundle-metadata?id=${bundle_name}&channel=${channel}" > ${bundle_name}.json |
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
require 'formula' | |
class Sshpass < Formula | |
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz' | |
homepage 'http://sourceforge.net/projects/sshpass' | |
sha256 'c3f78752a68a0c3f62efb3332cceea0c8a1f04f7cf6b46e00ec0c3000bc8483e' | |
def install | |
system "./configure", "--disable-debug", "--disable-dependency-tracking", | |
"--prefix=#{prefix}" |
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
cd /tmp | |
curl -O -L http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz && tar xvzf sshpass-1.06.tar.gz | |
cd sshpass-1.06 | |
./configure | |
sudo make install |
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
#!/usr/bin/env bash | |
ip_address=$( | |
aws ec2 describe-instances --instance-id $instance_id | \ | |
jq -r ".Reservations[] | .Instances[] | select(.InstanceId==\"$instance_id\") | .PublicIpAddress" | |
) | |
if ! grep $ip_address ~/.ssh/known_hosts >/dev/null; then | |
# Print the SSH fingerprints for jumpbox | |
echo "Valid server key fingerprints:" | |
aws ec2 get-console-output --instance-id $instance_id | \ |
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
#!/usr/bin/env bash | |
# | |
# Usage: ./yaml-to-json.sh | jq . | |
# | |
file=$1 | |
if ! pip show pyyaml >/dev/null; then | |
echo "PyYAML needs to be installed" |
OlderNewer