Skip to content

Instantly share code, notes, and snippets.

@jamesbeedy
jamesbeedy / run.sh
Created November 18, 2018 19:01 — forked from jalkjaer/run.sh
steps to automatically build k8s spark with latest hadoop 2 version and push to ECR
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"
@jamesbeedy
jamesbeedy / ovs-cheat.md
Created June 30, 2018 03:17 — forked from jianzzha/ovs-cheat.md
OVS cheat sheet

DB

ovs-vsctl list open_vswitch
ovs-vsctl list interface
ovs-vsctl --columns=ofport,name list Interface
ovs-vsctl --columns=ofport,name --format=table list Interface
ovs-vsctl --format=table --columns=name,mac_in_use find Interface name=br-dpdk1
ovs-vsctl get interface vhub656c3cb-23 name

ovs-vsctl set port vlan1729 tag=1729
@jamesbeedy
jamesbeedy / permutations.py
Created June 30, 2018 03:14 — forked from birkholz/permutations.py
Permutations of a String
import unittest
# Code
def get_permutations(input_str):
input_len = len(input_str)
results = []
if input_len == 0:
@jamesbeedy
jamesbeedy / forms.py
Created January 22, 2018 00:10 — forked from rombr/forms.py
How to add custom fields order to WTForms
from collections import OrderedDict
# ...
class OrderFormMixin(object):
'''
To apply add to Meta 'order' iterable
'''
def __init__(self, *args, **kwargs):
super(OrderFormMixin, self).__init__(*args, **kwargs)
@jamesbeedy
jamesbeedy / .gitignore
Created November 4, 2017 01:39 — forked from smoser/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw
@jamesbeedy
jamesbeedy / .gitignore
Created November 4, 2017 01:39 — forked from smoser/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw
#!/bin/bash
#
# This script will create xenial and trusty lxd images that will be used by the
# lxd provider in juju 2.1+ It is for use with the lxd provider for local
# development and preinstalls a common set of production packages.
#
# This is important, as between them, basenode and layer-basic install ~111
# packages, before we even get to any packages installed by your charm.
#
# It also installs some helpful development tools, and pre-downloads some
@jamesbeedy
jamesbeedy / es.yaml
Created December 21, 2016 19:55
elasticsearch package doesn't work in lxc
#cloud-config
output:
all: "|tee -a /tmp/cloud.out"
bootcmd:
- curl -sL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
apt_sources:
- source: "deb https://artifacts.elastic.co/packages/5.x/apt stable main"
packages:
- elasticsearch
runcmd:
@jamesbeedy
jamesbeedy / Install-php7.md
Created September 28, 2016 03:14 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
server { listen 80;
server_name example.com;
access_log /var/log/example.com/nginx.access.log;
error_log /var/log/example.com/nginx.error.log;
root /var/www/apps/example.com/public;
charset utf-8;
location / {
rewrite ^ https://$host$request_uri? permanent;
}