Skip to content

Instantly share code, notes, and snippets.

View dhardy92's full-sized avatar

Damien Hardy dhardy92

View GitHub Profile
@dhardy92
dhardy92 / colXml2CSV.xsl
Last active October 17, 2023 10:19
Est ce que je suis passé par des cols
<!-- usage :
xsltproc --param dep 01 colXml2CSV.xsl 01.xml
use a loop on files an write in a single csv:
for i in {01..95} ; do xsltproc --param dep "$i" colXml2CSV.xsl $i.xml >> cols_fr.csv ; done
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8" />
<xsl:param name="dep" />
@dhardy92
dhardy92 / edf-tempo_2023.awk
Created April 14, 2023 14:37
Script Awk pour évaluer sa facture avec l'offre tempo d'EDF en fonction de sont usage réèl passé. en tenant compte des jour blanc et rouge de l'hiver 2022/2023
function tempo_price(date,hour) {
datespec = date " " hour
gsub(/[:-]/," ", datespec)
ts = mktime(datespec)-(6*3600)
tempo_date = strftime("%Y-%m-%d", ts)
tempo_hour = strftime("%H",ts)
tempo["2022-11-29"]="blanc"
tempo["2022-11-30"]="blanc"
tempo["2022-12-01"]="blanc"
@dhardy92
dhardy92 / main.js
Last active January 5, 2023 18:09
Generate a Squadrat data GeoJSON format file
import './style.css';
import {Map, View} from 'ol';
import TileLayer from 'ol/layer/WebGLTile';
import OSM from 'ol/source/OSM';
import {useGeographic} from 'ol/proj.js';
import {Vector as VectorLayer} from 'ol/layer.js';
import VectorSource from 'ol/source/Vector.js';
import {Fill, Stroke, Style} from 'ol/style.js';
import GeoJSON from 'ol/format/GeoJSON.js';
@dhardy92
dhardy92 / GarminSpeed.jq
Last active May 15, 2019 17:21
Create a SRT subtitle file with extrapolated speed from Garin activity
.activityDetailMetrics[0].metrics[3] as $startime |
.activityDetailMetrics[] |
[ (((.metrics[3] - $startime) / 1000) | strftime("%H:%M:%S")), ((.metrics[10]//0)*3.6)] |
@tsv
@dhardy92
dhardy92 / AGSEIP.yaml
Created March 22, 2019 09:58
Amazon AWS AutoscaleGroup of spot instance with ElasticIP
# A domain zone not hosted on AWS::Route53 and we want domain root record to exists (require a A record).
# ELB/Cloudfront is not static and change IP all the time.
# We cannot associare ElasticIP with ELB.
# We want some failover on this tiny stack
# AutoscaleGroup cannot associate ELasticIP to an instance.
# In internet gateway enabled subnet, instance without ElasticIP cannot use AWS API (no public network)
# Here is my solution :
# * AutoscaleGroup for resilience of spot instance
# * Lambda runing python for ElasticIP association on ASG launch instance event.
# LIMITATION:
Verifying that +dhardy is my blockchain ID. https://onename.com/dhardy
@dhardy92
dhardy92 / gist:c8a20d1d054b9f05d919
Created July 10, 2014 15:57
Zookeeper server log during aurora attempt of election
2014-07-10 16:25:50,889 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@202] - Accepted socket connection from /192.168.2.74:46653
2014-07-10 16:25:50,890 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@202] - Accepted socket connection from /192.168.2.74:46654
2014-07-10 16:25:50,890 [myid:1] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@785] - Connection request from old client /192.168.2.74:46653; will be dropped if server is in r-o mode
2014-07-10 16:25:50,890 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@831] - Client attempting to establish new session at /192.168.2.74:46653
2014-07-10 16:25:50,890 [myid:1] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@785] - Connection request from old client /192.168.2.74:46654; will be dropped if server is in r-o mode
2014-07-10 16:25:50,890 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@831] - Client a