Skip to content

Instantly share code, notes, and snippets.

View CalvinHartwell's full-sized avatar
💭
Delivering Kubernetes!

Calvin Hartwell CalvinHartwell

💭
Delivering Kubernetes!
View GitHub Profile
@CalvinHartwell
CalvinHartwell / gist:65d855ad0df5f5d25b0d5b9d7aa86a8a
Last active December 14, 2020 14:21
ubuntu 18.04 apt repository creation (server and client)
# Intro
There are two machines, Machine A (repository) and Machine B (client)
These machines are reachable on the same network via IP, but they don't have to be; it is possible to do DNS resolution etc.
I assume the machine you are working on has SSH access and SUDO access to both Machine A and Machine B.
First download the appropriate deb(s) you need, such as microsoft teams or google chrome:
- Chrome (https://www.google.com/intl/en_uk/chrome/) called google-chrome-stable_current_amd64.deb
- Microsoft Teams (https://www.microsoft.com/en-gb/microsoft-365/microsoft-teams/download-app) called teams_1.3.00.5153_amd64.deb
SCP These files to your Repository machine via:
@CalvinHartwell
CalvinHartwell / zscaler.sh
Created September 22, 2020 13:21
Zscaler Proxy Example Script for Ubuntu + GNOME including CA Certificate import to browser trust store for Chrome/FF
#!/bin/bash
# Some of these files are uploaded to Landscape server
PAC_FILE_LOCATION="http://<zscaler-pac-config-file-location/file.PAC"
CA_TAR="zscaler.tar.gz"
CA_CERTIFICATE_NAME="<zscaler-root-ca-certificate-name-replace-me.crt>"
CERT_DIR_PATH="/usr/local/share/ca-certificates"
# Import ZSCALER Public CA Root Cert
sudo apt-get install libnss3-tools -y
# Charmed k8s enforces its own coredns config which you cannot override and it gets reverted.
# So had to set the dns option to "none" on the k8s master charm.
# (You can apparently extend the coreDNS config by using coredns-custom but I didn't try it)
# then had to manually deploy the coredns using this:
---
apiVersion: v1
kind: ServiceAccount
metadata:
@CalvinHartwell
CalvinHartwell / ceph-csi-configmap.yaml
Last active July 20, 2020 17:57
Microk8s + Charmed Ceph - Installation Steps
---
# This is a sample config map that helps define a Ceph cluster configuration
# as required by the CSI plugins.
apiVersion: v1
kind: ConfigMap
# The <cluster-id> is used by the CSI plugin to uniquely identify and use a
# Ceph cluster, the value MUST match the value provided as `clusterID` in the
# StorageClass
# The <MONValue#> fields are the various monitor addresses for the Ceph cluster
# identified by the <cluster-id>
@CalvinHartwell
CalvinHartwell / landscape-client-install.sh
Last active April 15, 2020 12:21
landscape-client-install.sh
#!/bin/bash
# install landscape-client package.
sudo apt-get update -y
sudo apt-get install landscape-client -y
# Generate a unique random name for the machine based on machine-id and date-time
# this logic can be modified as required.
COMPUTER_TITLE=$HOSTNAME
ACCOUNT_NAME="calvin-hartwell"
@CalvinHartwell
CalvinHartwell / bundle.yaml
Created December 2, 2019 12:57
bundle.yaml
machines:
'0':
series: bionic
'1':
series: bionic
'2':
series: bionic
relations:
- - nova-compute:amqp
- rabbitmq-server:amqp
@CalvinHartwell
CalvinHartwell / kubernetestraining-deployment.yaml
Last active November 28, 2019 13:25
kubernetes training
---
apiVersion: extensions/v1
kind: Deployment
metadata:
name: letsk8s
labels:
app: letsk8s
spec:
replicas: 3
selector:
@CalvinHartwell
CalvinHartwell / 18.04-openscap.md
Last active November 15, 2021 20:53
Using OpenSCAP on Ubuntu 18.04 LTS

Using OpenSCAP on Ubuntu 18.04 LTS

Installation Instructions

First we install the following packages to use the openscap command-line tool: sudo apt-get install libopenscap8 python-openscap

We will also install the SCAP security guide: sudo apt install ssg-base ssg-debderived ssg-debian ssg-nondebian ssg-applications

@CalvinHartwell
CalvinHartwell / cdk-aws-demo
Last active September 18, 2019 20:55
cdk-aws-demo
# microk8s demo
# https://ubuntu.com/blog/getting-started-with-knative-1
sudo snap install microk8s --classic
sudo microk8s.kubectl get po --all-namespaces
sudo microk8s.enable knative
sudo microk8s.enable istio
sudo microk8s.kubectl get po --all-namespaces
# Setup Credentials
sudo snap install juju --classic
@CalvinHartwell
CalvinHartwell / gist:56a9a6d408533de125bdea920fb1199f
Created April 6, 2019 00:42
ubuntu-16.04.3-lts-preseed.cfg
### Preseed for Ubuntu 16.04.3 LTS
# Derived from: https://help.ubuntu.com/lts/installation-guide/example-preseed.txt
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US.UTF8
d-i localechooser/supported-locales multiselect en_US.UTF-8
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap select GB