Skip to content

Instantly share code, notes, and snippets.

View lzecca78's full-sized avatar
🏠
Working from home

Luca Zecca lzecca78

🏠
Working from home
  • Pavia, Italy
  • 00:20 (UTC +02:00)
View GitHub Profile
@Nebulosa-Cat
Nebulosa-Cat / backrest notify.txt
Created March 22, 2024 06:49
Backrest Templet
## :construction_site: Task "{{ .Plan.Id }}"
### :chart_with_upwards_trend: Task overview
```
[Execut status]
✅ Succeed!
[Target Repo]
{{ .Repo.Id }}
[Snapshot ID]
{{ .SnapshotId }}
[Processing time]
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@lbernail
lbernail / ebsnvme-id
Created April 26, 2018 15:07
ebsnvme-id script
#!/usr/bin/env python2.7
# Copyright (C) 2017 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
@jalaziz
jalaziz / 70-ec2-nvme-devices.rules
Last active March 21, 2024 06:05
AWS EBS NVMe udev rules
# Copyright (C) 2006-2016 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
@jessereynolds
jessereynolds / 0-puppet-node-purging-via-api.md
Last active March 21, 2022 09:42
Puppet - Node Purging via APIs

Puppet Node Purging via API

When you're decomissioning a machine that has been managed by Puppet you may want to programatically clean up the node. There are two parts to this:

  • revoking and deleting the certificate of the node in Puppet's CA
  • deactivating the node in PuppetDB

The following should work for Puppet 4.x and Puppet DB 4.x (including Puppet Enterprise 2016.4.x, 2017.1.x, 2017.2.x).

I've used certificate based auth, and the examples are being run from the puppet master so make use of existing certificates for authentication. When run remotely the cacert, certificate and corresponding private key for authentication will need to be present.

@chrisberkhout
chrisberkhout / .bash_profile
Created January 25, 2017 14:33
Git aliases taken from oh-my-zsh's git plugin and translated to bash
# git aliases - taken from oh-my-zsh's git plugin and translated to bash
# https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
function git_current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
function git_current_repository() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
@charity
charity / variables.tf
Created May 19, 2016 18:29
top level terraform variables.tf
### these variables should be the same across all environments
# your aws secret key and access key should be in your env variables
provider "aws" {
region = "us-east-1"
}
variable "tf_s3_bucket" { default = "hound-terraform-state" }
variable "master_state_file" { default = "base.tfstate" }
variable "prod_state_file" { default = "production.tfstate" } # TODO: make init.sh use these variables
variable "staging_state_file" { default = "staging.tfstate" }
@philfreo
philfreo / bootstrap_instance.sh
Last active March 26, 2020 03:42
AWS User script to bootstrap any instance
#!/bin/bash -x
# User script to bootstrap any instance.
# This will set up, array, and format every instance storage
# drive present in the instance (if any)
#
# The disk format/layout is read from an EC2 tag "DiskLayout"
# (defined in the cloudformation templates) and it defaults to
# "raid0". Possible values are:
# * raidN: grabs all available instance storage drives, creates a
@vittee
vittee / parser_phperror.rb
Last active May 6, 2020 10:06
Simple Fluentd Parser Plugin for parsing PHP Error.
# vim: ts=2
#
require 'fluent/parser'
module Fluent
class TextParser
class PhpErrorParser < Parser
Plugin.register_parser('phperror', self)
config_param :xdebug, :bool, :default => false
@c0wfunk
c0wfunk / git-multi-status.sh
Created September 7, 2012 13:47 — forked from aroberts/git-multi-status.sh
Script for checking git status of many git repositories
#!/bin/bash
# usage: $0 source_dir [source_dir] ...
# where source_dir args are directories containing git repositories
red="\033[00;31m"
green="\033[00;32m"
yellow="\033[00;33m"
blue="\033[00;34m"
purple="\033[00;35m"