Skip to content

Instantly share code, notes, and snippets.

View bergpb's full-sized avatar
💻
https://blog.bergpb.dev

Lindemberg Barbosa bergpb

💻
https://blog.bergpb.dev
View GitHub Profile
@grofit
grofit / traefik-compose.yml
Created May 23, 2020 19:32
Setting up Traefik 2 dashboard with basic auth, this is the same as my basic traefik 2 setup but with user auth from a file, you can see the original one here https://gist.github.com/grofit/e9a94ca02ba31ed1db9f88104f81c502
version: "3.7"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
ports:
- "80:80"
- "443:443"
- "8080:8080"
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active April 29, 2024 22:18
Docker Container Logging using Promtail
#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#define EPD_CS SS
GxEPD2_BW<GxEPD2_213_B73, GxEPD2_213_B73::HEIGHT> display(GxEPD2_213_B73(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0213B73
#define BAT 35
@ThabetAmer
ThabetAmer / list-git-branches.groovy
Last active February 9, 2023 16:08
Jenkins Groovy script to read Git repo branches and list them in an array, can be suited with Active Choice Jenkins Plugin
#!/usr/bin/env groovy
/**
* List all Git branches of a repo.
* @author thabet.amer@gmail.com
* @since Jenkins 2.204.1
* @params String url for Git repo URL, String credentialID, Bool activeChoice if ActiveChoice plugin used, String defaultBranch
* @return String array of branch names
*
* Dependencies:
def sendTelegram(message) {
def encodedMessage = URLEncoder.encode(message, "UTF-8")
withCredentials([string(credentialsId: 'telegramToken', variable: 'TOKEN'),
string(credentialsId: 'telegramChatId', variable: 'CHAT_ID')]) {
response = httpRequest (consoleLogResponseBody: true,
contentType: 'APPLICATION_JSON',
httpMode: 'GET',
url: "https://api.telegram.org/bot$TOKEN/sendMessage?text=$encodedMessage&chat_id=$CHAT_ID&disable_web_page_preview=true",
@BirkhoffLee
BirkhoffLee / docker-compose.yml
Created September 16, 2019 15:11
docker-compose Grafana + InfluxDB + collectd with Traefik
version: '3.2'
services:
collectd:
image: fr3nd/collectd
privileged: true
network_mode: host
volumes:
- /proc:/mnt/proc:ro
- ./collectd.conf:/etc/collectd/collectd.conf
@michalc
michalc / table_csv_view.py
Created March 7, 2019 09:19
Django + gevent + psycopg2 download whole PostgreSQL table as CSV
import csv
import logging
import gevent
from psycopg2 import (
connect,
sql,
)
from django.conf import (
@f213
f213 / fabfile.py
Created January 6, 2019 10:11
Fabfile example
from fabric.api import env, run as fabric_run
from fabric.contrib.project import rsync_project
env.app_path = '/home/backend'
env.user = 'circle'
env.use_ssh_config = True
env.disable_knodwn_hosts = True
env.colorize_errors = True
@onuralp
onuralp / Jenkinsfile
Last active January 6, 2021 17:43
Jenkins Shared lib function for VSTest Test Runner and Code Coverage Report
#!groovy
// I suggest you to add those functions as Shared Library https://jenkins.io/doc/book/pipeline/shared-libraries/
@Library('your-shared-lib') _
pipeline {
stages {
//..
stage('Run Unit Tests') {
steps {