Skip to content

Instantly share code, notes, and snippets.

Avatar

jamesbeedy jamesbeedy

  • PeopleDataLabs
  • Portland, OR
View GitHub Profile
View charm.py
#! /usr/bin/env python3
from ops.charm import CharmBase
from ops.main import main
from peer_relation import TestingPeerRelation
class PeererCharm(CharmBase):
View jwt-snapcraft.yaml
jwt:
source: https://github.com/benmcollins/libjwt.git
plugin: cmake
source-type: git
source-depth: 1
source-branch: master
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr/local
build-packages:
- libssl-dev
View nvidia-snapcraft.yaml
nvidia:
plugin: nil
override-pull: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
apt install software-properties-common -y
add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" -y
apt update -y
override-build: |
@jamesbeedy
jamesbeedy / 00-maas-000-mft-4.14.4-6-x86_64
Created Jun 3, 2020
00-maas-000-mft-4.14.4-6-x86_64
View 00-maas-000-mft-4.14.4-6-x86_64
#!/bin/bash -ex
# --- Start MAAS 1.0 script metadata ---
# name: 00-maas-000-mft-4.14.4-6-x86_64
# title: 00-maas-000-mft-4.14.4-6-x86_64
# description: mft-4.14.4-6-x86_64
# script_type: commissioning
# tags: configure_infiniband
# packages:
# url: https://www.mellanox.com/downloads/MFT/mft-4.14.4-6-x86_64-deb.tgz
# recommission: False
View serverless.yaml
service:
name: pdl-api-gui
app: pdl-api-gui
tenant: peopledatalabs
plugins:
- serverless-wsgi
- serverless-domain-manager
- serverless-python-requirements
View snapcraft.yaml
name: pdl-api
version: '0.1'
summary: pdl-api
description: |
PDL API
grade: stable
confinement: classic
View x-nginx.py
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017 James Beedy <jamesbeedy@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@jamesbeedy
jamesbeedy / run.sh
Created Nov 18, 2018 — forked from jalkjaer/run.sh
steps to automatically build k8s spark with latest hadoop 2 version and push to ECR
View run.sh
export HADOOP_VERSION=2.9.1
export SPARK_VERSION=2.3.2
export AWS_ACCOUNT_ID=<your numeric AWS account id>
export ECR_REGION=us-east-1
# Fetch and extract the spark source
curl -L "https://archive.apache.org/dist/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}.tgz" | tar -xzvf -
cd "spark-${SPARK_VERSION}"
# set maven opts according to https://spark.apache.org/docs/latest/building-spark.html
export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m"
View kafka_example.py
#!/usr/bin/env python
import threading, logging, time
import multiprocessing
from kafka import KafkaConsumer, KafkaProducer
class Producer(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
View ansible_linux_bridge_modules.py
#!/usr/bin/python
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: linux_bridge
version_added: "2.4"