Skip to content

Instantly share code, notes, and snippets.

@Bouke
Bouke / gist:11261620
Last active August 3, 2023 01:46
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@RWJMurphy
RWJMurphy / filerotator.py
Last active February 1, 2023 04:02
Python class and utility for file rotation. Configurable daily, weekly and monthly retention; can use hard links to save space; supports `argparse` config files.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ft=python ts=4 sw=4 expandtab
#
# Copyright (c) 2013 Reed Kraft-Murphy <reed@reedmurphy.net>
#
# 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
@norman-bauer
norman-bauer / Configure-DHCPOption119OnScope.ps1
Last active December 31, 2022 08:24
Asks for a list of semicolon separated domain suffixes and a Windows Server DHCP Scope Id on which Option 119 will be configured accordingly
$domainSearchList = Read-Host "Please enter a list of domain suffixes separated by semicolons (e.g. domain.local;domain.tld;int.domain.tld)"
$scopeToConfigure = Read-Host "Please enter the scope id of the scope to be configured (e.g. 192.168.1.0)"
$splittedDomainSearchList = $domainSearchList -split "\;"
$domainSearchListHexArray = @();
Foreach ($domain in $splittedDomainSearchList)
{
$splittedDomainParts = $domain -split "\."
Foreach ($domainPart in $splittedDomainParts)
@jeffdgr8
jeffdgr8 / SumByColor.js
Last active December 15, 2018 22:25 — forked from clupasq/subByColor.js
function getBackgroundColor(rangeSpecification) {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
return sheet.getRange(rangeSpecification).getBackground();
}
function getForegroundColor(rangeSpecification) {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
return sheet.getRange(rangeSpecification).getFontColor();
}
@myersjustinc
myersjustinc / README.md
Created May 25, 2012 20:54
Convert HTML image map to SVG

This takes an HTML document that contains a client-side image map ( and elements) and creates an SVG image based on the shapes described in the image map (since SVG's a more general-purpose format than the HTML image map).

The HTML document doesn't necessarily have to be well-formed XML (there's a fallback to the BeautifulSoup parser for documents with some weirdness in them), which might be useful.

Dependencies

  • lxml
  • Python (of course)