Skip to content

Instantly share code, notes, and snippets.

@phoe
phoe / forever.md
Last active February 22, 2024 23:50
Forever Stable Branch

Forever Stable Branch

Stable branch, I can see you in the stable branch
See you again, I see you again
In my dreams, in my dreams, in my dreams, in my dreams

Morning light, I remember the morning li-i-i-i-ight
Outside my door (outside my door), I'll see you no more (see you no more)
In my dreams, in my dreams, in my dreams, in my dreams
>

$accountid="<your AWS account ID>"
$bucketname="<your stage bucket>"
$bucketarn="<your stage bucket arn>"
$kmskeyarn="<you kms key arn if applicable>"
$prefix="" # can be used to add a prefix for more granular access e.g. "<prefix>/"
$snowflake_policy_doc=@"
{
"Version": "2012-10-17",
"Statement": [
{
# Source: https://gist.github.com/2f6ef41745fad5bf0d7c023c1261d77c
###########################################################################
# How To Shift Left Infrastructure Management Using Crossplane Composites #
# https://youtu.be/AtbS1u2j7po #
###########################################################################
# Referenced videos:
# - Crossplane - GitOps-based Infrastructure as Code through Kubernetes API: https://youtu.be/n8KjVmuHm7A
# - How to apply GitOps to everything - combining Argo CD and Crossplane: https://youtu.be/yrj4lmScKHQ
WITH
-- Selective billing data from billing export
billing_data AS (
SELECT
billing_account_id,
service,
sku,
usage_start_time,
usage_end_time,
STRUCT( coalesce(
#!/bin/bash
#
# renew-letsencrypt-certificates.sh DOMAIN [EMAIL]
#
# Copy Let's Encrypt SSL certs from a remote public facing web server to local filesystem
# Look for changes, if any change, restarts the web service
# Useful for using Let's Encrypt with local internal servers, with custom DNS.
# Working "mail" command needed for email alerts
#
@akskap
akskap / iam-policy-cross-account-bucket-access.json
Created May 22, 2020 14:18
IAM Policy Cross Account S3 Bucket Access
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "list-s3-resources",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<requester_acccount_id>:role/access-s3-objects"
},
"Resource": "arn:aws:s3:::my-test-bucket",
@zukko78
zukko78 / GCP Architect Part-1
Created May 13, 2020 03:22 — forked from j-mprabhakaran/GCP Architect Part-1
Google Certified Cloud Architect Part 1 Notes from Linux Academy
Google Certified Professional Cloud Architect - Part 1
======================================================
GCP Overview
Google's suite of cloud computing services; run on same infra and network as google
Compute -> App Engine, Container Engine, Compute Engine
Storage -> Bigtable, Cloud Storage, Cloud SQL, Cloud Datastore
Big Data -> BigQuery, Pub/Sub, Dataflow, Dataproc, Datalab
Machine Learning -> Vision API, Machine Learning, Speech API, Translation API
https://cloud.google.com/pricing
Per second pricing for instances;Private Global Fiber network;Live migration of VMs;Better performance;Industry leading security;access to innovative resources(Big data,ML)
@brentmcconnell
brentmcconnell / cert-manager.sh
Last active February 23, 2022 07:06
ExternalDNS on AKS
#!/bin/bash
set -e
K8S_CONTEXT=$(kubectl config current-context)
echo -e "K8S_CONTEXT: $K8S_CONTEXT\n"
# Verify if we want to proceed
read -p "Are you sure you want to install cert-manager [y/N]?"
if [[ ! "$REPLY" =~ ^[Yy]$ ]]; then
@eoinsha
eoinsha / template.yaml
Created March 12, 2020 07:12
EventBridge CloudTrail Data Events and S3 Notification SAM YAML
NotificationFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: handlers/
Handler: notification.handleS3Notification
Runtime: nodejs12.x
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution: