Skip to content

Instantly share code, notes, and snippets.

View RafPe's full-sized avatar
🎯
Focusing

Rafal Pieniazek RafPe

🎯
Focusing
View GitHub Profile
@RafPe
RafPe / jq-cheetsheet.md
Created September 10, 2022 21:27 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@RafPe
RafPe / nginx.conf
Created July 30, 2022 19:34 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@RafPe
RafPe / cloudflare-purge-cache-service-worker.js
Created November 18, 2021 12:41 — forked from vdbelt/cloudflare-purge-cache-service-worker.js
A CloudFlare service worker that proxies purge cache requests. Example: https://example.com/__purge_cache?zone=XX
addEventListener('fetch', event => {
event.respondWith(purgeCache(event.request))
})
async function purgeCache(request) {
const url = new URL(request.url)
@RafPe
RafPe / create-aws-console-user.sh
Created May 21, 2021 08:21 — forked from res0nat0r/create-aws-console-user.sh
Create AWS console user from the awscli
#!/bin/bash
# USAGE: ./create-aws-console-user.sh $GROUPNAME $USERNAME $PASSWORD
# http://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_cliwpsapi
# Create administrator group
aws iam create-group --group-name $1
@RafPe
RafPe / mutt_notes.markdown
Created March 25, 2021 07:21 — forked from markjlorenz/mutt_notes.markdown
Notes on getting Mutt running on OSX
  • brew install mutt
  • setup an app password for mutt in gmail
  • setup an app password for imap_notifier in gmail
  • brew install terminal-notifier terminal-notifier
  • gem install imap_notifier imap_notifier
  • brew install urlview
  • brew install w3m (links would be OK too)
  • Install pandoc to author in markdown and send as HTML

~/.muttrc

* CLI that tracks, analyzes, prioritizes, and warns of infrastructure drift (https://driftctl.com/)
* k8syaml - for online define of your manifests (https://k8syaml.com/)
* ytt - yaml templating tool (https://get-ytt.io/)
* kapp - control kubernetes resource changes during deploys (https://carvel.dev/kapp/)
* k9s - great console to manage your k8s (https://github.com/derailed/k9s)
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
@RafPe
RafPe / MailinatorAliases
Created October 15, 2020 15:37 — forked from nocturnalgeek/MailinatorAliases
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
// Package lfshook is hook for sirupsen/logrus that used for writing the logs to local files.
package lfshook
import (
"fmt"
"github.com/sirupsen/logrus"
"io"
"log"
"os"
"path/filepath"
@RafPe
RafPe / ca.md
Created January 8, 2020 10:53 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.