This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Copyright 2014 Dr Paul Brewer -- Economic and Financial Technology Consulting LLC | |
# This script is made available under the terms of the MIT LICENSE | |
# Intended as a helper for refactoring template-enhanced html | |
# warning: overwrites existing files. | |
# Does not delete or modify original file templates.html | |
# Thanks to Stack Overflow users for these helpful hints: | |
# use of htmlparser to unescape entities | |
# http://stackoverflow.com/a/21894821/103081 | |
# http://stackoverflow.com/a/663128/103081 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Copyright 2014 Dr Paul Brewer | |
# This python file is licensed to the public under the terms of the MIT License | |
# ----- | |
# When redirecting from name.com to www.name.com or from www.name.com to name.com | |
# it is easy to write the NGINX response incorrectly as | |
# return 301 http://name.com/$request_uri | |
# when it should be | |
# return 301 http://name.com$request_uri | |
# For more info see http://stackoverflow.com/a/7958540/103081 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2014 Dr Paul Brewer | |
# Economic and Financial Technology Consulting LLC -- www.eaftc.com | |
# | |
# python script to import CSV to mongoDB via csv.DictReader, pymongo | |
# | |
# You may copy or reuse this script under the terms of the standard MIT License: | |
# | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* replace.c code snippet | |
* Copyright 2015 Dr Paul Brewer Economic and Financial Technology Consulting LLC | |
* License: MIT | |
* http://opensource.org/licenses/MIT | |
*/ | |
#include <ctype.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copyright 2015 Paul Brewer | |
# This file is open source software | |
# License: The MIT License | |
import re | |
import sys | |
if len(sys.argv)!=3: | |
print 'Usage: ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
import os | |
print json.dumps(dict(os.environ)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2015 Paul Brewer Economic and Financial Technology Consulting LLC | |
# Released under the MIT Public License | |
# LICENSE: http://opensource.org/licenses/MIT | |
# Purpose: rationally removes inner commas and inner quotes from csv file fields | |
# Useful for Google BigQuery as of 2015-03 does not support quoted commas in CSV fields | |
# python ./unf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/bin/bash | |
# Do NOT use this as-is | |
# you probably need to change a few lines (disk, subnet, script) | |
# The google compute engine web UI may provide you | |
# with an equivalent command line for a specific configuration built in the web UI | |
gcloud compute instances create "my-spark-notebook" \ | |
--description "docker spark jupyter-notebook analysis platform" \ | |
--zone "us-east1-c" \ | |
--machine-type "n1-highcpu-32" \ | |
--subnet "default-754f8fec2c9e9fe2" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2013 Paul Brewer | |
// License: You may copy this file under the same terms as the MIT License | |
// located at http://opensource.org/licenses/MIT | |
// This file is provided AS IS WITH NO WARRANTY OF ANY KIND. All use is at your own risk. | |
// | |
// Status: July 13, 2013, Paul Brewer: First version. Simple test case passed. It needs to be more extensively tested. | |
// It lacks escaping for odd characters in strings, though a workaround is possible as described in the comments. | |
// | |
// July 14, 2013, Paul Brewer: JSON.stringify() used to stringify basic | |
// types such as string, number, null/undefined. This provides string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Working as of Dec 2016 | |
FROM ubuntu:14.04 | |
MAINTAINER drpaulbrewer@eaftc.com | |
RUN apt-get update && apt-get --yes upgrade && apt-get --yes install iputils-ping less emacs24-nox git curl wget build-essential screen python-pip software-properties-common | |
RUN echo deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse >>/etc/apt/sources.list && \ | |
echo deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse >>/etc/apt/sources.list && \ | |
echo deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse >>/etc/apt/sources.list && \ | |
echo deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse >>/etc/apt/sources.list | |
RUN apt-get update && apt-get --yes --no-install-recommends install nvidia-cuda-dev nvidia-cuda-doc | |
RUN apt-get --no-install-recommends --yes install nvidia-367; exit 0 |
OlderNewer