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 Aug 14, 2020
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}')
@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
``
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 / 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 / find-history.sh
Created Feb 28, 2019
find YOUR git history amoung lots of git repositories
View find-history.sh
## include on your .zshrc (or similar)
#### tested on OSX
function findGitHistory() {
targetDir="${1}"
targetMonth="${2}"
targetYear="${3}"
targetUser=$(git config --get user.name)
View README.md

Race

small experiment on our go meetup.

tty-min

@sebastianwebber
sebastianwebber / pg-notify-parallel.go
Last active Jan 21, 2019
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 / ftpd.mtail
Last active Jan 4, 2019
mtail prog to parse vsftpd logs in xferlog format
View ftpd.mtail
hidden text FILENAME
counter log_ftp_files_processed_count by username, remote_host, transfer_type, direction
counter log_ftp_files_deleted_count by username, remote_host, transfer_type
counter log_ftp_files_incomplete_transfers_count by username, remote_host, transfer_type
FILENAME = getfilename()
## example file
### Fri Jan 4 12:55:27 2019 1 1.2.3.4 224 /path/to/file.CSV b _ o r user_name ftp 0 * c
@sebastianwebber
sebastianwebber / main.go
Created Nov 7, 2018
exemplo interface e testes #golang
View main.go
package main
import (
"fmt"
)
type contrato interface {
Insert() string
}
You can’t perform that action at this time.