Skip to content

Instantly share code, notes, and snippets.

# k3d-config.yml
apiVersion: k3d.io/v1alpha3
kind: Simple
name: "mycluster"
servers: 1
agents: 2
kubeAPI:
hostIP: "0.0.0.0"
hostPort: "6443"
ports:
@svx
svx / imageCompression.sh
Created December 13, 2023 14:50 — forked from caubry/imageCompression.sh
Bash script using pngquant and jpegoptim library to compress PNG, JPG and JPEG, with batch compression as an option.
#!bin/bash
pwd=`pwd`
# Set the quality factor to 80
qualityCompression=80;
# Set a minimum quality factor to 20
qualityLimit=20;
# To run a new compression
second_run_compression=false;
# For batch compression
#!/bin/bash
# This script requires jq, a command line to to parse and format JSon.
# https://stedolan.github.io/jq/
function padBase64 {
STR=$1
MOD=$((${#STR}%4))
if [ $MOD -eq 1 ]; then
STR="${STR}="
@svx
svx / takeMultipleScreenshots.js
Created October 27, 2023 15:06 — forked from crevulus/takeMultipleScreenshots.js
A small script using puppeteer to get screenshots of multiple browser pages.
const puppeteer = require("puppeteer");
const pages = require("./webPages.json");
async function takeMultipleScreenshots() {
try {
const browser = await puppeteer.launch();
const page = await browser.newPage();
for (const { id, name, url } of pages) {
@svx
svx / README.md
Created February 15, 2023 15:40 — forked from ddtmachado/README.md
Traefik v2 to v3 parallel CRD migration

For this test I used k3d with the following start options:

k3d cluster create \
    "trk" \
    --agents 2 \
    --port="80:80@loadbalancer" \
    --port="443:443@loadbalancer" \
    --k3s-arg="--disable=traefik@server:0" \
    --image "rancher/k3s:v1.20.15-k3s1-amd64"
@svx
svx / traefik-redirect-path.md
Created January 17, 2023 10:08 — forked from kekru/traefik-redirect-path.md
Traefik redirect / (root) to sub path with Docker labels

Traefik: redirect base or root path to a subpath

This is tested with Traefik 1.7

This is how to redirect the root or base path to a sub path in Traefik using Docker labels:
Goals

  • https://example.com -> https://example.com/abc/xyz/
  • https://example.com/ -> https://example.com/abc/xyz/
  • https://example.com/something -> no redirect
@svx
svx / .gitignore
Created July 15, 2022 05:56 — forked from datakurre/.gitignore
Minimal Nix Docker
*.tar.gz
.sentinel.*
@svx
svx / harden.sh
Created July 14, 2022 10:15 — forked from yesoreyeram/harden.sh
hardening script for an alpine docker container
#!/bin/sh
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
#
# find: /proc/tty/driver: Permission denied
package main
import (
"fmt"
"os"
"strings"
"text/template"
)
func replace(a, b, c string, n int) string {
@svx
svx / Template-Developer-Survey.md
Created January 3, 2022 16:00 — forked from durbon/Template-Developer-Survey.md
Este listado de temas cubre un amplio abanico de asuntos que nos interesa evaluar dentro del equipo https://medium.com/@durbon/developer-survey-recopilando-la-opini%C3%B3n-de-los-desarrolladores-76384a0347bb

1. Development environment

  • How would you rate the development environment in team? (Use the [1-5] scale)
  • How would you rate the project Settings needed to start to work? (Use the [1-5] scale)
  • How would you rate documentation of the necessary tools? (Use the [1-5] scale)
  • How do you rate the team’s current onboarding process? (Use the [1-5] scale)
  • Do you think we have enough tools to work with? (Use the [1-5] scale)
  • What tools are you missing in order to be more productive at work?

2. Code

  • What is the level of satisfaction with the current codebase? (Use the [1-5] scale)