Skip to content

Instantly share code, notes, and snippets.

Avatar

Joseph Kahn JBKahn

View GitHub Profile
@JBKahn
JBKahn / pyproject.toml
Created Jan 9, 2020
Poetry flower issue
View pyproject.toml
[tool.poetry]
name = "demo"
version = "0.1.0"
description = ""
authors = ["Joseph Kahn <email@email.com>"]
[tool.poetry.dependencies]
flower = "==0.9.3"
[build-system]
View pyproject.toml
[tool.poetry]
name = "testing-poetry"
version = "0.1.0"
description = ""
authors = ["Nick Presta <nick@waveapps.com>"]
[[tool.poetry.source]]
name = "private_pypi"
url = "our_custom_url"
@JBKahn
JBKahn / denmark.py
Last active Sep 11, 2017
Piprot for use with another index url
View denmark.py
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()
View update_returning.py
"""
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 https://github.com/kanu/django-update-returning, with modifications to
View keybase.md

Keybase proof

I hereby claim:

  • I am jbkahn on github.
  • I am jbkahn (https://keybase.io/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
JBKahn / gconf
Created Aug 5, 2014
sample of module
View gconf
#!/usr/bin/python
import json
import re
import subprocess
from subprocess import call
from ansible.module_utils.basic import *
def _escape_single_quotes(string):
@JBKahn
JBKahn / install_vagrant_sudoers.sh
Created Jul 28, 2014
Add Vagrant NFS mount to sudoers file
View install_vagrant_sudoers.sh
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# slightly modified version of https://gist.github.com/GUI/2864683
# 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
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: [127.0.0.1]
@JBKahn
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
run.sh # one command script for install requirements, cloning the repo and provisioning.
roles/
common/ # this hierarchy represents a "role"
tasks/ #
*.yml # <-- tasks files i'll talk about later
files/ #
@JBKahn
JBKahn / movie_recs.md
Last active Aug 29, 2015
Movie Reccomendations
View movie_recs.md
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