Skip to content

Instantly share code, notes, and snippets.

@GuillaumeDerval
GuillaumeDerval / ade.php
Last active December 23, 2015 03:29
Script permettant de créer des fichiers aux format ICS à partir du module ADE de l'UCL.
<?php
/*
UCL2ICS v2.3
Guillaume Derval, basé sur le travail de ploki (forum-epl)
- Fix general
- Remise en forme du code (meme si Nicolas dit que ce n'est pas suffisant ;-) )
- Ajout de la possibilite d'enlever des cours
- On ne sauvegarde plus rien sur le disque
- UTF-8 inside
- Lien d'abonnement
@GuillaumeDerval
GuillaumeDerval / verifier.sh
Last active January 4, 2016 06:19
Averti quand votre bureau virtuel est mit à jour
#!/bin/bash
# UCL Virtual Desktop Update Checker (VDUC pour les intimes)
# Averti quand votre bureau virtuel est mit à jour
# Guillaume Derval
# GPLv3
uclID="IDENTIFIANT UCL" #Identifiant global UCL
uclPASS="PASS UCL" #Le pass UCL. sisi.
activateBell=1 #Son en boucle si MAJ
@GuillaumeDerval
GuillaumeDerval / scheduler.rst
Last active August 29, 2015 14:09
Note for the new scheduler of INGInious

Notes about the new scheduler for INGInious

Why does INGInious needs a (new) scheduler?

There is a problem with the assumption that the OS will handle the charge of multiples tasks running concurrently(right now, INGInious immediately launches tasks it receives, (nearly) without limits), mainly because of memory usage.

For a strange reason, processes are never/not enough put to swap, leading to OOM in other containers.

@GuillaumeDerval
GuillaumeDerval / gist:fb219569c7e03a938f9b
Last active September 2, 2015 14:22
Roadmap 2 for INGInious
  • Use gevent
    • For now we start threads for each agent/connection/job/...
    • This is inneficient, as most of them only wait for one or other socket (either from Docker or from RPyC)
    • Using gevent will be faster and pose less stress to the OS, that is already way too stressed by Docker
    • This needs some work:
  • Websockets? To handle the task page (status update of jobs)
  • probably needs gevent
Host studssh.info.ucl.ac.be studssh
User gderval
IdentityFile ~/.ssh/id_rsa_ingi
Host !studssh.info.ucl.ac.be !studssh *.info.ucl.ac.be baluran bibinoi bulusan calbuco cayambe chacana colachi davidof denison furnas kadovar khangar tibesti trident tsurumi virunga vulcano yunaska permeke tuteur inginious stromboli studmanager
ProxyCommand ssh -4 studssh.info.ucl.ac.be -W %h:%p
IdentityFile ~/.ssh/id_rsa_ingi
Host vega.ulb.ac.be
ProxyCommand ssh -4 studssh.info.ucl.ac.be -W %h:%p
import java.util.*;
/**
* A mutable map for Integer keys based on a trie using the binary representation of keys
*
* @param <V> values to be contained in the structure
*/
public class MutableIntMap<V> extends AbstractMap<Integer, V> implements NavigableMap<Integer, V> {
protected int treeSize;
protected int[] tree;
@GuillaumeDerval
GuillaumeDerval / performance_backend.py
Created January 21, 2020 13:16
Performance test for INGInious
import asyncio
import logging
import time
from multiprocessing import Process
from zmq.asyncio import ZMQEventLoop, Context
from inginious.agent import Agent
from inginious.backend.backend import Backend
from inginious.client.client import Client
from inginious.common.messages import BackendKillJob, BackendNewJob
@GuillaumeDerval
GuillaumeDerval / log_handler_slack.py
Last active June 5, 2021 10:01
A --log-handler-script log script for snakemake that pushes the status to Slack
# License: MIT
import socket
from slacker import Slacker
import datetime
import time
import threading
SLACK_TOKEN = 'xoxb-00000000000-000000000000-000000000000000000000000'
CHANNEL_NAME = "your-channel-on-slack"
@GuillaumeDerval
GuillaumeDerval / extract_euromomo.py
Last active April 26, 2020 14:47
Extract euromomo plot data
import json
import requests
from bs4 import BeautifulSoup
# Change this
OUTPUT_FILE = 'euromomo.json'
# Change this if the script breaks
BASE_PAGE = "https://www.euromomo.eu/graphs-and-maps/"
JS_FILE_PATTERN = "src-templates-graphs-and-maps-js"
@GuillaumeDerval
GuillaumeDerval / mamaroo.py
Created July 30, 2020 16:17
Starting 4moms mamaRoo using Python
import asyncio
import random
from bleak import discover, BleakClient
ADDRESS = None
UUID = "622d0101-2416-0fa7-e132-2f1495cc2ce0" # can be found by connecting to the mamaRoo and inspecting the thing it advertises.
async def find_mamaroo():
if ADDRESS is not None: