Skip to content

Instantly share code, notes, and snippets.

View matthewberryman's full-sized avatar
💭
work work work

Matthew Berryman matthewberryman

💭
work work work
View GitHub Profile
@matthewberryman
matthewberryman / add-hadoop-slave.sh
Created June 7, 2016 03:39
Script to run on a slave before adding it in hortonworks sandbox master
AMBSRV="master.localdomain"
# or insert local repo name here
HWXREPO="s3.amazonaws.com/public-repo-1.hortonworks.com"
export AMBARIREPO="https://$HWXREPO/ambari/centos6/1.x/updates/1.6.1/ambari.repo"
yum -y install net-snmp net-snmp-utils ntp wget
wait
wget $AMBARIREPO -O /etc/yum.repos.d/ambari.repo
sed -i 's/SELINUX=permissive/SELINUX=disabled/g;s/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
chkconfig --del iptables
iptables -F
@matthewberryman
matthewberryman / postgis_2.1_to_2.2.sh
Last active September 12, 2016 05:51
my script for converting postgresql sql file from postgis 2.1 to postgis 2.2
#!/usr/bin/env bash
sed -i -e 's/libdir\/rtpostgis-2.1/libdir\/rtpostgis-2.2/g; s/libdir\/postgis-2.1/libdir\/postgis-2.2/g; s/LWGEOMFromWKB/LWGEOMFromEWKB/g' $1
024240cbc3b6a298b9484f6300dc01bb5ed9bcae3cb0e939f4fa6e5d97253be1e846ec19c884cd138e7f0064e3989fefbe9c5536fa931fffc1f890652271faef climate.nasa.gov-20170126.tar.bz2
7d4cece4bff77e3cf4eb4b0419db78c861fb75b57b795b3a50eae132a0639ae8c3e429f46d6300ee0729f71d83fbffb2b2647ec81350647cc457a5dcee481085 www.epa.gov-20170128.tar.bz2
With git you can have a hierarchical branch naming scheme using forward slashes,
e.g. foo/bar and foo/var but you can't have foo and foo/bar on linux/macOS (not
sure about Windows) because / is the directory delimiter character, so it clones
foo and then that directory already contains stuff in it and it can’t clone foo/bar
there (but foo/bar and foo/var work because in that case foo/ is empty bar the
subdirectories). However if two people separately create foo and foo/bar and push to
the CodeCommit implementation of git, CodeCommit git server accepts both, I presume
because as with most AWS services it uses s3 under the hood, and s3 technically
doesn't have directories as it's a key-value store with no hierachies. So then when
I go to git clone it back to my Mac or a Linux ec2 instance, I get:
@matthewberryman
matthewberryman / alces-flight-repast-configure.sh
Created April 24, 2017 11:52
alces-flight-repast-configure.sh
./configure --prefix=/opt/apps/repast --with-netcdf-include=/opt/gridware/local/el7/pkg/libs/netcdf/4.3.0/gcc-4.8.5+hdf5_serial-1.8.13/include --with-netcdf-lib-dir=/opt/gridware/local/el7/pkg/libs/netcdf/4.3.0/gcc-4.8.5+hdf5_serial-1.8.13/lib --with-netcdf-cxx-include=/opt/apps/netcdf++/include --with-netcdf-cxx-lib-dir=/opt/apps/netcdf++/lib --with-boost-include=/opt/gridware/depots/8168fdff/el7/pkg/libs/boost/1.60.0/gcc-4.8.5+openmpi-1.8.5+python-2.7.8/include/ --with-boost-lib-dir=/opt/gridware/depots/8168fdff/el7/pkg/libs/boost/1.60.0/gcc-4.8.5+openmpi-1.8.5+python-2.7.8/lib
@matthewberryman
matthewberryman / alces-influenza-library-installs.sh
Created April 24, 2017 13:55
alces-influenza-library-installs
#!/usr/bin/env bash
pdsh -g cluster 'sudo yum -y -e0 install libxml2-devel libcurl-devel libsigc++20-devel glibmm24-devel'
@matthewberryman
matthewberryman / alces-flight-mpi-fix.sh
Created April 24, 2017 13:33
alces flight fix for libmpi.so.1
sudo ln -s /opt/gridware/depots/8168fdff/el7/pkg/mpi/openmpi/1.10.2/gcc-4.8.5/lib/libmpi.so.12 /opt/gridware/depots/8168fdff/el7/pkg/libs/boost/1.60.0/gcc-4.8.5+openmpi-1.8.5+python-2.7.8/lib/libmpi.so.1
@matthewberryman
matthewberryman / cors-s3-upload.xml
Created June 21, 2017 20:53
CORS config for s3 uploads
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
@matthewberryman
matthewberryman / setup_nice_environment_on_mac.sh
Created September 4, 2017 23:30
setup_nice_environment_on_mac.sh
#!/usr/bin/env bash
brew upgrade
brew cleanup
brew install zsh git
cd ~
git clone https://github.com/matthewberryman/oh-my-zsh .oh-my-zsh && ln -s .oh-my-zsh/templates/zshrc.mac .
git clone https://github.com/creationix/nvm .nvm
echo "/usr/local/bin/zsh" | sudo tee -a /etc/shells > /dev/null
sudo chsh -s /usr/local/bin/zsh $USER
# Then close terminal and re-open and run
@matthewberryman
matthewberryman / git_fix_authordate.sh
Created December 13, 2017 02:07
Brings git AuthorDate in line with CommitDate for all git commits
#!/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