Skip to content

Instantly share code, notes, and snippets.

View anxo-outeiral's full-sized avatar
:octocat:
Hardcore will never die, but you will.

Anxo anxo-outeiral

:octocat:
Hardcore will never die, but you will.
View GitHub Profile
@magnetikonline
magnetikonline / README.md
Last active March 18, 2024 03:08
Remove existing AWS CloudFormation stack, but retain all managed resources.

Delete CloudFormation stack - retaining resources

A guide for removing an existing CloudFormation stack - but retaining all managed resources.

First step - we need to get the CloudFormation stack into a state of DELETE_FAILED. This can be achieve by attempting stack delete with an IAM role that only has IAM action rights to cloudformation:DeleteStack and cloudformation:DescribeStackResources.

Create a new temporary IAM role with only the following allowed policy actions:

{
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active May 6, 2024 19:22
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@outofcoffee
outofcoffee / find-ecr-image.sh
Last active March 1, 2024 13:35
Check if Docker image exists with tag in AWS ECR
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@keopx
keopx / settings.local.php
Last active March 25, 2024 12:22
Drupal 8 Redis settings.local.php
<?php
/**
* Set redis configuration.
*/
/** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */
if (extension_loaded('redis')) {
// Set Redis as the default backend for any cache bin not otherwise specified.
// $settings['cache']['default'] = 'cache.backend.redis';
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active May 7, 2024 00:47
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages