Skip to content

Instantly share code, notes, and snippets.

View mqu's full-sized avatar
🏠
Working from home

Marc Quinton mqu

🏠
Working from home
  • DGAC / DSNA / DTI
  • Toulouse / France
View GitHub Profile
@mqu
mqu / logrotate.bash
Created October 23, 2018 08:02
rotating log file with bash script
#!/bin/bash
# rotate log files with bash script.
function _logrotate {
file=$1
MAXLOG=10
# return if $file does not exists
[ ! -f $file ] && return 0
@mqu
mqu / links.md
Last active October 11, 2018 05:36
Wiki Domodelect
@mqu
mqu / kaitai-build-debian-from-git.bash
Last active August 30, 2018 13:50
building kaitai-struct-compiler from source as a Debian Package using Docker
#!/bin/bash
# links:
# - http://kaitai.io/
# - http://doc.kaitai.io/developers.html#_building_for_jvm
# - https://hub.docker.com/r/hseeberger/scala-sbt/
# - https://www.scala-sbt.org/
# tags : sbt, kaitai, docker
@mqu
mqu / mattermost-cli.rb
Last active November 29, 2018 14:58
Mattermost cli using API V4 in ruby.
#!/usr/bin/ruby
# Mattermost simple cli command based on API4 from maruTA code
# version : 0.3
# usage :
# you need to create a new token in Mattermost to use this CLI
# and export this token as MM_TOKEN and MM_SERVER (or as an option)
# export MM_TOKEN='...'
# export MM_SERVER='https://mattermost.localhost/api/v4'
@mqu
mqu / domoticz-mqtt-gw.rb
Last active September 15, 2018 21:31
Domoticz MQTT gateway
#!/usr/bin/ruby
# Domoticz-MQTT Gateway ; author : Marc Quinton / may 2018
# source : https://gist.github.com/mqu/fc33f3b9aa2d7c09244e2d36c6c7302e (transitionnal)
# version 0.02
# fixme :
# - remove hardcoded topics and strings
# - handle "domoticz/out" topics
# - handle mqtt disconnect / done
#
@mqu
mqu / selenium-youtube.rb
Created November 11, 2017 08:23
selenium and youtube player
#!/usr/bin/ruby
require "selenium-webdriver"
require 'pp'
# install :
# sudo apt-get install ruby ruby-dev chromium-chromedriver firefoxdriver
# sudo gem install selenium-webdriver
# sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/
@mqu
mqu / Dockerfile
Created October 18, 2017 11:19
Yadicts - Dockerfile preliminary snapshot for Yadicts project.
FROM ubuntu:trusty
MAINTAINER [email protected]
# Yadics Dockerfile : http://yadics.univ-lille1.fr/wordpress/?page_id=57
# see : https://linuxfr.org/forums/linux-debian-ubuntu/posts/empaqueter-une-appli-dans-docker
# download url
ARG url=http://yadics.univ-lille1.fr/wordpress/wp-content/plugins/filedownload/download.php/?path=http://yadics.univ-lille1.fr/wordpress/wp-content/uploads/2015/05/YaDICs_Project.zip&type=&check=&referer=/wordpress/?page_id=2
# dependencies : http://yadics.univ-lille1.fr/wordpress/?page_id=57
@mqu
mqu / f3 usage
Last active February 6, 2020 18:51
quick and dirty sdcard (microsd) flash test script (and links). Comments are welcome.
F3(1) test real flash memory capacity F3(1)
NAME
f3write, f3read - test real flash memory capacity
SYNOPSIS
f3write [--start-at=NUM] [--end-at=NUM] <PATH>
f3read [--start-at=NUM] [--end-at=NUM] <PATH>
DESCRIPTION
@mqu
mqu / ier411.rb
Last active August 3, 2017 07:05
ruby API for IER-411french ANSP strip printer
#!/usr/bin/ruby
# ier411.rb - ruby API to manage and write to IER-411 strip printer
#
# author : Marc Quinton / 2017.08 - DSNA-DTI/EEI.
# link : https://gist.github.com/mqu/85a3b60a64a963e771962b8d27e03da9
#
# keywords : ATC, ANSP, strip, printer, ruby, serial, xon-xoff.
#
# simple API to manage and write to IER-411 strip printer, later in use in French ANSP airports
@mqu
mqu / xpi2deb.sh
Last active July 27, 2017 14:31
xpi2deb - convert XPI (thunderbird and firefox extensions) to debian packages
#!/bin/sh
# xpi2deb - convert XPI (thunderbird and firefox extensions) to debian packages
# author : Marc Quinton/DSNA-DTI quinton_@_cena_.fr / july 2017
#
# this script convert XPI extensions to .deb packages
# and is based on https://github.com/mdom/debianize-xpi script
#
# - dependancies : apt-get install mozilla-devscripts curl unzip xmlstarlet devscripts
# - usage : xpi2deb path-to-xpi (debian package is created on current directory)