Skip to content

Instantly share code, notes, and snippets.

@toejough
toejough / keybase.md
Created February 23, 2017 14:28
keybase id verification

Keybase proof

I hereby claim:

  • I am toejough on github.
  • I am toejough (https://keybase.io/toejough) on keybase.
  • I have a public key ASCRum1gWhl9_pbyevVgZK5KgOi9iqecL5D1xChANdVzVgo

To claim this, I am signing this object:

@toejough
toejough / async-exploration.py
Last active July 19, 2016 14:24
exploring python asyncio
import asyncio
import functools
# [ Helpers ]
async def run_blocking(func, *args, **kwargs):
partial = functools.partial(func, *args, **kwargs)
loop = asyncio.get_event_loop()
await loop.run_in_executor(None, partial)
@toejough
toejough / pypi-vs-npm.md
Last active August 29, 2015 14:21
Packaging: python vs node (pypi vs npm)

This gist has been converted to a full repo (for collaboration!) here

@toejough
toejough / clone.js
Created May 16, 2015 00:06
clone javascript object
// clone a basic object (no functions or recursion)
// also handles 'undefined' and 'null'
function clone_obj(obj) {
if (obj === undefined || obj === null) {
return obj;
}
return JSON.parse(JSON.stringify(obj));
}
@toejough
toejough / ssh-agent-forward.md
Last active February 25, 2024 10:51
SSH Agent Forwarding in Python: Paramiko's undocumented API

What

A how-to for ssh-agent forwarding via Paramiko. Specifically, I used Paramiko v1.15.2 in this example.

Why

Paramiko's docs do not document the API required to do ssh-agent forwarding. I ended up finding out how by reading pull requests for ssh-agent forwarding features in frameworks that use Paramiko under the covers, like fabric and ansible.

Update:

Besides attempting to document this process here, I've opened a bug with Paramiko to document this API in their official docs.

How