Skip to content

Instantly share code, notes, and snippets.

View JBKahn's full-sized avatar

Joseph Kahn JBKahn

View GitHub Profile
@JBKahn
JBKahn / install_vagrant_sudoers.sh
Created July 28, 2014 13:52
Add Vagrant NFS mount to sudoers file
#!/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 / gconf
Created August 5, 2014 05:18
sample of module
#!/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 / keybase.md
Created October 9, 2014 20:05
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 / update_returning.py
Created September 11, 2016 03:04 — forked from markgajdosik/update_returning.py
Update-returning support for Django 1.8. Based on: https://github.com/kanu/django-update-returning
"""
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
@JBKahn
JBKahn / denmark.py
Last active September 11, 2017 00:27
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()
@JBKahn
JBKahn / pyproject.toml
Created November 11, 2019 18:23
Poetry bug
[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 / pyproject.toml
Created January 9, 2020 13:42
Poetry flower issue
[tool.poetry]
name = "demo"
version = "0.1.0"
description = ""
authors = ["Joseph Kahn <email@email.com>"]
[tool.poetry.dependencies]
flower = "==0.9.3"
[build-system]