Skip to content

Instantly share code, notes, and snippets.

View andypowe11's full-sized avatar

Andy Powell andypowe11

View GitHub Profile
#!/bin/bash
# g4dn.2xlarge
# amazon/Deep Learning AMI (Ubuntu 18.04) Version 39.0
# https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life
sudo apt update
sudo apt upgrade
@andypowe11
andypowe11 / Dockerfile-miniconda-geopandas
Last active December 9, 2020 20:20
Dockerfile to build a miniconda container with support for matplotlib, jupyter, geopandas and descartes
FROM continuumio/miniconda
MAINTAINER andy@andypowe11.net
# Install jupyter and geopandas
RUN conda install matplotlib && conda install jupyter && conda install geopandas && conda install descartes && mkdir /opt/notebooks
EXPOSE 8888
CMD ["/bin/bash", "-c", "jupyter notebook --allow-root --notebook-dir=/opt/notebooks --ip='0.0.0.0' --port=8888 --no-browser"]
import os
from threading import Timer
import time
import datetime
import awscam
import cv2
from botocore.session import Session
from threading import Thread
# Setup the S3 client
#*****************************************************
# *
# Copyright 2018 Amazon.com, Inc. or its affiliates. *
# All Rights Reserved. *
# *
#*****************************************************
""" A sample lambda for face detection"""
from threading import Thread, Event
import os
import json
Application Integration;AWS Step Functions + Amazon SageMaker & AWS Glue;https://aws.amazon.com/about-aws/whats-new/2018/11/aws-step-functions-adds-eight-more-service-integrations/
Application Integration;AWS Step Functions + Workflow Automation;https://aws.amazon.com/about-aws/whats-new/2018/11/aws-step-functions-adds-eight-more-service-integrations/
Analytics;AWS Lake Formation;https://aws.amazon.com/about-aws/whats-new/2018/11/announcing-aws-lake-formation/
Analytics;Amazon Quicksight;https://aws.amazon.com/about-aws/whats-new/2018/11/aws-announces-ml-insights-preview-for-amazon-quicksight/
Analytics;Amazon Kinesis Data Analytics for Java Applications;https://aws.amazon.com/about-aws/whats-new/2018/11/amazon-kinesis-data-analytics-now-supports-java-based-stream-processing-applications/
Analytics;Amazon Managed Streaming for Kafka;https://aws.amazon.com/about-aws/whats-new/2018/11/introducing-amazon-managed-streaming-for-kafka-in-public-preview/
Blockchain;Amazon Managed Blockchain;https://aws.amazon.com/ab
install.packages("lubridate")
library("lubridate")
rawdata <- read.csv("BathCarParks/BANES_Historic_Car_Park_Occupancy.csv", row.names=NULL)
refineddata <- rawdata[,c("LastUpdate", "Name", "Occupancy", "Capacity")]
data <- refineddata[complete.cases(rawdata),]
data <- data[data$Name!='test car park',]
data <- data[data$Occupancy>0,]
data <- data[!duplicated(data[,c("LastUpdate", "Name", "Occupancy", "Capacity")]),]
data$Proportion <- data$Occupancy/data$Capacity
data <- data[data$Proportion < 1.1,]
import pandas as pd
import numpy as np
import utilities as ut
import transform_records as tr
import time as tm
# Import BANES car parking data
rawData = pd.read_csv('../../../data/BANES_Historic_Car_Park_Occupancy.csv')
# Transform the data so that it is in a format suitable for import into AWS
#!/bin/sh
# Tested on Ubuntu 16.04 LTS, amd64 xenial image build on 2017-08-03
# Download and check Anaconda
# See https://docs.anaconda.com/anaconda/install/linux
cd /tmp
wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
# Expect c989ecc8b648ab8a64731aaee9ed2e7e
md5sum Anaconda3-5.0.1-Linux-x86_64.sh
#!/bin/bash
# Use this script to copy shared (libs) files to Apache/Lighttpd chrooted
# jail server.
# ----------------------------------------------------------------------------
# Written by nixCraft <http://www.cyberciti.biz/tips/>
# (c) 2006 nixCraft under GNU GPL v2.0+
# + Added ld-linux support
# + Added error checking support
# ------------------------------------------------------------------------------
# See url for usage:
!/bin/sh
# Create a chroot jail in '/users' and user 'testuser'
# Requires /tmp/l2chroot to be installed with 755 permissions
set -x
yum -y update
# TZ
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
# rssh
yum -y install rssh