Skip to content

Instantly share code, notes, and snippets.

View cpulvermacher's full-sized avatar

Christian Pulvermacher cpulvermacher

View GitHub Profile
@cpulvermacher
cpulvermacher / find_common_prefixes.py
Created September 9, 2018 16:47
Get use count for string prefixes
#!/usr/bin/env python3
# Find some suggestions on which shell commands you actually want an alias for:
# cat ~/.bash_history | python3 find_common_prefixes.py | sort -n
# cat ~/.zsh_history | cut -d ';' -f 2 | python3 find_common_prefixes.py | sort -n
import fileinput
class Node():
def __init__(self, text = ''):
self.text = text
@cpulvermacher
cpulvermacher / find-https-debian-archives.py
Created April 25, 2017 14:35 — forked from eighthave/find-https-debian-archives.py
Script to find official Debian mirrors that support HTTPS
#!/usr/bin/python
import urllib2
import re
import ssl
import sys
# # find generic mirrors
mirrors = urllib2.urlopen('http://www.debian.org/mirror/list')
https = []
@cpulvermacher
cpulvermacher / opera_adr_to_csv.py
Created May 19, 2016 15:51
Convert the .adr contact format (names and email only) of the Opera mail client into gmail-compatible CSV
import sys
if len(sys.argv) != 3:
print ("Usage: " + sys.argv[0] + " INPUT.ADR OUTPUT.CSV\n")
print ("Convert the .adr contact format (names and email only) of the Opera mail client into gmail-compatible CSV.")
sys.exit(1)
adrfile = open(sys.argv[1], 'r')
csvfile = open(sys.argv[2], 'w+')