Skip to content

Instantly share code, notes, and snippets.


Joseph Kahn JBKahn

View GitHub Profile
JBKahn / pyproject.toml
Created Jan 9, 2020
Poetry flower issue
View pyproject.toml
name = "demo"
version = "0.1.0"
description = ""
authors = ["Joseph Kahn <>"]
flower = "==0.9.3"
View pyproject.toml
name = "testing-poetry"
version = "0.1.0"
description = ""
authors = ["Nick Presta <>"]
name = "private_pypi"
url = "our_custom_url"
JBKahn /
Last active Sep 11, 2017
Piprot for use with another index url
import argparse
import pip
from piptools.repositories.pypi import PyPIRepository
from piptools.resolver import Resolver
from piptools.scripts.compile import get_pip_command
def print_rotten_packages(file_path, extra_index_url):
pip_command = get_pip_command()
Implements manager with "UPDATE .. RETURNING" clause support. Columns following
the "RETURNING" clause may be provided using `values_list()` method. If not
specified, the update statement will yield full records.
Queries executed with use of `UpdateReturningManager` or
`UpdateReturningDefaultManager` return a generator allowing easy iterating over
the returned entries.
Based on, with modifications to

Keybase proof

I hereby claim:

  • I am jbkahn on github.
  • I am jbkahn ( on keybase.
  • I have a public key whose fingerprint is EF77 BC2B FF39 F57E 29B6 DF01 0785 C747 C46E A77C

To claim this, I am signing this object:

JBKahn / gconf
Created Aug 5, 2014
sample of module
View gconf
import json
import re
import subprocess
from subprocess import call
from ansible.module_utils.basic import *
def _escape_single_quotes(string):
JBKahn /
Created Jul 28, 2014
Add Vagrant NFS mount to sudoers file
# Script for placing sudoers.d files with syntax-checking
# slightly modified version of
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
JBKahn / Output.txt
Created Jul 28, 2014
Ansible Output
View Output.txt
joseph@Batcave-Ubuntu:~/dev/provisioning-local$ sudo rm -fr ../../setup/base16-gnome/
[sudo] password for joseph:
joseph@Batcave-Ubuntu:~/dev/provisioning-local$ ansible-playbook setup.yml -i HOSTS --ask-sudo-pass
sudo password:
PLAY [a playbook to setup my local machine with my basic customizations] ******
GATHERING FACTS ***************************************************************
ok: []
JBKahn / File Structure
Last active Aug 29, 2015
Ansible Post
View File Structure
setup.yml # master playbook
HOSTS # HOSTS file which defines where the script will run. This points to localhost.
requirements.txt # the requierments for running this playbook, including ansible # one command script for install requirements, cloning the repo and provisioning.
common/ # this hierarchy represents a "role"
tasks/ #
*.yml # <-- tasks files i'll talk about later
files/ #
JBKahn /
Last active Aug 29, 2015
Movie Reccomendations
Seen Not yet seen
A Bronx Tale 30 for 30: The Two Escobars
Adaptation All Joel Coen movies
Apocolypto Barbarian at the Gate
Batman The Animated Series Blankman
Being John Malkovich Boys in the Hood?
Conspiracy Theory BUSHWHACKED?!??!
Dazed and Confused Clerks II
Demolition Man Cocaine Cowboys