Skip to content

Instantly share code, notes, and snippets.

View y0zg's full-sized avatar
☸️
what's up

y0zg

☸️
what's up
View GitHub Profile
@y0zg
y0zg / aws_iam_secret_to_smtp_password.md
Created January 10, 2022 23:15 — forked from damusix/aws_iam_secret_to_smtp_password.md
Convert AWS IAM credentials to AWS SMTP credentials

Convert AWS IAM credentials to AWS SMTP credentials

If you do, or want to, use AWS to deploy your apps, you will end up using AWS SES via SMTP when you're launching an app that sends out emails of any kind (user registrations, email notifications, etc). For example, I have used this configuration on various Ruby on Rails apps, however, it is just basic SMTP configurations and crosses over to any framework that supports SMTP sendmail.

There are two ways to go about this:

Luckily, you found this MD file and the NOT SO EASY WAY is suddenly copy-pasta... sudo yum....

@y0zg
y0zg / monzo-alertmanager-config.yaml
Created June 30, 2021 12:22 — forked from chromko/monzo-alertmanager-config.yaml
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@y0zg
y0zg / 52-ec2-xen-vbd-devices.rules
Created November 12, 2020 23:37 — forked from bmoyles/52-ec2-xen-vbd-devices.rules
ec2 vbd and NVMe udev rules and helpers
# ensure any xen virtual block devices named xvdN get a sdN symlink for consistency
KERNEL=="xvd*", PROGRAM="/sbin/ec2udev-vbd %k", SYMLINK+="%c"
#!/bin/bash
set -euo pipefail
ARGS=( "${@:1}" )
HELLOWORLD_CTX="${ARGS[0]}"
OTHER_CTX="${ARGS[1]}"
function deleteNamespace()
{
@y0zg
y0zg / envoy-filter.yaml
Created August 17, 2020 23:35 — forked from inaiat/envoy-filter.yaml
Setting request headers with values from a JWT
apiVersion: "security.istio.io/v1beta1"
kind: RequestAuthentication
metadata:
name: echoserver
namespace: default
spec:
selector:
matchLabels:
app: echoserver
jwtRules:
@y0zg
y0zg / monzo-alertmanager-config.yaml
Created May 6, 2020 13:32 — forked from milesbxf/monzo-alertmanager-config.yaml
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: authn-filter
namespace: ns1
spec:
workloadLabels:
#include namespace in the label to avoid clashes across namespaces
authn-ns1: enabled
filters:
@y0zg
y0zg / install.sh
Created October 29, 2017 13:16 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
public static String getFileExtension(String path) {
int lastIndex = path.lastIndexOf(".");
if (lastIndex != -1) {
return path.substring(lastIndex + 1);
} else {
return "";
}
}
@y0zg
y0zg / gist:9a5e4c36c70044cec591
Created March 13, 2016 15:19
static factory methods
package com.db;
import java.time.LocalDate;
import java.util.Scanner;
public class meth {
public static void main(String arg[]) {