Skip to content

Instantly share code, notes, and snippets.

@jmrobles
jmrobles / pact-broker.yml
Created December 14, 2022 09:14
Pact Broker K8S ConfigMap + Secret + Deployment + Service
kind: ConfigMap
apiVersion: v1
metadata:
name: pact-broker-cm
namespace: pact
data:
PACT_BROKER_PORT: '9292'
PACT_BROKER_LOG_LEVEL: INFO
PACT_BROKER_SQL_LOG_LEVEL: DEBUG
PACT_BROKER_DATABASE_CONNECT_MAX_TRIES: "5"
import serial, time, sys
import subprocess
import argparse
import serials_find
def dbg_print(line=''):
sys.stdout.write(line + '\n')
sys.stdout.flush()
try:
@jmrobles
jmrobles / mastodon-bucket-policy.json
Created November 14, 2022 09:04
AWS S3/Minio Bucket policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": ["*"]
},
"Action": ["s3:GetBucketLocation", "s3:ListBucket"],
"Resource": ["arn:aws:s3:::mastodon"]
@jmrobles
jmrobles / mastodon-ingress.yaml
Created November 13, 2022 20:00
Mastodon K8S ingress
apiVersion: v1
kind: Service
metadata:
name: mastodon-svc
namespace: mastodon
spec:
selector:
app: mastodon
type: ClusterIP
ports:
@jmrobles
jmrobles / mastodon-deployment.yaml
Created November 13, 2022 19:43
Mastodon K8S Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: mastodon
namespace: mastodon
labels:
app: mastodon
spec:
selector:
matchLabels:
@jmrobles
jmrobles / mastodon-secrets.yaml
Created November 13, 2022 19:27
Mastodon K8S secrets
apiVersion: v1
kind: Secret
metadata:
name: mastodon-secrets
namespace: mastodon
type: Opaque
data:
# Postgres
DB_PASS: <DB_PASS_B64>
# Secrets
@jmrobles
jmrobles / mastodon-config.yaml
Created November 13, 2022 19:23
Mastodon K8S Config
kind: ConfigMap
apiVersion: v1
metadata:
name: mastodon-config
namespace: mastodon
data:
# Main settings
LOCAL_DOMAIN: example.com
WEB_DOMAIN: mastodon.example.com
@jmrobles
jmrobles / fpgawars-alhambra2-litex-howto.md
Last active October 27, 2022 20:39
How to create a LiteX SoC in Alhambra 2 FPGA

Litex on FPGAWars Alhambra II

Motivation

Litex is an awesome project that allow us to create SoC on FPGA using Python! (yeah, Python is eating the software).

On the other hand, Alhambra II is one of the first open hardware based on the famous Lattice ICE40 FPGA family.

image

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
CloudWatch Alarm Test
Resources:
ErrorProcessedFiles:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmDescription: "Number of errors in processed PDF files pass the threshold in one hour"
<source>
@type http
@id input1
@label @mainstream
port 9880
bind 0.0.0.0
body_size_limit 32m
keepalive_timeout 10s
</source>