Skip to content

Instantly share code, notes, and snippets.

@rubendob
rubendob / aws_config_resources.txt
Created September 2, 2020 15:45
Found via https://summitroute.com/; Found by copying the HTML of https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html to a file and running: grep "AWS::" tmp.txt | grep -v "," | grep -v "\." | sed 's/.*AWS:/AWS:/' | sed 's/<.*//' | sort
AWS::ACM::Certificate
AWS::ApiGateway::RestApi
AWS::ApiGateway::Stage
AWS::ApiGatewayV2::Api
AWS::ApiGatewayV2::Stage
AWS::AutoScaling::AutoScalingGroup
AWS::AutoScaling::LaunchConfiguration
AWS::AutoScaling::ScalingPolicy
AWS::AutoScaling::ScheduledAction
AWS::CloudFormation::Stack
@rubendob
rubendob / cloudformation_resources.txt
Last active September 2, 2020 15:42
Found via:https://summitroute.com; git clone --depth=1 https://github.com/awsdocs/aws-cloudformation-user-guide.git; cd aws-cloudformation-user-guide; grep -h "# AWS::" doc_source/aws-* | sed 's/# //' | sed 's/<.*//' | sort | uniq
##AWS::ApiGateway::Method Dependency
AWS::ACMPCA::Certificate
AWS::ACMPCA::Certificate Validity
AWS::ACMPCA::CertificateAuthority
AWS::ACMPCA::CertificateAuthority CrlConfiguration
AWS::ACMPCA::CertificateAuthority RevocationConfiguration
AWS::ACMPCA::CertificateAuthority Subject
AWS::ACMPCA::CertificateAuthorityActivation
AWS::AccessAnalyzer::Analyzer
AWS::AccessAnalyzer::Analyzer ArchiveRule
@rubendob
rubendob / tag.yml
Last active September 2, 2020 16:09
CloudCustodian Tagging Simple Policy - How write simple policy, execute and report by command line
---
policies:
- name: ec2-tag-policy
resource: aws.ec2
filters:
- or:
- "tag:Project": absent
- "tag:Team": absent
@rubendob
rubendob / node_exporter init.d
Created September 6, 2018 09:42
Prometheus node exporter in Debian Wheezy
#!/bin/sh
### BEGIN INIT INFO
# Provides: node_exporter
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Should-Start: $all
# Should-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# remove previous installed package
sudo apt-get remove --purge ansible
# install pip
wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py --user
# install ansible
pip install ansible==2.5.0 --user
# update PATH
@rubendob
rubendob / fluentd_tcp_localhost_to_debug
Last active April 12, 2018 10:01
Local Fluentd to debug purposes - Ubuntu Xenial 16.04 TLS / fluent-plugin-kv-parser
sudo curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh config
sudo /usr/sbin/td-agent-gem install fluent-plugin-kv-parser
(edit config file, do backup first)
sudo cp /etc/td-agent/td-agent.conf /etc/td-agent/td-agent.conf.backup
echo "
<source>
@type tcp
tag kv_log # required
@rubendob
rubendob / gist:15fcfd8cd0ed1c47fbfc
Created February 23, 2016 08:53
mongo db backup script
#!/bin/sh
# MongoDB backup script
# This script is licensed under GNU GPL version 2.0 or above
# It makes a folder under BACKUP folder and compress it into .tar.gz.file
# Using another script we will remove older backups later
# ---------------------------------------------------------------------
### System Setup ###
BACKUP=""
@rubendob
rubendob / Vagrantfile
Created March 12, 2015 11:47
PXC-Ansible
-*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
cluster = {
"node1" => { :ip => "192.168.33.50", :cpus => 1, :mem => 1024 },
"node2" => { :ip => "192.168.33.51", :cpus => 1, :mem => 1024 },
"node3" => { :ip => "192.168.33.52", :cpus => 1, :mem => 1024 },
@rubendob
rubendob / varnish.conf
Created February 19, 2014 11:31
varnish for WP
backend default {
.host = "";
.port = "80";
.connect_timeout = 300s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 300s;
.max_connections = 512;
}
acl purge {
@rubendob
rubendob / httpd.conf - Plesk 10.X
Last active December 24, 2015 09:09
Httpd.conf Plesk 10.X
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 60
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 8
MinSpareServers 5