Skip to content

Instantly share code, notes, and snippets.

💭
work work work

Matthew Berryman matthewberryman

💭
work work work
Block or report user

Report or block matthewberryman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View buildR.sh
#!/usr/bin/env bash
RVERSION=3.6.1
MKLVERSION=2019.4-070
curl https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | sudo apt-key add -
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get -y install intel-mkl-$MKLVERSION
sudo sh -c 'echo /opt/intel/lib/intel64 > /etc/ld.so.conf.d/mkl.conf'
View keybase.md

Keybase proof

I hereby claim:

  • I am matthewberryman on github.
  • I am shenmaxiu (https://keybase.io/shenmaxiu) on keybase.
  • I have a public key ASAF0lEfkgDogte9y-zF0hNkmCX3O1KtAYfCxK0zTAXPXQo

To claim this, I am signing this object:

View bootstrap.sh
#!/usr/bin/env bash
sudo apt update
sudo apt -y upgrade
sudo apt -y install build-essential gfortran cmake git curl zsh
cd $HOME
git clone https://github.com/matthewberryman/oh-my-zsh .oh-my-zsh
ln -s .oh-my-zsh/templates/zshrc.linux .zshrc
sudo chsh -s /bin/zsh $USER
@matthewberryman
matthewberryman / transcode.js
Created May 18, 2018
batch transcode using AWS Elastic Transcoder
View transcode.js
const AWS= require('aws-sdk');
AWS.config.update({region: 'ap-southeast-2'}); // set your region here
const elastictranscoder = new AWS.ElasticTranscoder();
const s3 = new AWS.S3();
var params = {
Bucket: 'my-bucket',
View aws-codebuild-extras.sh
#!/bin/bash
export CI=true
export CODEBUILD=true
export CODEBUILD_GIT_BRANCH=`git symbolic-ref HEAD --short 2>/dev/null`
if [ "$CODEBUILD_GIT_BRANCH" == "" ] ; then
CODEBUILD_GIT_BRANCH=`git branch -a --contains HEAD | sed -n 2p | awk '{ printf $1 }'`
export CODEBUILD_GIT_BRANCH=${CODEBUILD_GIT_BRANCH#remotes/origin/}
fi
@matthewberryman
matthewberryman / serverless_policy.json
Created Mar 22, 2018
IAM policy for using serverless in codebuild
View serverless_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1483564261000",
"Effect": "Allow",
"Action": [
"iam:GetRole",
"iam:CreateRole",
"iam:DeleteRole",
@matthewberryman
matthewberryman / clearconfig.js
Created Mar 21, 2018
clear all AWS config rules for a region
View clearconfig.js
let AWS = require('aws-sdk');
let configservice = new AWS.ConfigService({region: process.argv[2]});
const describeParams = {};
configservice.describeConfigRules(describeParams, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else {
for (let ruleIndex in data.ConfigRules) {
let params = {
@matthewberryman
matthewberryman / water_taps.sql
Created Feb 14, 2018
water tap extraction from West Africa HOT openstreetmap data
View water_taps.sql
SELECT * from osm.planet
WHERE type = 'node'
AND tags['man_made'] IN ('water_tap')
AND lon BETWEEN -15.0863 AND -7.3651
AND lat BETWEEN 4.3531 AND 12.6762;
View planet.sql
CREATE EXTERNAL TABLE planet (
id BIGINT,
type STRING,
tags MAP<STRING,STRING>,
lat DECIMAL(9,7),
lon DECIMAL(10,7),
nds ARRAY<STRUCT<ref: BIGINT>>,
members ARRAY<STRUCT<type: STRING, ref: BIGINT, role: STRING>>,
changeset BIGINT,
timestamp TIMESTAMP,
@matthewberryman
matthewberryman / git_fix_authordate.sh
Created Dec 13, 2017
Brings git AuthorDate in line with CommitDate for all git commits
View git_fix_authordate.sh
#!/usr/bin/env bash
git filter-branch --env-filter '
export GIT_AUTHOR_DATE=`git show -s --format=%ci $GIT_COMMIT`
' --tag-name-filter cat -- --branches --tags
You can’t perform that action at this time.