Skip to content

Instantly share code, notes, and snippets.

@so0k
so0k / billing-budgets-cloudwatch.tf
Last active January 5, 2024 11:02
Swatmobile - AWS Bootstrap gists
resource "aws_budgets_budget" "cloudwatch" {
provider = "aws.billing"
name = "budget-cloudwatch-monthly"
budget_type = "COST"
limit_amount = "1000"
limit_unit = "USD"
time_period_end = "2087-06-15_00:00"
time_period_start = "2017-07-01_00:00"
time_unit = "MONTHLY"
@SarasaGunawardhana
SarasaGunawardhana / install-on-all-node.sh
Last active October 25, 2020 22:21
Prerequisites for Setup Kubenetes Cluster. You should install these things on each server.
#!/bin/bash
## Generic installation on all nodes
sysctl -w net.ipv4.ip_forward=1
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
swapoff -a
sed -i '2s/^/#/' /etc/fstab
# sniff hypervisor
dmesg | grep Hypervisor
[ 0.000000] Hypervisor detected: KVM
# get key in bytes
etcdctl get $key -w fields | grep -oP "(?<=Value\" : \").*" | wc -c
# defrag status in MB
cat etcd_info/endpoint_status.json | jq '(.[0].Status.dbSize - .[0].Status.dbSizeInUse)/1000/1000'
@redmcg
redmcg / kubedf
Last active May 5, 2025 22:26
Bash script to show k8s PVC usage
#!/usr/bin/env bash
NODESAPI=/api/v1/nodes
function getNodes() {
kubectl get --raw $NODESAPI | jq -r '.items[].metadata.name'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
version: '3.3'
services:
prometheus:
container_name: prometheus
image: prom/prometheus:v2.7.2
container_name: prometheus
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
version: '3.6'
services:
elasticsearch: &service
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:6.7.1
# deploy:
# mode: global
# restart_policy:
# condition: on-failure
@j-mprabhakaran
j-mprabhakaran / GCP-Architect-QuickNotes
Created March 30, 2019 05:39
GCP-Architect-QuickNotes
The access pattern fits Nearline storage class requirements and Nearline is a more cost-effective storage approach than Multi-Regional.
The object lifecycle management policy to delete data is correct versus changing the storage class to Coldline.
Google Cloud Storage supports Multi-Regional buckets that synchronize data across regions automatically.
Google Cloud SQL instances are deployed within a single region.
Google Cloud Bigtable data is stored within a single region.
Google Cloud Datastore is stored within a single region.
Using a shared VPC allows each team to individually manage their own application resources, while enabling each application to communicate
between each other securely over RFC1918 address space.
@j-mprabhakaran
j-mprabhakaran / gist:2993ea834bb54b2e03bcb64d0034f5a5
Created January 20, 2019 10:24
GCP Cloud Architect - Part 3
GCP Cloud Architect - Part 3
Case Studies
Refreshed Nov 9th 2018; JencoMart completely dropped
Overview - 3 case studies; 40-50% on the exam; Question on one side, Case study on other side
Layout of Case study - 1.Company Overview 2.Solution concept - current goal 3.Existing Technical Env 4.Requirements(Tech/Business) 5.Executive statement
Mountkirk Games
Dress4Win
TerramEarth
Mountkirk Games
Dataflow lifecycle
migration concerns from migrating from on-premises over into google cloud
code snippet to troubleshoot and diagnose
Part 2 - Hands-on with tools
Role of Cloud Architect
plans, designs and builds the infrastructure for an org to host their workload on GCP; able to plan to scale;
scalability and automation
@j-mprabhakaran
j-mprabhakaran / GCP Architect Part-1
Created January 16, 2019 12:50
Google Certified Cloud Architect Part 1 Notes from Linux Academy
Google Certified Professional Cloud Architect - Part 1
======================================================
GCP Overview
Google's suite of cloud computing services; run on same infra and network as google
Compute -> App Engine, Container Engine, Compute Engine
Storage -> Bigtable, Cloud Storage, Cloud SQL, Cloud Datastore
Big Data -> BigQuery, Pub/Sub, Dataflow, Dataproc, Datalab
Machine Learning -> Vision API, Machine Learning, Speech API, Translation API
https://cloud.google.com/pricing
Per second pricing for instances;Private Global Fiber network;Live migration of VMs;Better performance;Industry leading security;access to innovative resources(Big data,ML)