Skip to content

Instantly share code, notes, and snippets.

@svx
svx / Convert .mov or .MP4 to .gif.md
Created February 24, 2025 09:28 — forked from SheldonWangRJT/Convert .mov or .MP4 to .gif.md
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

# 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 {