Skip to content

Instantly share code, notes, and snippets.

View lvaylet's full-sized avatar
🔥
Learning

Laurent Vaylet lvaylet

🔥
Learning
  • Google, Inc
  • Paris, France
View GitHub Profile
@lvaylet
lvaylet / recursive_git_pull.sh
Last active July 11, 2020 17:13
Recursive git pull
# When you want to update all of your git repositories with a single command
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \;
@lvaylet
lvaylet / main.tf
Created February 18, 2020 21:30
Terraform 12 - for_each with list of objects
/*
Usage:
$ tfenv install 0.12.19
$ tfenv use 0.12.19
$ terraform init
$ terraform plan
$ terraform apply -auto-approve
$ terraform destroy
Reference: https://github.com/hashicorp/terraform/issues/22516
@lvaylet
lvaylet / alphabet.py
Created October 18, 2019 09:15
Generate an alphabet pattern for buffer overflow exploits
"""
>>> python alphabet.py
AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZ
"""
import string
alphabet = ''.join([c*4 for c in string.ascii_uppercase])
print(alphabet)

Compile Apache MiNiFi 0.4.0 C++ for alpine-based image on Raspberry Pi 3.

# ----- Instantiate an immutable Debian container for compilation ----- #
# Bind mount a shared volume to store the binary once it is built.
docker run -it --rm -v `pwd`:/build resin/raspberrypi3-debian /bin/bash

# ----- Inside the Debian container ----- #
apt update && apt install git build-essential
git clone https://github.com/apache/nifi-minifi-cpp
@lvaylet
lvaylet / cross-compile_filebeat_arm.md
Last active September 13, 2021 08:01 — forked from anis-campos/cross-compile_filebeat_arm.sh
Cross-compile Elastic Filebeat for ARM with docker. Works on Raspberry Pi 2 and 3.

Elastic does not provide Filebeat binaries for ARMv7. Luckily, Filebeat can easily be cross-compiled with:

# ----- Instantiate an immutable Go container for cross-compilation ----- #
mkdir build && cd $_
docker run -it --rm -v `pwd`:/build golang:1.9 /bin/bash

# ----- Inside Go container ----- #
go get github.com/elastic/beats
cd /go/src/github.com/elastic/beats/filebeat/
@lvaylet
lvaylet / atlassian-jira-docker-compose.yml
Created January 15, 2018 21:26
docker-compose for JIRA with MySQL
version: '3'
services:
jira:
depends_on:
- mysql
container_name: jira
restart: always
image: cptactionhank/atlassian-jira:7.7.0
ports:
@lvaylet
lvaylet / gist:0ec898dd7745172daa83ee732d9ac7b8
Last active January 5, 2018 16:11
How to setup networking on XS35V2
# Ubuntu Server 16.04 LTS x64
- La carte Ethernet n'est pas reconnue pendant l'installation.
- La procédure 12.04 ne fonctionne pas. Dû à l'architecture x64 ?
- Les outils WiFi ne sont pas installés par défaut.
=> impossible de se connecter. Partir d'une 14.04, configurer le WiFi et faire l'upgrade vers 16.04 manuellement.
Ensuite, suivre les instructions de ce billet pour activer l'interface `p*p1` (anciennement eth0) : https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1310798
@lvaylet
lvaylet / install-flynn.sh
Last active January 1, 2018 17:19
Install script for single node Flynn Cluster on Ubuntu 16.04 box
#!/bin/bash
# This script sets up a single node Flynn Cluster on your linux box.
# Fresh Flynn install with domain provided by the xip.io service.
#
# @date 1 Jan 2018
# @author Laurent Vaylet <laurent.vaylet@gmail.com>
#
# References:
# https://flynn.io/docs/installation/manual#bootstrap-flynn (Flynn documentation)