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
@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 / 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"

SOPS decryption for Kustomizations

Specification:

apiVersion: kustomize.toolkit.fluxcd.io/v1alpha1
kind: Kustomization
metadata:
  name: backend
spec:
apiVersion: v1
items:
- apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
creationTimestamp: "2023-04-13T13:12:31Z"
finalizers:
- finalizers.fluxcd.io
generation: 1
labels:
@stefanprodan
stefanprodan / Backup-Postgres.ps1
Last active March 22, 2023 04:28
PostgreSQL cluster base backup automation made easy with PowerShell and Windows Task Scheduler or PgAgent. This script does the following: checks if there is enough free space to make a new backup (based on the last backup size), purges expired backups, creates a new folder for each backup, calls pb_basebackup to begin a tar gzip backup of every…
#############################################
##
## PostgreSQL base backup automation
## Author: Stefan Prodan
## Date : 20 Oct 2014
## Company: VeriTech.io
#############################################
# path settings
$BackupRoot = 'C:\Database\Backup';
---
apiVersion: v1
kind: Service
metadata:
name: weave-gitops-external
namespace: flux-system
spec:
ports:
- name: http-web
port: 80

Can I automate container image updates in my fleet-repo?

Assuming an app repository with ./deploy/prod/kustomization.yaml:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - deployment.yaml
  - service.yaml
@stefanprodan
stefanprodan / Install-Postgres.psm1
Created October 20, 2014 12:04
PostgreSQL unattended install PowerShell module
#################################################################################
##
## PostgreSQL unattended install
## Author: Stefan Prodan
## Date : 16 Oct 2014
## Company: VeriTech.io
################################################################################
Function Install-Postgres
{

Bootstrap

Init:

gotk bootstrap github \
  --owner=gitopsrun \
  --repository=fleet-infra \
  --branch=main \
  --team=dev \
@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