Skip to content

Instantly share code, notes, and snippets.

@ipedrazas
ipedrazas / index.css
Created June 12, 2020 17:59
Gitops training - vue.js
html, body {
margin: 0px;
}
h1{
background-color: #3a5e84;
color: white;
padding: 10;
margin-bottom: 20px;
}
@ipedrazas
ipedrazas / app.py
Created June 12, 2020 08:33
Gitops Training - python
from flask import Flask, jsonify, request
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/ip', methods=["GET"])
def ip():
@ipedrazas
ipedrazas / requirements.md
Created June 11, 2020 10:06
Training Requirements

Accounts

You will need valid accounts for the following systems:

Tools

During the training we will use the following tooling:

@ipedrazas
ipedrazas / awslogs-logrotate
Created July 14, 2015 09:50
awslogs logrotate conf
/var/log/awslogs.log {
daily
missingok
notifempty
size 50M
create 0600 root root
delaycompress
compress
rotate 4
postrotate
@ipedrazas
ipedrazas / rename.sh
Created May 18, 2020 08:48
Rename USB disk
# Source: https://help.ubuntu.com/community/RenameUSBDrive
sudo apt-get install ntfsprogs
sudo fdisk -l
sudo umount /dev/sda1
sudo ntfslabel /dev/sda1 usb_ext_6t
mount /dev/sda1 /media/usb/usb_ext_6t
-v=9 CURL command
-v=8 request and response body
-v=6 method and apipath
@ipedrazas
ipedrazas / app-checklist.md
Last active March 6, 2020 11:16
Kubernetes Applications checklist

Checklist: Application Readiness for Kubernetes

  • Not running latest
  • Readiness Checks
  • Liveness Checks
  • Metric/Telemetry instrumentation
  • Limits
  • Requests
  • Listen to signals (graceful shutdowns)
  • Labels
gcloud beta container --project "deployments-team-01" clusters create "storage-test" \
--zone "us-central1-c" \
--no-enable-basic-auth \
--cluster-version "1.14.10-gke.17" \
--machine-type "n1-standard-2" \
--image-type "COS" \
--disk-type "pd-standard" \
--disk-size "100" \
--metadata disable-legacy-endpoints=true \
--scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" \
@ipedrazas
ipedrazas / gist:5199d81f2a7bf0f8ed625369a8b3e777
Created February 28, 2020 18:08
Flux query to get alerts
from(bucket: "_monitoring") |>
range(start: -7d, stop: 1582912196) |>
filter(fn: (r) => r._measurement == "statuses" and r._field == "_message") |>
keep(columns: ["_time", "_value", "_check_id", "_check_name", "_level"]) |>
rename(columns: {"_time": "time", "_value": "message", "_check_id": "checkID", "_check_name": "checkName", "_level": "level"}) |>
group() |>
sort(columns: ["time"], desc: true) |>
limit(n: 100, offset: 0)
@ipedrazas
ipedrazas / gist:be069cdf333ee65eef3a
Created June 4, 2014 10:26
Creating a Self-Signed SSL Certificate
$ openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
...
$ openssl rsa -passin pass:x -in server.pass.key -out server.key
writing RSA key
$ rm server.pass.key
$ openssl req -new -key server.key -out server.csr
...
Country Name (2 letter code) [AU]:UK
State or Province Name (full name) [Some-State]:London
...