Skip to content

Instantly share code, notes, and snippets.

View fvoges's full-sized avatar
:octocat:

Federico Voges fvoges

:octocat:
View GitHub Profile
@fvoges
fvoges / tsm_make_group.rb
Last active December 14, 2020 19:03
Script to create a TSM (WoW addon) group from a wowhead.com URL
#!/usr/bin/env ruby
# Usage:
#
# Go to wowhead.com and create an item list, for example:
# https://www.wowhead.com/items/trade-goods?filter=87:166;11:1;0:0
#
# Once you're happy with the list, copy the URL from your browser
# and pass the URL as a parameter to this script.
#
# The script will, hopefully, extract the list of items, and then it
@fvoges
fvoges / script-template.sh
Created December 26, 2020 03:55 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@fvoges
fvoges / scanner.sh
Created May 17, 2021 08:12 — forked from andyrbell/scanner.sh
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@fvoges
fvoges / backup_chrome_extensions_settings.sh
Created July 22, 2021 16:18
Backup Chrome extensions (including settings) - macOS only
#!/bin/bash
BACKUP_DIR="${HOME}/.chrome_extension_settings_backup"
DATE=$(date +%F)
BACKUP_FILE="${BACKUP_DIR}/extension_settings-${DATE}.tar.gz"
mkdir -p "${BACKUP_DIR}"
cd "${HOME}"
@fvoges
fvoges / vault_logrotate.conf
Last active May 4, 2022 19:31
logrotate configuration for HashiCorp Vault
# This file would normally be /etc/logrotate.d/vault.conf
# With these settings, your audit folder will like
# .
# ├── audit.2018-09-10.log.gz
# ├── audit.2018-09-11.log
# └── audit.log
# Change the path below to your own audit log path.
/var/log/vault/audit.log {
{
"interfaces": {
"ethernet": {
"eth0": {
"address": [
"10.0.0.1/29",
"10.0.0.2/29"
],
"firewall": {
"in": {
@fvoges
fvoges / README.md
Last active March 12, 2022 09:05
Docker clean up

How to clean up Docker files

Sauce: https://linuxhint.com/cleanup-docker/

#!/bin/bash
docker ps -a -f status=exited -q | xargs -r docker rm
docker image prune -f
docker volume ls -f dangling=true -q | xargs -r docker volume rm
@fvoges
fvoges / retrieve_puppet_ca_cert.sh
Last active November 13, 2021 13:43
Retrieve Puppet CA cert and install it locally
#!/bin/bash
MASTER="$(puppet config print server)"
CA_DIR="/usr/local/share/ca-certificates"
curl -kv "https://$MASTER:8140/puppet-ca/v1/certificate/ca?environment=production&fail_on_404=true"|tee $CA_DIR/$MASTER.crt
openssl x509 -in $CA_DIR/$MASTER.crt -noout -subject -startdate -enddate
cp $CA_DIR/$MASTER.crt /etc/puppetlabs/puppet/ssl/certs/ca.pem
update-ca-certificates
@fvoges
fvoges / vault_admin_policy.hcl
Created November 29, 2021 16:15
Vault Admin Policy
# Read system health check
path "acme/*" {
capabilities = ["create", "read", "update", "delete", "list"]
}
# Read system health check
path "sys/health" {
capabilities = ["read", "sudo"]
}
@fvoges
fvoges / Vault ansible playbook
Created March 28, 2022 12:46
Vault Ansible playbook
---
# common values in inventory/group_vars/all.yaml
- hosts: vault_do
become: true
roles:
- role: ansible-role-vault
vars:
vault_ansible_group: 'vault_do'
vault_tls_leader_servername: 'vault.local'
vault_cluster_name: vault-primary