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 / fresh-cognicity-database.sh
Last active December 6, 2015 22:56
fresh-cognicity-database
#!/usr/bin/env bash
# assumes https://github.com/smart-facility/cognicity-schema and https://github.com/smart-facility/cognicity-reports
# both checked out using default directory names (matching trailing part of url)
createdb -U postgres -h $DB_HOST -E utf8 cognicity
cd cognicity-schema
psql -U postgres -h $DB_HOST -d cognicity -f schema.sql
cd sample_data/infrastructure
find . -name '*.sql' -exec psql -U postgres -h $DB_HOST -d cognicity -f {} ';'
@matthewberryman
matthewberryman / wpa_supplicant.conf
Created March 16, 2016 02:51
University of Wollongong UoW wpa_supplicant.conf example
country=AU
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="UOW"
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP
auth_alg=OPEN
@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
@matthewberryman
matthewberryman / 01-http_basic_auth.config
Created February 13, 2017 11:10
config file for adding basic auth to an elastic beanstalk nginx config
files:
/etc/nginx/.htpasswd:
mode: "000644"
owner: root
group: root
content: |
username:passwd_hash
# use httpasswd -c -b password_file desired_username desired_password
# and copy and paste the line from that in to username:password_hash
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-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 / 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'