Skip to content

Instantly share code, notes, and snippets.

View hyrsky's full-sized avatar
🦊
Huhhuh

Santeri Hurnanen hyrsky

🦊
Huhhuh
  • Fi
View GitHub Profile
@hyrsky
hyrsky / labels.py
Last active September 20, 2019 19:48
Generate labels from D8 Webforms csv file
#!/usr/bin/env python3
# Version 3
from fpdf import FPDF
from collections import namedtuple
import itertools as IT
import argparse
import csv
import sys
# LDIF Export for dc=example,dc=org
# Server: ldap (ldap)
# Search Scope: sub
# Search Filter: (objectClass=*)
# Total Entries: 17
#
# Generated by phpLDAPadmin (http://phpldapadmin.sourceforge.net) on July 1, 2016 2:12 am
# Version: 1.2.3
@hyrsky
hyrsky / fix_timestamp.py
Created March 13, 2016 13:03
Fix timestamps
#!/usr/bin/env python
import os.path, time
import argparse
from dateutil import parser
import datetime
argparser = argparse.ArgumentParser(description='fix timestamps for files. oldest timestamp will be set to epoch and other timestamps are calculated based on that')
argparser.add_argument('file', nargs='+', help='list of file to touch')
@hyrsky
hyrsky / mailchimp.py
Created April 20, 2014 16:30
Mailchimp: send predefined campaigns to new subscribers
#!/bin/env python2
from datetime import date, timedelta
import mailchimp
campaigns = ['3c505cef16', 'a4c5c49119', '679a0d19cf', '7db2b71ccd']
# ^^^ List of campaigns here
listid = '8cde71be10';