Skip to content

Instantly share code, notes, and snippets.

View arkan's full-sized avatar

Florian Bertholin arkan

View GitHub Profile
@arkan
arkan / github.go
Last active October 7, 2023 13:03
Example to automatically update a binary as soon as a new Github release is published.
package github
import (
"archive/tar"
"compress/gzip"
"context"
"fmt"
"io"
"net/http"
"os"
@arkan
arkan / gmail-github-filters.md
Created December 1, 2018 15:05 — forked from ldez/gmail-github-filters.md
Gmail and GitHub - Filters

Gmail and GitHub

Create new filters and create new labels.

Pull Request

from:(notifications@github.com) AND {"Patch Links" "approved this pull request." "requested changes on this pull request." "commented on this pull request." "pushed 1 commit." "pushed 2 commits." "pushed 3 commits."}

label: gh-pull-request

@arkan
arkan / docker_logs.sh
Last active November 6, 2017 15:34
Docker logs on multiple containers
#!/bin/bash
#
# Usage:
# ./docker_logs.sh $(docker ps -q)
while [ $# -ne 0 ]
do
(docker logs -f -t --tail=10 $1|sed -e "s/^/$1: /")&
shift
done
@arkan
arkan / safebuffer.go
Last active May 19, 2021 21:54
Golang: Buffer is a goroutine safe bytes.Buffer
package safebuffer
import (
"bytes"
"sync"
)
// Buffer is a goroutine safe bytes.Buffer
type Buffer struct {
buffer bytes.Buffer
// Dashboard represents a Datadog Dashboard.
type Dashboard struct {
ID int64 `json:"id"`
ReadOnly bool `json:"read_only"`
Description string `json:"description"`
Title string `json:"title"`
Graphs []struct {
Definition struct {
Viz string `json:"viz"`
Requests []struct {
@arkan
arkan / sshd.go
Created October 5, 2016 16:11 — forked from jpillora/sshd.go
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@arkan
arkan / docker-compose.yml
Created August 23, 2016 14:36
Mesos on Docker
version: "2"
services:
zk:
image: bobrik/zookeeper
network_mode: host
environment:
ZK_CONFIG: tickTime=2000,initLimit=10,syncLimit=5,maxClientCnxns=128,forceSync=no,clientPort=2181
ZK_ID: 1
@arkan
arkan / Dockerfile
Created July 1, 2016 14:57
Marathon-lb with datadog integration
FROM datadog/docker-dd-agent:latest
RUN rm /etc/dd-agent/conf.d/haproxy.yaml.example
ADD conf.d/haproxy.yaml /etc/dd-agent/conf.d/haproxy.yaml
RUN sed -i -e"s/^.*histogram_percentiles:.*$/histogram_percentiles: 0.50, 0.75, 0.95, 0.99/" /etc/dd-agent/datadog.conf
RUN sed -i -e"s/^.*histogram_aggregates:.*$/histogram_aggregates: max, median, avg, count/" /etc/dd-agent/datadog.conf
@arkan
arkan / gist:0916ad2f209e98aa11f56a5788292bea
Created May 24, 2016 11:29 — forked from philips/gist:8324564
I love go. SSH client using the agent in under 50 lines of code.
// example: go run ssh.go core myhost:22 "ps aux | head -n 5"
package main
import (
"log"
"net"
"os"
"code.google.com/p/go.crypto/ssh"
)
@arkan
arkan / boot.config
Created March 17, 2016 14:18 — forked from kgersen/boot.config
orange ERL 3 - remplacement complet de la Livebox routeur
firewall {
all-ping enable
broadcast-ping disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name WAN_IN {
default-action drop
description "Packets from Internet to LAN"