Skip to content

Instantly share code, notes, and snippets.

View jmaupetit's full-sized avatar

Julien Maupetit jmaupetit

View GitHub Profile
@jmaupetit
jmaupetit / README.md
Last active March 11, 2022 15:17
X-Accel-redirect example using Caddy2 server

Start services:

docker-compose up

Test x-accel-redirect for POST requests:

curl -v -d '{"foo": 2}' http://localhost:8000/test
@jmaupetit
jmaupetit / datastack
Last active November 29, 2021 10:29
Perform actions in France Université Numerique data stack (for local development purpose)
#!/usr/bin/env bash
# Install this script somewhere in your $PATH
# Configurations
declare REPOSITORIES_ROOT_DIR="${HOME}/Work/fun"
declare -a REPOSITORIES=(potsie ralph learning-analytics-playground)
# Terminal colors
declare -r COLOR_BLUE='\033[0;36m'
@jmaupetit
jmaupetit / tizonia
Created August 23, 2019 07:52
Tizonia Spotify CLI (Linux only)
#!/bin/bash
USER_ID=$(id -u)
GROUP_ID=$(id -g)
docker run -it --rm -u ${USER_ID}:${GROUP_ID} \
-e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
--volume=${XDG_RUNTIME_DIR}/pulse:${XDG_RUNTIME_DIR}/pulse \
--volume="${HOME}/.config/tizonia":/home/tizonia/.config/tizonia \
--volume="${HOME}/.config/pulse/cookie":/home/tizonia/.config/pulse/cookie \
@jmaupetit
jmaupetit / edx-database-hawthorn.sql
Created September 11, 2018 20:36
Open edX Hawthorn import database schema
-- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
--
-- Host: localhost Database: edxapp
-- ------------------------------------------------------
-- Server version 5.7.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@jmaupetit
jmaupetit / edx-database-ginko.sql
Last active May 26, 2018 23:10 — forked from rmoch/edx-database-ginko.sql
Open edX Ginkgo import database schema
-- MySQL dump 10.13 Distrib 5.6.39, for Linux (x86_64)
--
-- Host: localhost Database: edxapp
-- ------------------------------------------------------
-- Server version 5.6.39
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@jmaupetit
jmaupetit / fix_watson_uuids.py
Created June 6, 2017 14:47
Fix TailorDev Watson uuids in frames
#!/usr/bin/env python3
"""
Use this script if you have corrupted frames in your watson history. In my
case, almost 400 frames had short ids instead of 32 chars uuids.
Usage:
$ cd path/to/watson/dir
$ wget GIST_URL -O fix_watson_uuids.py
$ python3 fix_watson_uuids.py
@jmaupetit
jmaupetit / python-102.ipynb
Last active March 9, 2017 10:57
Software Carpentry Workshop - Freiburg, 2017/03/10
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmaupetit
jmaupetit / dateparser_vs_dateutil.py
Created October 6, 2016 15:57
dateparser.parse vs dateutil.parser.parse
#!/usr/bin/env python3
"""Compare (fuzzy) dateutils vs dateparser `parse` methods"""
import sys
from dateparser import parse as dp_parse
from datetime import datetime, timedelta
from dateutil.parser import parse as du_parse
NOW = datetime.now()
@jmaupetit
jmaupetit / watson_prompt.bash
Last active May 3, 2016 10:30
Watson Bash Prompt
# Add this to your ~/.provile or ~/.bashrc depending on your system
#
# watson directory (require watson >= 1.3)
# This value is the default on MacOSX
WATSON_DIR="$HOME/Library/Application Support/watson"
watson_status() {
# colors taken from git-aware-prompt
# https://github.com/jimeh/git-aware-prompt
local txtred="$(tput setaf 1 2>/dev/null || echo '\e[0;31m')" # Red

Keybase proof

I hereby claim:

  • I am jmaupetit on github.
  • I am jmaupetit (https://keybase.io/jmaupetit) on keybase.
  • I have a public key whose fingerprint is 0A75 D5AE C0B6 FD1B 7567 A86F D342 935F 09A4 B0CF

To claim this, I am signing this object: