Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sebastian Webber sebastianwebber

🏠
Working from home
View GitHub Profile
@sebastianwebber
sebastianwebber / benchmarks.sh
Last active Jul 12, 2020
Run benchmarks on postgres with pgbench
View benchmarks.sh
#!/bin/bash -e
export PGBIN=/usr/pgsql-9.3/bin
export PGUSER=postgres
export PGDATABASE=bench
export DATADIR=/dados/pgbench
export CLUSTER_LOG=/tmp/benchmark.log
## https://www.enterprisedb.com/blog/pgbench-performance-benchmark-postgresql-12-and-edb-advanced-server-12
@sebastianwebber
sebastianwebber / README.md
Last active Jul 1, 2020
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 / 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 / docker-compose.yml
Last active Jun 13, 2020
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:
View keybase.md

Keybase proof

I hereby claim:

  • I am sebastianwebber on github.
  • I am sebawebber (https://keybase.io/sebawebber) on keybase.
  • I have a public key ASAVnC1vicYp9QJrHT8KelRyeM740ej76ZUqnzdOXWYJmgo

To claim this, I am signing this object:

@sebastianwebber
sebastianwebber / create-ec2-instance-playbook.yml
Last active Mar 3, 2020
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 Nov 6, 2019
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 / generate_series.sql
Last active Jul 28, 2019
SQL Server generate_series
View generate_series.sql
-- http://blog.jooq.org/2013/11/19/how-to-create-a-range-from-1-to-10-in-sql/
IF EXISTS (SELECT *
FROM dbo.sysobjects
WHERE id = object_id (N'[dbo].[generate_series]')
AND OBJECTPROPERTY(id, N'IsTableFunction') = 1)
DROP FUNCTION [dbo].[generate_series]
GO
CREATE FUNCTION [dbo].[generate_series] ( @p_start INT, @p_end INT)
@sebastianwebber
sebastianwebber / crontab_contents.sh
Created Jul 15, 2019
list crontabs from all gcp servers
View crontab_contents.sh
#!/bin/bash
server_list=$(gcloud compute instances list --format='get(networkInterfaces[0].networkIP)' --filter="status=running")
for server in ${server_list[@]}; do
echo "server: $server"
ssh $server 'sudo cat /var/spool/cron/* /etc/crontab'
echo "-----------"
done
@sebastianwebber
sebastianwebber / README.md
Last active Apr 6, 2019
Zabbix 3 Install on CEntOS 7 with PostgreSQL 9.5
View README.md

Zabbix 3 Install on CEntOS 7 with PostgreSQL 9.5

Repo installation

Zabbix repo

yum install http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
You can’t perform that action at this time.