Skip to content

Instantly share code, notes, and snippets.

@kainlite
kainlite / migrations_in_console_cheatsheet.exs
Created March 4, 2024 18:17 — forked from pmarreck/migrations_in_console_cheatsheet.exs
How to run Ecto migrations in Elixir/Phoenix from an `iex -S mix` or production console
# How to run Ecto migrations from IEx console... Examples
# preliminaries assumed in the following code, change to fit your environment:
alias YourAppName.Repo
your_app_name_as_atom = :mpnetwork
downto_version = 20170724182558
# Down:
Ecto.Migrator.run(Repo, "priv/repo/migrations/", :down, [to: downto_version])
@kainlite
kainlite / tekton-cleanup.yaml
Created March 4, 2024 16:03 — forked from ctron/tekton-cleanup.yaml
Cleaning up Tekton pipeline runs
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cleaner
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: cleaner
@kainlite
kainlite / k3s-etcd-commands.md
Created February 25, 2024 22:44 — forked from superseb/k3s-etcd-commands.md
k3s etcd commands

k3s etcd commands

etcd

Setup etcdctl using the instructions at https://github.com/etcd-io/etcd/releases/tag/v3.4.13 (changed path to /usr/local/bin):

Note: if you want to match th etcdctl binaries with the embedded k3s etcd version, please run the curl command for getting the version first and adjust ETCD_VER below accordingly:

curl -L --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/server-client.crt --key /var/lib/rancher/k3s/server/tls/etcd/server-client.key https://127.0.0.1:2379/version
@kainlite
kainlite / dnsovertls.md
Created January 27, 2023 21:15 — forked from uraimo/dnsovertls.md
Configure your Mac to use DNS over TLS
@kainlite
kainlite / README.md
Created August 7, 2022 18:24 — forked from tivrfoa/README.md
rust-analyzer with neovim for the Linux Kernel - Rust for Linux
@kainlite
kainlite / MappingTest.sol
Created February 5, 2021 00:49 — forked from samanshahmohamadi/MappingTest.sol
How to return whole mapping in solidity
pragma solidity ^0.4.25;
contract MappingTest {
mapping(uint=>address) public addresses;
uint addressRegistryCount;
function set(address userAddress) public{
addresses[addressRegistryCount] = userAddress;
addressRegistryCount++;
}
@kainlite
kainlite / deploy.md
Created December 1, 2020 16:33 — forked from hayderimran7/deploy.md
Automatically deploy GoDaddy External Secrets Controller for SSM/Secrets Manager in K8s with IAM role for service account
#!/bin/bash -xe
## SET BASIC VARIABLES
EKS_CLUSTER="dev-cluster"
IAM_ROLE_NAME=eksctl-$EKS_CLUSTER-iamserviceaccount-role
EXTERNAL_SECRETS_POLICY="kube-external-secrets"
#### CREATE POLICY TO ACCESS SSM/Secrets Manager
cat << EOF > policy.json
{
@kainlite
kainlite / main.go
Created November 8, 2020 06:35 — forked from ncdc/main.go
Simple Kubernetes client-go example code
package main
import (
"flag"
"fmt"
"os"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"

Aligning images

left alignment

This is the code you need to align images to the left:

@kainlite
kainlite / auth.json
Created September 8, 2019 16:59 — forked from miguelmota/auth.json
AWS Cognito Identity authenticate using cURL
{
"AuthParameters" : {
"USERNAME" : "alice@example.com",
"PASSWORD" : "mysecret"
},
"AuthFlow" : "USER_PASSWORD_AUTH",
"ClientId" : "9..............."
}