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 -e | |
# Copyright 2020 Paul Brewer, Economic and Financial Technology Consulting LLC | |
# Open Source License: The MIT License, see https://opensource.org/licenses/MIT | |
# rsyncs (read-only) all files in all accessible Google Cloud Storage Buckets to ~/gb/<bucketname>/ | |
# Important: This script can use many gigabytes of Google Cloud outgoing bandwidth even in a short period of time. | |
# All fees for Google bandwidth are the responsibility of the user running this software. | |
mkdir -p ~/gb | |
cd ~/gb | |
BUCKETLIST=$(gsutil ls gs://) | |
for b in $BUCKETLIST |
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 | |
# originally /root/nginx-alert.sh | |
APK='your-mailgun-key' # replace with mailgun key | |
FROM='Nginx Alert <[email protected]>' | |
TO='you@email' # replace with recipients | |
# SUBJECT, TEXT is exported from caller | |
curl -s --user $APK \ | |
https://api.mailgun.net/v3/mg.econ1.net/messages \ | |
-F from="$FROM" \ | |
-F to="$TO" \ |
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 python3 | |
# File: RandomizedSniperFailureModel.py | |
# Copyright 2018 Paul Brewer, Economic and Financial Technology Consulting LLC | |
# This code approximates allocation efficiency, source of efficiency losses, and | |
# Gini Coefficient for profits accumulated over many periods in a market populated | |
# by a mix of Gode and Sunder (1993) ZI robots and Todd Kaplan's Sniper robots. | |
# In this code, we only model the "failsafe" case where the snipers fail to find or | |
# act on exceptional prices or low bid-ask spread and so execute the end-of-period failsafe | |
# strategy of accepting any existing profitable bid/ask. Taking an average | |
# over random shuffling of Snipers imperfectly approximates the interactions over multiple |
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
/* | |
* GINISS and THEILT Copyright 2018- Paul Brewer, Economic and Financial Technology Consulting LLC <[email protected]> | |
* This file may be used or copied under the terms of the MIT License as explained below or at https://opensource.org/licenses/MIT | |
* The 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 in the Software without restriction, including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | |
* to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the | |
* Software. |
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
// upload.js, from https://github.com/googledrive/cors-upload-sample | |
// Contributors Steve Bazyl, Mike Procopio, Jeffrey Posnick, Renaud Sauvain | |
// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Implements Resumable Upload for Google Drive as described by | |
// https://developers.google.com/drive/v3/web/resumable-upload | |
// | |
// Modified by Paul Brewer, Economic and Financial Technology Consulting LLC | |
// Nov. 1 2017 | |
// 1. use Google Drive API V3 instead of V2 |
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 2017 Paul Brewer, Economic and Financial Technology Consulting LLC <[email protected]> | |
// License: The MIT License. See: https://opensource.org/licenses/MIT | |
// Google has an example using base64; hex is a little safer to copy/paste and recognize as incorect | |
// see https://cloud.google.com/storage/docs/using-encryption-keys |
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 -e | |
apt-get --yes update | |
apt-get --yes install openjdk-8-jdk emacs-nox curl wget apt-transport-https | |
# modified from "Installing sbt on Linux" at http://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html | |
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 |
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 [email protected] | |
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 |
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
#!/usr/bin/env python | |
import json | |
import os | |
print json.dumps(dict(os.environ)) |
NewerOlder