Skip to content

Instantly share code, notes, and snippets.

@robla
robla / sftpurl.py
Created July 18, 2016 00:18
print the sftp URL of a file from shell
#!/usr/bin/python
import os
import socket
import sys
import urllib
def sftppath(file):
fqdn=socket.getfqdn()
fullpath=os.path.realpath(os.path.expanduser(file))
return "sftp://" + fqdn + urllib.quote(fullpath)
@robla
robla / striptrackers.py
Created January 24, 2016 05:33
Sanitize URLs of tracking cruft from HTML exported from GDocs.
#!/usr/bin/env python
#
# Copyright 2016 Rob Lanphier
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@robla
robla / roadmap-publisher.py
Last active December 16, 2015 09:59
Work-in-progress for publishing the WMF Roadmap back to mediawiki.org
#!/usr/bin/env python
#
# Copyright (c) 2013 Rob Lanphier, Wikimedia Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: