Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sebastian Webber sebastianwebber

🏠
Working from home
View GitHub Profile
@sebastianwebber
sebastianwebber / pg-notify-parallel.go
Last active Jan 31, 2023
postgres listen/notifiy with golang and `go-pg`
View pg-notify-parallel.go
package main
import (
"log"
"time"
"github.com/go-pg/pg"
)
const maxWorkers = 5
@sebastianwebber
sebastianwebber / readme.md
Created Jun 26, 2020
How to install buildah on ubuntu 20.04
View readme.md

install-buildah-ubuntu-20.04.md

. /etc/os-release
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo apt-get update -qq
sudo apt-get -qq -y install buildah
``
@sebastianwebber
sebastianwebber / README.md
Last active Dec 19, 2022
Compilation of the Uber Facts on PostgreSQL to MySQL Migration
View README.md

Uber facts

Original posts/information

Migrating Uber from MySQL to PostgreSQL

Key points

  • ~50GB MySQL Application
  • Main motivation: PostGis
  • Migration made with a custom tool(xml2pgcopy) and mysqldump on 45min
@sebastianwebber
sebastianwebber / README.md
Last active Jul 14, 2022
enable arm support for docker in fedora 36 on x86_64 machines
View README.md
@sebastianwebber
sebastianwebber / create-ec2-instance-playbook.yml
Last active May 13, 2022
Create a EC2 instance with ansible-playbook
View create-ec2-instance-playbook.yml
---
- hosts: localhost
connection: local
vars:
gather_facts: False
vars:
keypair: "my-keypair-name"
instance_type: m4.large
security_group:
- "vpc-group-1"
@sebastianwebber
sebastianwebber / README.md
Last active Oct 30, 2021
9.3.5 build on centos 7
View README.md

9.3 build on centos 7

Dependencies

yum install -y wget systemtap-sdt-devel gcc make bison flex perl-devel perl-ExtUtils-Embed readline-devel zlib-devel python-devel openssl-devel pam-devel libxml2-devel libxslt-devel openldap-devel tcl-devel

compiling

@sebastianwebber
sebastianwebber / docker-compose.yml
Last active Oct 10, 2021
basic docker-compose for grafana and prometheus
View docker-compose.yml
version: '3.1'
volumes:
prometheus_data: {}
grafana_data: {}
services:
prometheus:
image: prom/prometheus
volumes:
@sebastianwebber
sebastianwebber / pgsql-ssl.md
Last active Jun 24, 2021
Habilitar SSL no PostgreSQL
View pgsql-ssl.md

Habilitar SSL no PostgreSQL

Execute os procedimentos abaixo para habilitar SSL no seu servidor PostgreSQL.

  1. Crie um diretório para armazenar as configurações (opcional)
mkdir certificados
cd certificados
View pg_cleanup_oldmorethan_30days.sh
#!/bin/bash
ARCHIVEDIR='/var/lib/pgsql/wal_archive'
LAST_BACKUP=$(ls -lto ${ARCHIVEDIR})
FILE_LIST=$(pg_archivecleanup -n "${ARCHIVEDIR}" "${LAST_BACKUP}")
## TEST FIRST
pg_archivecleanup -n "${ARCHIVEDIR}" "${LAST_BACKUP}" | find -type f -mmin +30 | xargs ls -lh
@sebastianwebber
sebastianwebber / benchmarks.sh
Last active Mar 29, 2021
Run benchmarks on postgres with pgbench
View benchmarks.sh
#!/bin/bash -ex
export PGBIN=/usr/pgsql-9.3/bin
export PGUSER=postgres
export PGDATABASE=bench
export DATADIR=/dados/pgbench
export CLUSTER_LOG=/tmp/benchmark.log
export TOTAL_CPUS=$(grep 'cpu cores' /proc/cpuinfo | uniq | awk '{print $NF}')