Skip to content

Instantly share code, notes, and snippets.

View ronamosa's full-sized avatar

Ron Amosa ronamosa

View GitHub Profile
@ronamosa
ronamosa / cli.txt
Last active December 9, 2017 09:34
handy command line snippets
# description:
# inserts a new field after an existing field in a yaml file
# scenario:
# needed to add "comments: true" to all my github page blog posts (*.md)
# explain:
# -i = edit file in place
# -e = regex
# 's = substitute
# find this "/published\:\ true/"
# replace with this "/published\:\ true/"
#!/usr/bin/env bash
# description: lists EC2 instances in ALL regions.
# credit: https://github.com/aws/aws-cli/issues/1777
for region in `aws ec2 describe-regions --query Regions[*].[RegionName] --output text`
do
echo -e "\nListing Instances in region:'$region'..."
aws ec2 describe-instances --region $region
done
#!/usr/bin/env bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker
@ronamosa
ronamosa / sonarqube-pv.yaml
Last active August 9, 2019 10:53
SonarQube persistentVolume.yaml
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-{{ template "sonarqube.name" . }}-data
labels:
app: {{ template "sonarqube.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
@ronamosa
ronamosa / postgresql-pv.yaml
Created August 9, 2019 10:53
PostgreSQL persistentVolume.yaml
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-{{ template "postgresql.name" . }}-data
labels:
app: {{ template "postgresql.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
#!/usr/bin/env bash
# stolen from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-apt?view=azure-cli-latest
# "run it straight".
# get updates, add required
sudo apt-get update -y
sudo apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg
# grab M$ keys
curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
apiVersion: v1
kind: Service
metadata:
name: {{ include "www-demo.fullname" . }}
labels:
{{ include "www-demo.labels" . | indent 4 }}
annotations:
getambassador.io/config: |
---
apiVersion: ambassador/v1
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: bookinfo-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
}
http {
# custom log format to show good debugging information.