Skip to content

Instantly share code, notes, and snippets.

View kartoch's full-sized avatar

Julien Cartigny kartoch

  • Freelance
  • Everywhere
  • 03:05 (UTC +02:00)
  • X @kartoch
View GitHub Profile
@kartoch
kartoch / Dockerfile
Last active April 12, 2023 17:59
UDP server behind traefik
FROM python:3
WORKDIR /usr/src/app
COPY udp_server.py .
CMD [ "python", "./udp_server.py" ]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kartoch
kartoch / python-gis2a4-tp1.py
Created November 24, 2017 15:30
Python @ Polytech'Lille - TP2
#!/usr/bin/python
# Goal: scrap the "Annuaire" web page of Polytech Lille to gather the list of
# all students and their id (encoded in base 64). Print the number of
# entry found
#
# You can use requests for scraping and re for extracting data from the page
import base64
import requests
@kartoch
kartoch / python-gis2a4-tp1.py
Last active November 24, 2017 09:28
Python @ Polytech'Lille - TP1
#!/usr/bin/python
# Goal: write a simple CSV parser for the video-games CSV file and print the
# sum of the global sales for each console
#
# CSV files are text files with each row is a line where cells are separated
# by comma. Because comma can also be used as value in cell, a value cell
# which contains a comma has a double quote at the start and the end of the
# value.
#
@kartoch
kartoch / config.ini
Created November 16, 2016 15:51
Recursive webdav upload using easywebdav
[Main]
namespace: # webdav server
login: # login
local_dir: # local directory
remote_dir: # remote directory
@kartoch
kartoch / scrap_friends_episodes_and_full_cast.py
Last active November 5, 2016 15:36
The script connect to several IMDB pages to gather the whole list of episodes as JSON, each entry includes the cast as returned by IMDB. Great dataset for beginning a mongodb lab for my students.
# This script connect to several IMDB pages to gather the whole list of episodes as JSON, each entry includes the cast as
# returned by IMDB. Great dataset for beginning a mongodb lab for my students.
from bs4 import BeautifulSoup
from dateutil import parser
import dateutil
import json
import locale
import logging

Keybase proof

I hereby claim:

  • I am kartoch on github.
  • I am kartoch (https://keybase.io/kartoch) on keybase.
  • I have a public key whose fingerprint is 19F2 F58E 19D3 99BE DB15 2DB1 CA5C 95BC 42D6 2085

To claim this, I am signing this object:

@kartoch
kartoch / config.py
Last active August 29, 2015 14:00
Qtile configuration
from libqtile.config import Key, Screen, Group, Drag, Click, Match
from libqtile.command import lazy
from libqtile import layout, bar, widget, hook
mod = "mod4"
keys = [
# Switch between windows in current stack pane
Key(
[mod], "k",
@kartoch
kartoch / hubic_credentials.py
Last active April 12, 2018 12:22
Python script to obtain Hubic credentials (access and renew tokens)
"""
As Hubic web services are deprecated, this is a small script to request
access and refresh token. It starts a flask server at http://localhost:5000/, the
users fill the hubic authentication form with its navigator and obtain the
credentials returned by the application.
You need requests-oauthlib and flask:
pip install flask
pip install requests-oauthlib
@kartoch
kartoch / mutator.txt
Last active February 28, 2018 16:16
Muttator Cheatsheet
A Muttator Reference Sheet / Cheat Sheet
Muttator v0.6 for Thunderbird v3.0 and 3.1.* (muttator-20100629.xpi)
The main thing to know about using Muttator is that there are two primary modes, EX mode and MESSAGE mode,
and keyboard mappings can work very differently in the two modes. It's not obvious which mode you're in;
you have to look at the bottom left of your Thunderbird window where the status line with either be blank
(EX mode) or will say "-- MESSAGE --". There is also an odd "-- CARET --" mode that you'll probably want
to <ESC> out of as soon as possible.