Skip to content

Instantly share code, notes, and snippets.

View frbayart's full-sized avatar
🐼
it's a raining day !

Francois BAYART frbayart

🐼
it's a raining day !
View GitHub Profile
@frbayart
frbayart / notes.txt
Created March 16, 2016 09:06
Build Rudder Client on Raspberry Pi
apt-get update
apt-get install build-essential dh-autoreconf devscripts lintian diffutils patch patchutils git-core libssl-dev bison flex libtool libpcre3-dev libpam0g-dev
apt-get install fusioninventory-agent
git clone https://github.com/Normation/rudder-packages.git && cd rudder-packages && git checkout branches/rudder/3.0
git clone https://github.com/Normation/rudder-packages.git
Cloning into 'rudder-packages'...
remote: Counting objects: 11225, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 11225 (delta 6), reused 0 (delta 0), pack-reused 11208
@frbayart
frbayart / README.md
Created November 10, 2015 14:48 — forked from renchap/README.md
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {
@frbayart
frbayart / rudder-agent_init_scriptv2.sh
Created October 5, 2015 09:15
rudder-agent init script with PID check, loop to force stop
#!/bin/bash
#====================================================================
# Start/stop script for CFEngine Community
# (http://www.cfengine.com).
#
# chkconfig: 2345 85 15
# description: CFEngine Community
#
### BEGIN INIT INFO
@frbayart
frbayart / armv6l
Created September 18, 2015 11:46
Raspberry Pi v6 and v7 /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 2.00
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
@frbayart
frbayart / cpuinfo
Created September 16, 2015 14:56
rudder agent reinit raspberry pi v2
root@pv2-5vbxm:~# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 67.20
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5
@frbayart
frbayart / cpuinfo
Created September 16, 2015 14:51
rudder agent reinit on raspberry pi v1
root@pv2-4gxjg:~# cat /proc/cpuinfo
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 2.00
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
@frbayart
frbayart / a-guide-to-ncf-api.txt
Last active September 11, 2015 12:53 — forked from VinceMacBuche/a-guide-to-ncf-api.txt
Api ncf-builder
How to get techniques from a ncf api
You actually need the jsessionid cookie from your navigator (log in to Rudder and inspect your cookie), I will add authentication via rudder api token very soon
curl 'https://server.rudder/ncf/api/techniques?path=/var/rudder/configuration-repository/ncf' -k --cookie "JSESSIONID=Valueofyourcookie"
To send a technique to a server (see file api.json for exact content):
curl -X PUT 'https://server.rudder/ncf/api/techniques' -k --cookie "JSESSIONID=cookie" -d @api.json -v -H "Content-Type: application/json"
@frbayart
frbayart / elk_remove-old-indexes.sh
Created September 8, 2015 08:18
script to delete old indexes in Elasticsearch
#! /bin/bash
# Francois Bayart - 04 Feb 2015
# script to delete old indexes in Elasticsearch
#
# To keep some specific date, it's possible to add it in DATE_TO_KEEP variable (one date per line, format YYYY.MM.DD)
# Take care about to always use 2 digits for days and months
#
HOW_MANY_DAYS_TO_KEEP=10
@frbayart
frbayart / build.sh
Created July 28, 2015 13:35
build rudder projects
#! /bin/bash
INSTALL_DIR=$(pwd)
export MAVEN_OPTS=-Xmx512m
for rudderProject in rudder-parent-pom rudder-commons scala-ldap ldap-inventory cf-clerk rudder rudder-plugin-itop; do
tput setaf 2
echo "Building ${rudderProject}."
tput sgr0
cd ${INSTALL_DIR}
@frbayart
frbayart / build.sh
Created July 28, 2015 13:24
mvn install on rudder pugin itop
Francoiss-MacBook-Pro:rudder-plugin-itop frbayart$ mvn -Dmaven.test.skip=true install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building itop-connector 3.0.5-SNAPSHOT-1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ itop-connector ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/frbayart/woc/Amoobi/dev/vendor/rudder/rudder-plugin-itop/src/main/resources