Skip to content

Instantly share code, notes, and snippets.

@samber
samber / backup-pg.sh
Created February 26, 2019 06:53
Script for backuping db
#!/bin/bash
#set -x
set -e
export AWS_ACCESS_KEY_ID="xxxxxxxxxxxxxxx"
export AWS_SECRET_ACCESS_KEY="xxxxxxxxxxxxxxxxx"
export AWS_DEFAULT_REGION="eu-central-1"
export BUCKET="a-b-c-backups"
@samber
samber / abstract.md
Created January 25, 2019 06:52
Workshop prometheus + grafana

Prometheus est une timeseries database légère, basée sur le modèle de Borgmon (Google).

Il est l'un des principaux projets de la CNCF et bénéficie d'un large écosystème pour monitorer:

  • des servers
  • des services (applications, databases...)
  • des métriques business (nombre d'utilisateurs, ventes, taille de panier moyen...)

Prometheus peut être connecté à tout type d'infrastructure (cloud ou non!) sans être intrusif, et peut construire sa configuration à partir d'un service discovery tel que Consul, Kubernetes, DNS, EC2...

@samber
samber / abstract.md
Last active January 25, 2019 06:52
Workshop prometheus + grafana

Prometheus is a lightweight timeseries database, based on the Borgmon model (Google).

It takes advantage of a large and rich ecosystem to monitor:

  • servers
  • services (applications, databases...)
  • real-time business metrics (number of users, purchases, average cart size...)
  • Prometheus can be plugged into any kind of infrastructure, without being obstrusive and can fetch configuration from service discovery such as Consul, Kubernetes, DNS, EC2...

What would have been a monitoring platform without alerting and some graphic dashboards ?! During this workshop, we will setup a POC with Prometheus, Grafana and alertmanager.

@samber
samber / index.html
Last active October 25, 2018 09:24
Processing
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Processing.js</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/processing.js/1.6.6/processing.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
</head>
<body>

Step 1

Move some libs needed for dhclient and broken by criterion:

cd /usr/lib64/bind9-export

# quick and dirty
cp *.so* ..
@samber
samber / test.html
Last active September 11, 2018 09:09
html validation script (epitech)
<html>
<body>
<p>
</body>
</html>
@samber
samber / id_rsa.pub
Created August 20, 2018 08:50
ssh key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhDlAK8ewcwCTOv6xZHAAJK36QJ1ljJyn9/GiDTHE9aAREQdTtpPGrLvCxuqy3SZl/hvwSpNFjz0YH0sYvfQvBOTCogNo9o1FKcJaA9jOxPktRb2pObDA0+e2KIbyx3JR4hg63uP+p7awP8uKoRE+O8G6aTmv33mwqsl8ZOMVPo+qEkWniVCc5m7U1a/jIZj2JgFBa7Dhjnnr7RKlUWnmc0VhKQLwiOnyzpSMV2WBlOBrBnUAz60F2exTdX7zgULMHxyRSmL4xe/+BUHEUf9T41AEdWtcUx0iS7m/wGUvHKKokkz1zCkUGFy+Kq3rviH9dWYYt4KiHPm2/6DgKNua/ dev@samuel-berthe.fr
@samber
samber / fts-elasticsearch-vs-postgresql.md
Created June 28, 2018 22:00
CFP Devfest Nantes 2018

Si vous avez un jour développé un moteur de recherche, alors vous avez certainement utilisé SolR, Lucene ou le plus récent: Elasticsearch. Mais saviez-vous que PostgreSQL offrait une fonctionnalité de recherche Fulltext ? 😮

Pourquoi s'engager vers une base de donnée NoSQL, alors que le SQL est si beau et si performant ? 😍

Ce talk est un retour d'expérience sur l'utilisation de PostgreSQL FTS sur un dump de Stack-Overflow (~150Go, 150m docs).

Quels sont les avantages et inconvénients d'une monture SQL pour le développeur ? Et le sys-admin ?

Obtient-on les mêmes performances ? 📊

@samber
samber / Dockerfile.dev
Created June 21, 2018 15:50
Laravel Dockerfile for dev
FROM debian:stretch
ENV DEBIAN_FRONTEND="noninteractive" \
INITRD="No" \
PACKAGES="unzip php7.1-fpm php7.1-cli php7.1-common php7.1-curl php7.1-gd php7.1-intl php7.1-pgsql php7.1-mcrypt \
php7.1-json php7.1-redis php7.1-mbstring php7.1-bcmath"
WORKDIR /app
## Installs the PHP runtime and FPM
# export TF_VAR_do_token="qwertyuiop"
variable "do_token" {}
variable "region" { default = "lon1" }
provider "digitalocean" {
token = "${var.do_token}"
}