Skip to content

Instantly share code, notes, and snippets.

View tiramiseb's full-sized avatar

Sébastien Maccagnoni tiramiseb

View GitHub Profile
@tiramiseb
tiramiseb / check_model3_vin.py
Created November 24, 2017 09:58
Calculate a Tesla Model 3 VIN, useful to check where they are in te production process
#!/usr/bin/env python
# coding: utf-8
import sys
# A Tesla Model 3 VIN seems to look like:
#
# check digit
# |
# | rank
@tiramiseb
tiramiseb / bankmail.sh
Created April 4, 2017 19:24
Send bank account history by mail
#!/bin/sh
#
# 1. Install weboob
# 2. Execute boobank
# 3. Follow instructions to connect to your bank account
# 4. Execute "boobank list" in order to obtain the account id
acctid="<boobank account id>"
mailto="<recipient1> <recipient2> [...]"
subject="<mail subject>"
@tiramiseb
tiramiseb / homebank_future.py
Created June 4, 2016 18:51
Display a table of future operations for HomeBank (it may not work for you, I have made it specific to my needs)
#!/usr/bin/env python
# -!- coding: utf8 -!-
import calendar
import datetime
import locale
import xml.etree.ElementTree as ET
from gi.repository import Gtk
# First install python-prettytable
@tiramiseb
tiramiseb / do_comment.py
Created May 30, 2016 08:18
uWSGI app for sending Pelican comments
# -*- coding: utf-8 -*-
#
# Sorry, the text in the script is in french, I am French...
import datetime
import smtplib
from email.mime.text import MIMEText
from urlparse import parse_qs
SOURCEPATH="Where the sources are on my computer"
EMAIL_ADDRESS="My email address"
@tiramiseb
tiramiseb / extract_wp_comments_for_pelican.py
Created May 30, 2016 08:15
Import WordPress comments to Pelican Comment System
#!/usr/bin/env python3
"""
This script :
* extracts comments from a WordPress eXtended RSS export file
* creates comment files for the Pelican comment system, in a "content/comments"
directory in the current path
The script takes the XML file name as its only argument.
@tiramiseb
tiramiseb / gist:2070169
Created March 18, 2012 09:31
Redmine connection for gtimelog (mod_python/PSP)
<%
REDMINE_URL = 'https://www.some.url.com/redmine'
DEFAULT_ENTRIES = [
u'Arrived',
u'Break**',
u'Lunch**',
u'Personal stuff***'
]
###############################################################################
@tiramiseb
tiramiseb / gist:2070022
Created March 18, 2012 08:45
Accessing "_GET" like in PHP with mod_python/PSP
import urlparse
_GET = dict(urlparse.parse_qsl(req.subprocess_env['QUERY_STRING']))