Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gwhigs on github.
  • I am gwhigs (https://keybase.io/gwhigs) on keybase.
  • I have a public key ASAE4MSXTvW5J5iim87AvjiCAZPvBbJ8J7h-CvCKFs2hHQo

To claim this, I am signing this object:

@gwhigs
gwhigs / ftplib_utils.py
Created September 6, 2016 18:38
Mixin for the Python ftplib library's FTP class to handle servers that report their internal IP during initial control.
import ftplib
class ServerAddressMixin(object):
"""
Mixin for ftplib's FTP class.
Configures passive connections to use the originally supplied
host address in the event the server reports an 'unroutable' address
(i.e. starts with any of UNROUTABLE_IPS).
@gwhigs
gwhigs / pdf_utils.py
Last active September 7, 2016 14:16
A collection of utility functions for handling PDF files
from __future__ import unicode_literals, print_function
import os
import shutil
from six.moves import tkinter
from six.moves.tkinter_filedialog import askdirectory
from comtypes import client
import PyPDF2
import progressbar