Skip to content

Instantly share code, notes, and snippets.

@fragolinux
fragolinux / pritunl-cli.sh
Last active June 12, 2023 10:05
pritunl-cli
# prerequisiti:
# avere una chiave gpg da usare per crittografare il proprio portachiavi gopass...
# install gopass via asdf
asdf plugin add gopass
asdf install gopass 1.15.5
asdf global gopass 1.15.5
# creazione portachiavi gopass
gopass setup
@fragolinux
fragolinux / touchid_sudo.sh
Last active July 18, 2022 09:40 — forked from RichardBronosky/touchid_sudo.sh
Use TouchID for sudo on modern MacBook Pro machines
#!/bin/bash
# curl -sL https://gist.githubusercontent.com/fragolinux/e5637fb30d82d6bc0b3b28309be2c1b8/raw/touchid_sudo.sh | bash
# This script is ready to copy-paste in whole, or just the line above (without the leading #)
# Use TouchID for sudo on modern MacBook Pro machines
# This script adds a single line to the top of the PAM configuration for sudo
# See: https://apple.stackexchange.com/q/259093/41827 for more info.
touchid_sudo(){
@fragolinux
fragolinux / k8s_add_user_clusterrole.sh
Last active April 15, 2022 20:01
adds a new user to k8s cluster as clusterrole admin/edit/view and creates kubeconfig
#!/usr/bin/env bash
# shellcheck disable=2155
GREEN="\033[0;32m"
RED="\033[0;31m"
COLOR_RESET="\033[0m"
echog(){
echo;echo;echo -e "### ${GREEN}${1}${COLOR_RESET} ###"
}
@fragolinux
fragolinux / k3d_local_git.sh
Last active April 18, 2023 14:47
complete setup of a local k3d cluster on macos with flux enabled on local git server
#!/usr/bin/env bash
set -m # enable job control
## run with "-d" command line switch to debug each step, script will wait for keypress to go on
## integrated mods by KingdonB in his fork: https://gist.github.com/kingdonb/dec74f3b74ffbb83b54d53d5c033e508
## added proper coredns patching via "coredns-custom" configmap
## added automatic /etc/hosts file modification if needed, sudo password will be asked in case
## added (commented out) lines to add Flux extra controllers to the setup
## deployed podinfo as in Flux Get Started guide
@fragolinux
fragolinux / velero-csi-plugin-demo.md
Created July 15, 2021 09:20 — forked from ashish-amarnath/velero-csi-plugin-demo.md
This gist is a follow-up to the CSI Integration blog post on the Velero website.

This gist is a follow-up to the CSI Integration blog post on the Velero website. Updates here include:

  1. Using v0.1.2 release of velero-plugin-for-csi
  2. Using [v1.1.1 release of velero-plugin-for-microsoft-azure](https://github.com/vmware-tanzu/velero-plugin-for-microsoft-azure/releases/tag/v1.1.1)
  3. Using v1.5.2 release of Velero

Below are the updated set of instructions to

  1. Create AKS cluster with kubernetes version v1.17 or later. In this example an AKS cluster running v1.18.6 is used.
  2. Install CSI driver
@fragolinux
fragolinux / plugin.yml
Last active April 14, 2023 08:16
K9s plugin to toggle helmreleases/kustomizations suspend/resume and to reconcile git sources/helmreleases/kustomizations
# $XDG_CONFIG_HOME/k9s/plugin.yml
# check your env, XDG_CONFIG_HOME should be defined as ~/.config
# move selected line to chosen resource in K9s, then:
# Shift-T (with confirmation) to toggle helm releases or kustomizations suspend and resume
# Shift-R (no confirmation) to reconcile a git source or a helm release or a kustomization
plugin:
toggle-helmrelease:
shortCut: Shift-T
confirm: true
scopes:
@fragolinux
fragolinux / disable_direnv.sh
Last active February 5, 2021 11:26
direnv disabler script, inspired by "basher" uninstall script
#!/usr/bin/env bash
## direnv disabler script, inspired by "basher" uninstall script
# shellcheck disable=SC2034
die() {
echo "!! $1 " >&2
echo "!! -----------------------------" >&2
exit 1
}
@fragolinux
fragolinux / enable_direnv.sh
Created February 5, 2021 10:48
direnv enabler script, inspired by "basher" install script
#!/usr/bin/env bash
## direnv enabler script, inspired by "basher" install script
die() {
echo "!! $1 " >&2
echo "!! -----------------------------" >&2
exit 1
}
## stop if direnv is not installed
@fragolinux
fragolinux / gist:2bf4212f5f285132191ca685a01954e0
Created June 25, 2020 08:02
Latest Tasmota DEV version and changelog in Home Assistant card
a couple of sensors and a lovelace card to show latest tasmota info in HA
if you don't like the colors, change them in the CSS code at line 14 :-)
------------- in configuration.yaml -------------
# Sensors
sensor:
- platform: command_line
name: Tasmota Dev
command: 'curl -s https://raw.githubusercontent.com/arendst/Tasmota/development/tasmota/CHANGELOG.md|grep -m 1 "###"|cut -c 5-|cut -d\ -f1'
scan_interval: 3600
# note: the following sensor will not produce output in HA itself, but creates a local file which will be included in a custom lovelace card
@fragolinux
fragolinux / gist:447cfe1193b7ac8178f22d352d03bd39
Created June 21, 2020 19:24
Speech Script by Dan Fountain
#!/bin/bash
#################################
# Speech Script by Dan Fountain #
# TalkToDanF@gmail.com #
#################################
INPUT=$*
STRINGNUM=0