Skip to content

Instantly share code, notes, and snippets.

@atl
atl / README.md
Last active February 15, 2019 16:57
enable ssh-agent transparently and pervasively in Mac OS X Lion/Mountain Lion

This is a quick configuration upgrade that allows you to continue using ssh as you have, but with the added benefit of ssh-agent forwarding when logged into remote hosts, meaning no more keys on intermediate servers and the like.

Requirements

This snippet assumes that you've been using ssh, ssh keys, and authorized_keys on remote hosts.

  • .ssh/id_dsa and/or .ssh/id_rsa already exist
  • keys are authorized on the remote servers you have been using
  • you have at least a minimal working .ssh/config file
@thriveth
thriveth / CBcolors.py
Created January 22, 2014 14:52
A color blind/friendly color cycle for Matplotlib line plots. Might want to shuffle it around a bit more,but already not it gives kinda good contrasts between subsequent colors, and shows reasonably well in colorblind filters (though not in pure monochrome).
CB_color_cycle = ['#377eb8', '#ff7f00', '#4daf4a',
'#f781bf', '#a65628', '#984ea3',
'#999999', '#e41a1c', '#dede00']
@jakevdp
jakevdp / discrete_cmap.py
Last active August 26, 2024 01:46
Small utility to create a discrete matplotlib colormap
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""
@wolfiex
wolfiex / bivariate.py
Last active March 19, 2022 19:41
Bivariate colourplot edit
import numpy as np
import matplotlib.pyplot as plt
def colorFromBivariateData(Z1,Z2,cmap1 = plt.cm.Blues, cmap2 = plt.cm.Reds, preset = False):
if preset:
z1mn = 0.
z2mn = 0.
z1mx = 1.
z2mx = 1.