Skip to content

Instantly share code, notes, and snippets.

View stefanprodan's full-sized avatar
🎯
Hacking on @fluxcd and timoni.sh

Stefan Prodan stefanprodan

🎯
Hacking on @fluxcd and timoni.sh
View GitHub Profile
#!/bin/bash
set -e
GVERSION="1.7"
GFILE="go$GVERSION.linux-amd64.tar.gz"
GOPATH="$HOME/go"
GOROOT="/usr/local/go"
if [ -d $GOROOT ]; then
echo "Installation directories already exist $GOROOT"
set -e
sudo true
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo sh -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" > /etc/apt/sources.list.d/docker.list'
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-cache policy docker-engine
@stefanprodan
stefanprodan / get_incidents_csv.py
Created February 28, 2017 07:58 — forked from lfepp/get_incidents_csv.py
Sample script to output all PagerDuty incidents for a given time period to a CSV file (defaults to previous 24 hours)
#!/usr/bin/env python
#
# Copyright (c) 2016, PagerDuty, Inc. <info@pagerduty.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@stefanprodan
stefanprodan / go-ssh-encrypted-pem.go
Created April 10, 2017 10:37
Using golang ssh client with an encrypted private key
package main
import (
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"golang.org/x/crypto/ssh"
"io/ioutil"
"net"
@stefanprodan
stefanprodan / sensu-check-netstat.rb
Created April 29, 2017 14:12
Sensu netstat check with retry/wait capabilities
#! /usr/bin/env ruby
#
# check-netstat
#
# DESCRIPTION:
# Takes an IP and checks for established connections
#
# OUTPUT:
# plain text
#

Keybase proof

I hereby claim:

  • I am stefanprodan on github.
  • I am stefanprodan (https://keybase.io/stefanprodan) on keybase.
  • I have a public key ASBAfWbNJNEZd2c_Ysg8rLfwbLtPMHEgDj67cWvUIshY-Ao

To claim this, I am signing this object:

@stefanprodan
stefanprodan / caddy-cfg.yaml
Last active February 16, 2024 19:51
Caddy K8s TLS
kind: ConfigMap
apiVersion: v1
metadata:
name: caddy-config
namespace: openfaas
labels:
app: caddy
data:
Caddyfile: |
sub.mydomain.com {
@stefanprodan
stefanprodan / alert-rules.yaml
Last active January 8, 2020 05:17
prom-alerts
apiVersion: alerting.cloud.weave.works/v1
kind: PrometheusRule
metadata:
name: node-rules
spec:
groups:
- name: node-alerts
rules:
- alert: NodeDown
expr: up{job="kubernetes-nodes"} == 0
@stefanprodan
stefanprodan / certinfo.yaml
Last active October 1, 2018 06:33
OpenFaaS GKE
apiVersion: openfaas.com/v1alpha2
kind: Function
metadata:
name: certinfo
spec:
name: certinfo
image: stefanprodan/certinfo:latest
labels:
com.openfaas.scale.min: "2"
com.openfaas.scale.max: "12"

GKE Istio add-on issues

Cluster spec:

gcloud beta container --project "dx-stefan" clusters create "istio-eu" --zone "europe-west3-a" \
--cluster-version "1.11.6-gke.6" --machine-type "n1-standard-2" --image-type "COS" \
--no-enable-basic-auth --disk-type "pd-standard" --disk-size "50" \
--num-nodes "1" --additional-zones "europe-west3-a","europe-west3-b" \
--no-enable-cloud-logging --enable-cloud-monitoring \