Skip to content

Instantly share code, notes, and snippets.

View ncarlier's full-sized avatar
💭
Open to Work

Nicolas Carlier ncarlier

💭
Open to Work
View GitHub Profile
@ncarlier
ncarlier / gitkraken2pkanban.mjs
Last active December 1, 2022 15:57
Gitkraken 2 Portable Kanban
import { parse } from 'csv-parse/sync'
import { promises as fs} from 'fs'
import { v4 as uuid } from 'uuid'
const decodeDesc = (desc) => desc.split('\n').reduce((result, line) => {
if (line.startsWith('- [x] ')) {
result.checkboxes.push({
id: uuid(),
title: line.replace("- [x] ", ""),
checked: true
@ncarlier
ncarlier / deploy.sh
Created March 9, 2021 16:34
Deploy hook example
#!/bin/sh
# Error function
die() { echo "error: $@" 1>&2 ; exit 1; }
confDie() { echo "error: $@ Check the server configuration!" 1>&2 ; exit 2; }
# Set global variables
export DEPLOY_KEY=/run/secrets/private_deploy_key
# Validate global configuration
@ncarlier
ncarlier / teleinfo.ino
Created October 31, 2020 20:51
Linky teleinfo
/*
Usage :
+ This is a simple Teleinfo Test program
+ It's just to test the TeleInfo board and its
connexion to the EDF counter
+ It just displays the received teleInfo data on
the Serial Monitor
+ No Internet connexion, no data transfered
Hardware needed :
#!/bin/sh
# Functions
die() { echo "error: $@" 1>&2 ; exit 1; }
confDie() { echo "error: $@ Check the server configuration!" 1>&2 ; exit 2; }
debug() {
[ "$debug" = "true" ] && echo "debug: $@"
}
# Validate global configuration
@ncarlier
ncarlier / Makefile
Created September 10, 2019 12:15
Makefile to create certificates
.SILENT :
.PHONY : all help clean
PASSWORD:=$(shell cat .password)
DAYS:=1460
SUBECT:=blab.in
CERTIFICATE:=ca.pem
version: "3"
services:
#######################################
# Metrics collector: Telegraf
#######################################
telegraf:
image: telegraf:alpine
restart: always
environment:
- "HOST_PROC=/rootfs/proc"
@ncarlier
ncarlier / GPG-HOWTO.md
Last active May 21, 2023 01:09
GPG how-to

GPG HowTo

Generate GPG key

$ gpg --full-generate-key

Key size: 4096

# Install PIP
curl -LO https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
export PATH=$HOME/.local/bin:$PATH
# Install ansible
pip install ansible --user
# Run ansible
ansible --version
#!/usr/bin/python
import os
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
PORT_NUMBER = os.getenv('APP_PORT', 8080)
#This class will handles any incoming request from
#the browser
class myHandler(BaseHTTPRequestHandler):
#Handler for the GET requests