Skip to content

Instantly share code, notes, and snippets.

View elmariofredo's full-sized avatar
💭
building Cloud Native Thermostat 🔥 🥶

Mario Vejlupek elmariofredo

💭
building Cloud Native Thermostat 🔥 🥶
View GitHub Profile
@elmariofredo
elmariofredo / error_page.configmap.yaml
Last active January 16, 2022 02:18
Custom Kubernetes ingress nginx error page
apiVersion: v1
kind: ConfigMap
metadata:
name: error_page
namespace: ingress-nginx
data:
error_page: |
<!DOCTYPE html>
<html>
<head>
locals {
task_definition_family = "${local.prefix}-${var.ecs_task_name}"
}
data "aws_region" "current" {}
data "aws_caller_identity" "current" {}
data "aws_ecs_task_definition" "hack_get_image" {
count = var.preserve_image ? 1 : 0
task_definition = local.task_definition_family
@elmariofredo
elmariofredo / chromeicon.sh
Last active October 12, 2021 10:15
Google Chrome.app custom icon
#!/bin/bash
cp $HOME/Library/Mobile\ Documents/com\~apple\~CloudDocs/Icons/Google\ Chrome /Applications/Google\ Chrome.app/Icon$'\r'
osascript <<EOS
set appName to "Google Chrome"
tell application appName to quit
repeat
tell application "System Events"
if appName is not in (name of application processes) then exit repeat
@elmariofredo
elmariofredo / dnsutils.yaml
Created March 24, 2020 11:35
K8s debug pods
apiVersion: v1
kind: Pod
metadata:
name: dnsutils
namespace: default
spec:
containers:
- name: dnsutils
image: gcr.io/kubernetes-e2e-test-images/dnsutils:1.3
command:
@elmariofredo
elmariofredo / db
Last active January 19, 2022 08:42
Docker run and docker build simplified
#!/bin/bash
if [ -z "$1" ]
then
IMAGE=image
else
IMAGE=$1
fi
WORK_DIR=$(docker image inspect ${IMAGE} --format='{{.Config.WorkingDir}}')
  1. Observability -> Collect all data to be able to observe all events market/users/profit.
  2. Focus -> Give everybody some timeframe (min 1h) to focus on specific thing, don't switch focus unless really necessary thus create perfect task queues with priorities.
  3. Ownership -> Give e2e ownership dev/test/ops/appsupport.
  4. Human -> Always remember that humans are great for their errors because our creativity is based on it.
  5. Re(spect/ward) -> Respect and Reward work.
@elmariofredo
elmariofredo / .ansible.cfg
Created December 7, 2017 12:52
Dot files
# cat ~/.ansible.cfg
[defaults]
stdout_callback = debug
retry_files_enabled = False
@elmariofredo
elmariofredo / supaclone
Created November 29, 2017 23:49
Cloning github/gitlab/copanyhub in consistent way
#!/usr/bin/env python
import sys, subprocess, os
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
rawRepoUrl = sys.argv[1]
@elmariofredo
elmariofredo / measure.sh
Last active October 4, 2017 12:34
Simple http throughput test using curl
#!/bin/bash
URL=$1
NAME=${URL:7}
echo "Press [CTRL+C] to stop..."
while :
do
echo $(date +%s) $(curl --max-time 10 -w "%{time_connect} %{time_starttransfer} %{time_total} %{http_code}" -o NUL -s "${URL}") | tee -a ${NAME}.log.txt
@elmariofredo
elmariofredo / docker-compose.yml
Created August 8, 2017 15:39
Test compose file
version: "3"
services:
web:
image: nginx