Skip to content

Instantly share code, notes, and snippets.

@fmarot
fmarot / gist:42812167d6eaeb5c3f33
Last active August 29, 2015 14:08
Boxstarter default utilities
# https://boxstarter.codeplex.com/wikipage?title=Quickly%20setup%20any%20machine%20with%20one%20easy%20to%20remember%20command
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst altdrag
cinst 7zip
cinst GoogleChrome
cinst firefox
@fmarot
fmarot / gist:ea394e58d9b62f727d38
Last active August 29, 2015 14:20
Some Vagrant stuffs
RedhHat:
sudo wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.rpm && sudo rpm -ivh vagrant_1.7.2_x86_64.rpm && sudo wget http://download.virtualbox.org/virtualbox/4.3.26/VirtualBox-4.3.26-98988-Linux_amd64.run && sudo sh ./VirtualBox-4.3.26-98988-Linux_amd64.run
Ubuntu:
sudo wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.deb && sudo dpkg -i vagrant_1.7.2_x86_64.deb
# dl of the box => added to .vagrant in home
vagrant box add my-box name-of-the-box.box Or vagrant box add ubuntu/trusty64
# creation du Vagrantfile referencant la box downloadee
vagrant init my-box
@fmarot
fmarot / gist:91dcca9894c339e3884d
Last active August 29, 2015 14:22
Objet: Demande de retour du paiement par virement à Pôle Enfance

Lundi 7 juin 2015

Version courte (TLDR):

A Aubagne depuis 1 an, nous payions toutes les factures à Pôle enfance par virement (cantine, centre aéré, périscolaire, …​). Nous sommes extrêmement déçu que ce moyen de paiement dématérialisé et distant soit supprimé. C’est un retour en arrière de 10ans qui fera perdre du temps à tous les aubagnais parent d’enfants.

Version longue:

Monsieur le Maire, depuis un an, je profitai du virement à Pôle Enfance pour payer, des réception de la facture, mon dû. Pratique, immédiat, pas de risque de perte d’une enveloppe ou d’un chèque. Et surtout, qui évite les déplacement inutiles.

# to use with Boxstarter:
# https://gist.githubusercontent.com/fmarot/702b9d4153a2d64c520374333dbe13d7/raw
# run command prompt "cmd" as admin and:
# START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/fmarot/702b9d4153a2d64c520374333dbe13d7/raw
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableExpandToOpenFolder
Enable-RemoteDesktop
cinst 7zip
export EXTENSION=jpg
export TARGET_DIRECTORY=/home/pierrehenri/Dropbox/scans
export TIMESTAMP=$(date +%Y%m%d_%H%M%S)
export TMP_FILE=/tmp/scan-$TIMESTAMP.$EXTENSION
export OUTPUT_FILE=$TARGET_DIRECTORY/scan-$TIMESTAMP.$EXTENSION
export ARCHIVE_DIR=$TARGET_DIRECTORY/vieux-scans/
mkdir -p $TARGET_DIRECTORY
mkdir -p $ARCHIVE_DIR
@fmarot
fmarot / PrintPreviewPagesTester.java
Created May 2, 2017 08:01
A Swing layout able to lay pages horizontally inside an horizontally scrollable panel
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.Rectangle;
import java.awt.event.ComponentEvent;
@fmarot
fmarot / parseGamelistRecalbox.groovy
Created May 12, 2018 17:04
This script creates a CSV file from the gamelist.xml files contained in your Recalbox
/**
This script creates a CSV file from the gamelist.xml files contained in your Recalbox
*/
/*
Telechargement automatique des librairies:
- jcifs pour acceder au partage reseau des fichier (protocole samba)
- IOUtils, la librairie contenue dans commons-io et qui permet de lire des fichiers facilement
*/
@Grapes([
#!/bin/bash
#If we do not sleep, the network is not available :( => we should use systemd !!!
sleep 8
# inspired by http://disq.us/p/1anwvre
# requires to set wallpaper mode as slideshow from ~/wallpaper
echo "`date`" >> getBingWallpaper.log
@fmarot
fmarot / monitor.groovy
Created June 25, 2018 21:36
monitor availability of KIMSUFI KS-2
@Grab('org.eclipse.jetty.aggregate:jetty-server:8.1.19.v20160209')
@Grab('org.eclipse.jetty.aggregate:jetty-servlet:8.1.19.v20160209')
@Grab('javax.servlet:javax.servlet-api:3.0.1')
@Grab('org.seleniumhq.selenium:selenium-api:3.5.3')
@Grab('org.seleniumhq.selenium:selenium-remote-driver:3.5.3')
@Grab('org.seleniumhq.selenium:selenium-server:3.5.3')
@Grab('junit:junit:4.12')
import org.openqa.selenium.By;
@fmarot
fmarot / BackgroundObjectBuilder.java
Created April 4, 2019 14:20
This class contains a builder method that allows to create object with time-consuming constructor in background. Then it can be used as usual from a user perspective. Totally trensparent from user-side apart the construction using the provided builder method.
package com.oleamedical.dbclient.sds;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import java.util.function.Supplier;